I messed up my system and need urgent help. Please bare with me. I'll be more than happy to provide all details. This PC has really important work for me. I know it won't start again if it is somehow shut down. Please help.
I tried to install kernel 5.16 on ubuntu 20.04.03.
For that I downloaded the missing packages from 20.4.03 and force-installed them. Following instructions here. This changed some locale files and force-installed those packages. When I ran the sudo apt --fix-broken install
, it prompted me to remove several packages and libc-bin. I had to type 'Yes, do as I say!'
for this. Then it removed everything and showed dpkg error code: 2.
Now I was having three issues:
a. ldconfig
not found on PATH
.
b. root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
c. dpkg
error in point 1 was never gone.
I tried everything to fix this like trying to install libc-bin again and other stuff but couldn't as no command would run due to path variable issue. I tried to fix it using the solutions mentioned here by changing $PATH variable in /.root/.bashrc/ and .bashrc but nothing worked. So I tried restarting my terminal and boom, it doesn't open now.
So to conclude this, now my gnome-terminal isn't opening, pressing ctrl+alt+F1
redirects me back to GUI and I can't do anything. I tried installing VScode but snap isn't working too. I know I messed up badly. But I can't clean install this system. Please help even if there is slight hope. I have tried to mention every issue as clearly as I remember.
For reference, these are the list of all ubuntu 22.04 packages I tried to force-install:
libc6-dev_2.34-0ubuntu3_amd64.deb
libc-bin_2.34-0ubuntu3_amd64.deb
libc-dev-bin_2.34-0ubuntu3_amd64.deb
libnsl2_1.3.0-2build1_amd64.deb
libnsl-dev_1.3.0-2build1_amd64.deb
libssl3_3.0.1-0ubuntu1_amd64.deb
locales_2.34-0ubuntu3_all.deb
rpcsvc-proto_1.4.2-0ubuntu5_amd64.deb
Error message for PATH:
perl: warning: Falling back to the standard locale ("C").
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)