I ran a command:
sudo apt-get remove libstdc++6
I know, I shouldn't have! .. but now nothing works, not even apt-get
, it's not there anymore.
How do I reverse this?
I ran a command:
sudo apt-get remove libstdc++6
I know, I shouldn't have! .. but now nothing works, not even apt-get
, it's not there anymore.
How do I reverse this?
There is no easy rollback feature, but you can reinstall the packages required to get apt
up and running again, and proceed from there:
wget http://launchpadlibrarian.net/336920453/libstdc++6_5.4.0-6ubuntu1~16.04.5_amd64.deb
sudo dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.5_amd64.deb
will restore libstdc++6
(for Ubuntu 16.04, assuming you’re running amd64
), then
wget http://launchpadlibrarian.net/339152322/apt_1.2.25_amd64.deb http://launchpadlibrarian.net/339152325/libapt-pkg5.0_1.2.25_amd64.deb
sudo dpkg -i apt_1.2.25_amd64.deb libapt-pkg5.0_1.2.25_amd64.deb
will restore apt
.
At this point you can look at the logs in /var/log/apt
to see what the removal of libstdc++6
took with it, and reinstall those packages using apt
.
apt-get install
I should get everything back?
– Aurimas
Oct 23 '17 at 18:38
apt-get install
(or apt install
) will get everything back.
– Stephen Kitt
Oct 23 '17 at 18:40
apt-utils : Depends: apt (= 1.2.24) but 1.2.25 is to be installed
. Any ideas?
– Aurimas
Oct 23 '17 at 18:48
apt
and installed everything, but many things don't work the way they used to.. for examplce, can't start apache2 server for some errors etc. .. I guess in the end it is irreversible.
– Aurimas
Oct 23 '17 at 19:20
remove
, not purge
, so the configuration files wouldn’t have been removed. Does apt install -f
find anything to fix? Does apt update && apt upgrade
upgrade anything?
– Stephen Kitt
Oct 23 '17 at 20:43
SuexecUserGroup configured, but suEXEC is disabled: Missing suexec binary /usr/lib/apache2/suexec
Webmin fails with:
/etc/init.d/webmin: 13: /etc/init.d/webmin: /etc/webmin/start: not found
The errors from apt install -f
are related to Webmin:
Webmin does not appear to be installed on your system. This package cannot be installed unless the Debian version of Webmin is installed first.
However, running apt install webmin
gives webmin is already the newest version (1.860)
libstdc++6
has been removed? The solution you are recommending involves runningwget
,sudo
, anddpkg
, all before the library has been reinstalled. Since that procedure has worked for some people, what you seem to be saying cannot possibly be true. Since those programs can run, presumably other programs can too, so long as they don't use the C++ standard library and don't use any libraries or other programs that use it. So presumably other solutions are possible, too. – Eliah Kagan Oct 23 '17 at 17:36wget
,sudo
, anddpkg
were all run from the Live CD/USB. The inherit fact that he brokeapt
proves my point, as every package on a system was built at some point using a toolchain. Breaking that chain breaks every package, and yes it is impossible to run any program. – eyoung100 Oct 23 '17 at 17:45wget
,sudo
anddpkg
don’t needlibstdc++6
so there is no circular dependency issue here. The OP only needslibstdc++6
to restoreapt
. You no doubt understand how the toolchain works intricately, but the way the toolchain is packaged in Debian and derivatives means that the dependency chains are more forgiving than the source-based dependency chains. – Stephen Kitt Oct 23 '17 at 17:47apt
depends ondpkg
If your telling medpkg
has no dependencies that depend on something that doesn't require something from the toolchain, I'd like to see that. And maybe gentoo was more strict. – eyoung100 Oct 23 '17 at 17:55dpkg
doesn’t depend on anything from GCC (after it’s built):libbz2-1.0
,libc6
,liblzma5
,libselinux1
,zlib1g
andtar
. The only part of the toolchain that’s required islibgcc1
, indirectly.libstdc++6
isn’t needed fordpkg
to work. – Stephen Kitt Oct 23 '17 at 18:00libstdc++6
didn’t nuke the whole system — if it was needed for everything,apt
would have removed everything when removinglibstdc++6
. – Stephen Kitt Oct 23 '17 at 18:19dpkg
doesn’t have a direct dependency onlibgcc1
, it has an indirect dependency on it vialibc6
. – Stephen Kitt Oct 23 '17 at 18:21apt
– Aurimas Oct 23 '17 at 18:42