Using Ubuntu 19.10 which was upgraded throughout the years (starting with 16.04). I just disovered that I have multiple versions of gcc
installed and wondered why (I do not develop/compile C/C++ on the device). When doing
dpkg -l | grep gcc
I get gcc-5
to gcc-9
(+ some libs and -base
). When simulating a purge with
apt-get -s purge gcc-5
(and for all the others numbers as well) only gcc-9
seems to have actual important dependants (Virtual Box for me, which I use). The others only render other lib
or cpp
packages obsolete.
Why are they even there anyways without manual installation by me? Or not removed when they became an obsolete dependency (not even deborphan -a
lists them)? I already did apt-get autoremove --purge
.
Can I remove the old versions without loss of important packages/features?
The results of
rmadison gcc
show that gcc 9 is the default gcc in Ubuntu 19.10.You can safely uninstall all the other versions of gcc because you checked that no other installed packages have other versions of gcc as dependencies.
In addition to possibly having installed packages that require non-default versions of gcc as dependencies, some developers install multiple versions of gcc alongside each other because different programs that they are developing target different versions of gcc as their GNU C compiler.