我要面对一些麻烦。我试图删除gcc-5,但是有许多依赖关系将受到它的影响。我正在寻找一个魔术师,它可以帮助我卸载它,而不会对我的系统造成巨大的影响。
我的系统是:
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial我过滤了与gcc 5相关的所有想卸载的依赖项,并获得了以下输出:
$ 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)我尝试安装了特定的版本:
$ 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.看来我的系统对这个包有多种选择。
$ 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更清楚一点的是,我想使用gcc与ubuntu 16.04.10兼容,而不是16.04.11。
提前感谢!
发布于 2019-06-19 16:59:25
Ubuntu16.04.11不存在,二项式次要版本只转到16.04.6。
5.4.0-6ubuntu1~16.04.11是gcc-5的恐怖版本“数字”。我认为它应该是指16.04特定的补丁,并且仍然对版本比较进行了合理的排序。
如有必要,更新您的包并使用它们。像Ubuntu这样的稳定发行版尝试不将中断的更改作为更新发布,这是用于主要版本升级的。
https://serverfault.com/questions/972076
复制相似问题