2

I'm face on some troubles here. I'm trying to remove gcc-5, however there are a lot of dependencies that will be affect by it. I'm looking for a magician that could help me uninstall it without make a huge difference in my system.

My system is:

Description:    Ubuntu 16.04.6 LTS
Release:    16.04
Codename:   xenial

I filtered all the dependencies relative to gcc 5 that I wanna uninstall and, I had this output:

$ sudo dpkg -l | grep '16.04.11'

ii  cpp-5                                        5.4.0-6ubuntu1~16.04.11                               amd64        GNU C preprocessor
ii  g++-5                                        5.4.0-6ubuntu1~16.04.11                               amd64        GNU C++ compiler
ii  gcc-5                                        5.4.0-6ubuntu1~16.04.11                               amd64        GNU C compiler
ii  gcc-5-base:amd64                             5.4.0-6ubuntu1~16.04.11                               amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-5-base:i386                              5.4.0-6ubuntu1~16.04.11                               i386         GCC, the GNU Compiler Collection (base package)
ii  gfortran-5                                   5.4.0-6ubuntu1~16.04.11                               amd64        GNU Fortran compiler
ii  gnome-software                               3.20.5-0ubuntu0.16.04.11                              amd64        Software Center for GNOME
ii  gnome-software-common                        3.20.5-0ubuntu0.16.04.11                              all          Software Center for GNOME (common files)
ii  libasan2:amd64                               5.4.0-6ubuntu1~16.04.11                               amd64        AddressSanitizer -- a fast memory error detector
ii  libatomic1:amd64                             5.4.0-6ubuntu1~16.04.11                               amd64        support library providing __atomic built-in functions
ii  libcc1-0:amd64                               5.4.0-6ubuntu1~16.04.11                               amd64        GCC cc1 plugin for GDB
ii  libcilkrts5:amd64                            5.4.0-6ubuntu1~16.04.11                               amd64        Intel Cilk Plus language extensions (runtime)
ii  libgcc-5-dev:amd64                           5.4.0-6ubuntu1~16.04.11                               amd64        GCC support library (development files)
ii  libgd3:amd64                                 2.1.1-4ubuntu0.16.04.11                               amd64        GD Graphics Library
ii  libgd3:i386                                  2.1.1-4ubuntu0.16.04.11                               i386         GD Graphics Library
ii  libgfortran-5-dev:amd64                      5.4.0-6ubuntu1~16.04.11                               amd64        Runtime library for GNU Fortran applications (development files)
ii  libgfortran3:amd64                           5.4.0-6ubuntu1~16.04.11                               amd64        Runtime library for GNU Fortran applications
ii  libgomp1:amd64                               5.4.0-6ubuntu1~16.04.11                               amd64        GCC OpenMP (GOMP) support library
ii  libitm1:amd64                                5.4.0-6ubuntu1~16.04.11                               amd64        GNU Transactional Memory Library
ii  liblsan0:amd64                               5.4.0-6ubuntu1~16.04.11                               amd64        LeakSanitizer -- a memory leak detector (runtime)
ii  libmpx0:amd64                                5.4.0-6ubuntu1~16.04.11                               amd64        Intel memory protection extensions (runtime)
ii  libquadmath0:amd64                           5.4.0-6ubuntu1~16.04.11                               amd64        GCC Quad-Precision Math Library
ii  libstdc++-5-dev:amd64                        5.4.0-6ubuntu1~16.04.11                               amd64        GNU Standard C++ Library v3 (development files)
ii  libstdc++6:amd64                             5.4.0-6ubuntu1~16.04.11                               amd64        GNU Standard C++ Library v3
ii  libstdc++6:i386                              5.4.0-6ubuntu1~16.04.11                               i386         GNU Standard C++ Library v3
ii  libtsan0:amd64                               5.4.0-6ubuntu1~16.04.11                               amd64        ThreadSanitizer -- a Valgrind-based detector of data races (runtime)
ii  libubsan0:amd64                              5.4.0-6ubuntu1~16.04.11                               amd64        UBSan -- undefined behaviour sanitizer (runtime)

I have tried to install the specific version:

$ sudo apt install gcc-5=5.4.0-6ubuntu1~16.04.10

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-5 : Depends: cpp-5 (= 5.4.0-6ubuntu1~16.04.10) but 5.4.0-6ubuntu1~16.04.11 is to be installed
         Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.10) but 5.4.0-6ubuntu1~16.04.11 is to be installed
         Depends: libgcc-5-dev (= 5.4.0-6ubuntu1~16.04.10) but 5.4.0-6ubuntu1~16.04.11 is to be installed
E: Unable to correct problems, you have held broken packages.

It seems that my system has multiple options for this package.

$ sudo apt-cache policy cpp-5:amd64

cpp-5:
  Installed: 5.4.0-6ubuntu1~16.04.11
  Candidate: 5.4.0-6ubuntu1~16.04.11
  Version table:
 *** 5.4.0-6ubuntu1~16.04.11 100
        100 /var/lib/dpkg/status
     5.4.0-6ubuntu1~16.04.10 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     5.3.1-14ubuntu2 500
        500 http://br.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

To be a little bit more clear, I wanna use the gcc compatible with ubuntu 16.04.10 and not 16.04.11.

Thanks in advance!

1 Answers1

0

Ubuntu 16.04.11 doesn't exist, Xenial minor versions only go to 16.04.6.

5.4.0-6ubuntu1~16.04.11 is some horrible version "number" for gcc-5. I assume it is supposed to indicate 16.04 specific patches and still sort sanely for version comparison.

Update your packages if necessary and use them. Stable distros like Ubuntu try not to ship breaking changes as updates, that is for major version upgrades.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • Thanks for your help. I updated my question, with new information, before I wasn't clear at all. So the issue is the cpp installed, as you can see is installed: 5.4.0-6ubuntu1~16.04.11, and I would like to install this version 5.4.0-6ubuntu1~16.04.10. Do you know some way to do that without affect the other dependencies that I typed before? – Levi Resende Jun 19 '19 at 18:56