After having some pacman issues, I am not longer able to boot into my arch linux systemafter grub. All I get is a black screen without the ability to input anything. I believe this is due to accidentally removing the base-devel package and possibly having previous pacman issues I was unaware of.
What happened:
I was trying to install PHP for a take home project I'm doing for an interview process. I used
sudo pacman -S php
and several other variants with different versions, but I always received an error. I forget which error it was, but I believe I got the message that it could not recognize the package. This was the first package I've attempted to install in some months, so I'm unsure if I had pacman issues beforehand or if they just surfaced now. Anyway, I decided to test if it was a pacman issue or some issue with the php package itself. So, I naively thought, "I'll try downloading some random package other than PHP to see if it works, then remove it if it does download since I don't care about it anyway." I was dumb and googled something along of the lines of "cool arch packages" and saw someone mention that base-devel was cool. So, I decided to install it. It worked! Or so I think? Either it worked, or it was already on my system, so I thought it worked since I didn't read the output too closely. Since I thought I didn't need the package I presumably downloaded as a pacman test, I ran
sudo pacman -R base-devel
to not have that space taken up and everything went south. I assume this is some foundational package and I destroyed my computer. Afterwards, pacman really stopped working altogether. I received an error relating to glibc and lib32-glibc not being found and pacman wouldn't run. I tried other things like using a hotkey to open a terminal and opening nemo, but neither worked. It was at this point I realized, I f***ed up. Now, when I boot my computer, after grub, I just get a black screen with no way to input anything.
What I've attempted:
1. I'm currently booting through a live USB trying to find a way to get things to work. I am mounting my partition to /mnt and trying to repair pacman. I've consulted this link for help: https://wiki.archlinux.org/index.php/Pacman#Pacman_crashes_during_an_upgrade and have tried the following:
mount /dev/sdaX /mnt
mount -t proc proc /mnt/proc; mount --rbind /sys /mnt/sys; mount --rbind /dev /mnt/dev
pacman --sysroot /mnt -Syu
When I do this last step, I get
error: failed retrieving file 'community.db' from : Could not resolve host:
I plugged in an ethernet cable and do have internet, as I've used ping successfully.
Where I mounted, my /etc was empty, so copied pacman from the live USB onto my mounted partition to try to use it. It still didn't work, so I thought maybe I had an issue with the mirrors.
I followed this link: https://wiki.archlinux.org/index.php/Mirrors
After including US mirrors above the Include lines in pacman.conf, I tried running
pacman -Syyu
as the page mentions and it does look like things downloaded. But, I still have failures retrieving "linux-firmware-20210315...pkg.tar.zst" and "logrotate-3.18.0...pkg.tar.zst". I don't know if my mirrors are out of date or if there is another issue. After this, I've run
pacman --sysroot /mnt -Syu
again, but I still get
error: failed retrieving file 'community.db' from : Could not resolve host:
2. Another thing I tried was from this link: Arch GLIBC_2.33 not found errors after updating one package
I mounted my partition to /mnt, then ran
pacstrap /mnt glibc lib32-glibc
The output of this is:
==>Creating install root at /mnt
mount: /mnt/proc: proc already mounted on /proc.
==>Error: failed to setup chroot /mnt
I am (obviously) by no means an experienced user, so I don't even know if I am remotely on the right track with either of these approaches, but I'd love your input on this issue and would be grateful for anyone's time and wisdom. I actually have 4 job interviews this week and 2 onsites coming up, so I need to reverse my dimwittedness and hope to resolve this problem before it's too late haha. Thanks!