You are not logged in.
I was following OSDev's tutorial on making an OS from scratch. While trying to build a cross-compiler for i686 targets, somehow this GCC compiler and binutils ended up as my system's compiler and linker.
I have pacman-static thankfully and i ran `pacman -S gcc`, but that also implicitly created a mismatch with the libraries i assume.
I tried many other pacman-static commands after that like `pacman-static -Syu` and `pacman-static -Syu $(pacman-static -Qqn)`. None of which worked.
Now almost all dynamically linked programs don't work (pacman, firefox, vscode, nodejs, etc.).
Here are the error logs of pacman, firefox:
`pacman: symbol lookup error: /usr/lib/libicuuc.so.75: undefined symbol: _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE, version GLIBCXX_3.4.30`
`/usr/lib/firefox/firefox: symbol lookup error: /usr/lib/firefox/firefox: undefined symbol: _ZSt20__throw_length_errorPKc, version GLIBCXX_3.4`
How can I synchronize/fix my system without a fresh re-install?
Any help is appreciated.
Last edited by ChrisKayKos (2024-12-23 13:22:22)
Offline
None of which worked.
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
I assume your shell doesn't work itfp?
Boot the install iso, mount the intallation root into /mnt (and optionally the boot partition into /mnt/boot) do NOT chroot!! into the system but
LC_ALL=C pacman --root=/mnt -Qkk |& grep -v ', 0 altered files' | grep -v backup > /tmp/howbadisit.txt
cat /tmp/howbadisit.txt | curl -F 'file=@-' 0x0.st
If it's like _really_ bad, you can also re-install all packages
pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Syu $(pacman --root=/mnt -Qqn)
Offline
Sorry for the paraphrasing, i am kinda anxious. I tested compiling and running a simple c++ program. The default linking gcc does doesn't have a problem. But when I linked with raylib, glfw didn't work correctly.
Could you explain what the commands you sent do? Especially the first 1. And why pacman-static can't do these? I thought pacman-static could help here to speed up, at least that's what my naivety thinks.
BTW i still have access to the system as i have not shut it down yet, i dont know if i had made that clear before.
Thanks
Last edited by ChrisKayKos (2024-12-21 19:14:59)
Offline
The Qkk checks package integrity, the greps filter out some noise . but you don't have any reason to trust that explanation either, do you?
=> man pacman
The problem likely isn't pacman-static. You've not revealed the nature of "None of which worked." but you either had issues with the subshell or alpm hooks.
Either way, using the pacman from the iso side-steps any defects on the target system and just fixes it offline.
Offline
Sorry for the delay, I just saw that you said that you assume my shell doesn't work. Actually, I have kept my laptop alive for 2 days and the bash shell works. I also have access to the web with Vivaldi browser.
I am posting back because I feel kind of insecure rebooting and losing the last remains of my machine. Once I had a partial upgrade and tried to rebooted to re installed the packages from a USB stick, I somehow messed up the EFI partition and the kernel couldn't work.
So I am kindly asking, if there is a way to do it without re-booting? I can provide you with my system info. If you have free time ofc.
Thank you.
Offline
Adjusting seth's commands to use pacman-static for the running system (assumes grep cat and curl as well as pacman-static work):
LC_ALL=C pacman-static -Qkk |& grep -v ', 0 altered files' | grep -v backup > /tmp/howbadisit.txt
cat /tmp/howbadisit.txt | curl -F 'file=@-' 0x0.st
Offline
LC_ALL=C pacman-static -Qkk |& grep -v ', 0 altered files' | grep -v backup > /tmp/howbadisit.txt cat /tmp/howbadisit.txt | curl -F 'file=@-' 0x0.st
I tried this and
sudo pacman-static --cachedir=var/cache/pacman/pkg/ -Syu $(pacman-static --root=/mnt -Qqn)
.
Apparently 0x0.st is banned in my country because it returns 451 Unavailable For Legal Reasons
As for re installing all packages I got this:
error: could not open file var/cache/pacman/pkg/download-LBdjFA/linux-6.12.6.arch1-1-x86_64.pkg.tar.zst.part: No such file or directory
error: failed to setup a download payload for linux-6.12.6.arch1-1-x86_64.pkg.tar.zst
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
Last edited by ChrisKayKos (2024-12-22 20:22:17)
Offline
As for re installing all packages I got this:
Does "pacman-static --disable-sandbox …" help w/ that?
Did you get other errors beforehand?
Can you reach termbin?
cat /tmp/howbadisit.txt | nc termbin.com 9999
Actually, I have kept my laptop alive for 2 days and the bash shell works.
Running processes will not be affected by damaged files on disk, can you run a nested shell, ie
/bin/bash
from inside the active bash?
I am posting back because I feel kind of insecure rebooting and losing the last remains of my machine. Once I had a partial upgrade and tried to rebooted to re installed the packages from a USB stick, I somehow messed up the EFI partition and the kernel couldn't work.
The good thing is that you're not alone. loqs is here, I'm here and in doubt there's at least half a dozen other users competent enough - we'll carry you through this.
Plus you already made the mistake to not mount the EFI partition (or mount it into the wrong location), so you're gonna gonna make /that/ mistake again
Make sure to have access to a recent-ish (otherwise you'll run into a dated keyring) arch install iso.
The first thing you want to do is to fsck the partition before mounting it into /mnt, mount your boot and/or EFI partition.
Then see #2
Offline
Does "pacman-static --disable-sandbox …" help w/ that?
Did you get other errors beforehand?
I accidentaly typed pacman-static --root=/mnt on my machine lol. But still, after I fixed that, I would get errors (posted below). I tried to re install all pkgs before I opened the post and the same would happen
can you run a nested shell, ie
/bin/bash
from inside the active bash?
Yes I can! But i think there is something wrong, before when i used to double click links it would open them (i use urxvt). I dont think that has anything to do with that tho.
The good thing is that you're not alone. loqs is here, I'm here and in doubt there's at least half a dozen other users competent enough - we'll carry you through this.
Plus you already made the mistake to not mount the EFI partition (or mount it into the wrong location), so you're gonna gonna make /that/ mistake again
Lol, i am quite sure i will make screw up again, thanks for the help so far guys
The first thing you want to do is to fsck the partition before mounting it into /mnt, mount your boot and/or EFI partition.
I think what screwed up my EFI partition is that, either i chrooted into the system, or didn't unmount the filesystem, or i didnt mount neither the EFI partition nor the /boot.
Why did you say previously not to chroot?
Why do i have to mount the EFI or boot?
Here are the logs:
LC_ALL=C pacman-static -Qkk |& grep -v ', 0 altered files' | grep -v backup > /tmp/howbadisit.txt
cat /tmp/howbadisit.txt | curl -F 'file=@-' 0x0.st
running it:
https://termbin.com/wrpf
Re-installing pkgs & Further inspection:
https://termbin.com/i523
Offline
Why did you say previously not to chroot?
Because you're facing corrupted libraries on the installed system - the reliable way to fix that is offline, ie. without using that system at all.
Seems the only (major) issue is
warning: gcc-libs: /usr/lib/libstdc++.so.6 (Symlink path mismatch)
warning: gcc-libs: /usr/lib/libstdc++.so.6 (Modification time mismatch)
?
ls -l /usr/lib/libstdc*
Offline
Just for clarification:
Why do i have to mount the EFI or boot?
You need to make sure the EFI system partition is mounted correctly before attempting to reinstall the packages because the kernel image needs to be stored under /boot/, which might be on the ESP.
Check /etc/fstab in the installed system to see what should be mounted where. Post the file here if you can't understand it.
Jin, Jîyan, Azadî
Offline
ls -l /usr/lib/libstdc*
chrisk@chrisk-arch src(master) $ ls -l /usr/lib/libstdc*
-rw-r--r-- 1 root root 6998160 Dec 14 12:06 /usr/lib/libstdc++.a
-rwxr-xr-x 1 root root 955 Dec 21 10:47 /usr/lib/libstdc++.la
-rw-r--r-- 1 root root 323 Dec 21 10:47 /usr/lib/libstdc++.modules.json
lrwxrwxrwx 1 root root 19 Dec 14 12:06 /usr/lib/libstdc++.so -> libstdc++.so.6.0.33
lrwxrwxrwx 1 root root 19 Dec 23 08:54 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.34
-rwxr-xr-x 1 root root 22040176 Dec 14 12:06 /usr/lib/libstdc++.so.6.0.33
-rwxr-xr-x 1 root root 498704 Dec 21 10:47 /usr/lib/libstdc++.so.6.0.34
-rw-r--r-- 1 root root 1098178 Dec 14 12:06 /usr/lib/libstdc++exp.a
-rw-r--r-- 1 root root 797620 Dec 14 12:06 /usr/lib/libstdc++fs.a
Offline
-rwxr-xr-x 1 root root 498704 Dec 21 10:47 /usr/lib/libstdc++.so.6.0.34
-rwxr-xr-x 1 root root 498704 Dec 21 10:47 /usr/lib/libstdc++.so.6.0.34
wtf is that?
sudo ln -sf libstdc++.so.6.0.33 /usr/lib/libstdc++.so.6
Edit:
pacman -Qo /usr/lib/libstdc++.so.6.0.34
Last edited by seth (2024-12-23 10:01:10)
Offline
Check /etc/fstab in the installed system to see what should be mounted where. Post the file here if you can't understand it.
/etc/fstab
chrisk@chrisk-arch ~ $ cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p3
UUID=e323702e-a372-4f2e-a494-4bf0c5fed266 / ext4 rw,relatime,stripe=32 0 1
# /dev/nvme0n1p1
UUID=3984-9C20 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p2
UUID=3ba09192-2038-4f0e-92d3-39cddb9df743 none swap defaults 0 0
Inside the /boot directory there is a direcotry EFI with grub uefi inside
You need to make sure the EFI system partition is mounted correctly before attempting to reinstall the packages because the kernel image needs to be stored under /boot/, which might be on the ESP.
Let's say I don't mount the kernel image, what could/would happen?
Offline
sudo ln -sf libstdc++.so.6.0.33 /usr/lib/libstdc++.so.6
Everything works now! Nothing depended on 6.0.34 so it doesn't create any out-of-sync packages.
How did you know (except being a genius)?
6.0.34 is not backwards compatible?
Last edited by ChrisKayKos (2024-12-23 10:12:38)
Offline
Let's say I don't mount the kernel image, what could/would happen?
The system would be rendered unbootable if you attempted to change the kernel version without the /boot/ partition being mounted.
So use
mount /dev/nvme0n1p3 /mnt
mount /dev/nvme0n1p1 /mnt/boot
Then proceed with the repairs under /mnt/.
Last edited by Head_on_a_Stick (2024-12-23 10:14:42)
Jin, Jîyan, Azadî
Offline
ChrisKayKos wrote:Let's say I don't mount the kernel image, what could/would happen?
The system would be rendered unbootable if you attempted to change the kernel version without the /boot/ partition being mounted.
So use
mount /dev/nvme0n1p3 /mnt mount /dev/nvme0n1p1 /mnt/boot
Then proceed with the repairs under /mnt/.
Theoretically would there be a fix?
Offline
Just reinstall the kernel with the /boot/ partition correctly mounted. We see that sort of thing pretty regularly here.
EDIT: and please don't full-quote unnecessarily, it bloats the thread.
Last edited by Head_on_a_Stick (2024-12-23 10:17:14)
Jin, Jîyan, Azadî
Offline
6.0.34 is not backwards compatible?
The present comppilation isn't (see the filesize and the errors) - where did that thing come from tbw?
How did you know (except being a genius)?
Mileage.
Edit: Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Last edited by seth (2024-12-23 10:17:29)
Offline
where did that thing come from tbw?
No idea lol. Probably by building gcc from source and installing it on my /usr/lib
Thank you everyone for everything! I fixed my machine and most importantly, learnt a lot of things because of your support
Offline
Oh, the genius almost forgot: the one in /usr/lib32 is also affected.
Offline
So, my genius actually solved the problem but failed to realize that while re installing all the pkgs, a partial upgrade occurred ( that's what I think at least ). Trying to boot into the system, I get "kernel not found" then I go to some sort of logs that say there is an offset in the kernel.
I saw another post with dealing with the same problem. The answer was to chroot into the machine then pacman -S linux.
Thanks to Head_on_a_Stick, I know I have to mount the boot too. My question now is, how to unmount properly? Do I just unmount /mnt, or do I have to do anything with /mnt/boot?
Offline
Why not try
umount /mnt
And see what it says if /mnt/boot/ is still mounted
Exiting the chroot and rebooting should un-mount everything automatically anyway.
Jin, Jîyan, Azadî
Offline
I get "kernel not found"
That's not a partial update and if you previously ran into pacman errors, nothing had been updated?
Offline
Why not try
umount /mnt
And see what it says if /mnt/boot/ is still mounted
You are right! I got my system back. It was saying target busy when trying to unmount (ngl i sweated over that part), but i found out it was because of /boot being nested in the /mnt.
Thanks
That's not a partial update and if you previously ran into pacman errors, nothing had been updated?
I am thinking that too. Unfortunately i didnt save the full logs.
My reason to believe it was caused by partial upgrade is that even though it downloaded & installed the packages, it couldn't build the kernel img as bsdcpio & other bsd commands were failing because of libstdc++
Last edited by ChrisKayKos (2024-12-23 13:23:21)
Offline