我在使用 GCC 时遇到了很多问题。首先,我尝试安装一个应用程序 (ginga),但遇到了 GCC 依赖问题。依赖是指有一个 gcc 版本,但应用程序需要另一个版本。我安装了要求的版本,但冲突仍然存在。因此,我在使用 GCC 时遇到了很多问题,现在由于依赖,我无法安装任何东西。当我尝试安装某些东西时,会出现以下输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
cpp-4.8 : Depends: gcc-4.8-base (= 4.8.4-1) but 4.8.5-1 is to be installed
dkms : Depends: gcc but it is not going to be installed
gcc-4.8 : Depends: gcc-4.8-base (= 4.8.4-1) but 4.8.5-1 is to be installed
Depends: binutils (>= 2.24.90.20141219) but 2.24-5ubuntu13 is to be installed
Depends: libgcc-4.8-dev (>= 4.8.4-1) but it is not going to be installed
gcc-multilib : Depends: gcc (>= 4:4.8.2-1ubuntu6) but it is not going to be installed
Depends: gcc-4.8-multilib (>= 4.8.2-5~) but it is not going to be installed
libasan0 : Depends: gcc-4.8-base (= 4.8.4-1) but 4.8.5-1 is to be installed
libatomic1 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
libc6:i386 : Depends: libgcc1:i386 but it is not going to be installed
libgcc1 : Depends: gcc-4.7-base (= 4.7.2-5) but it is not going to be installed
libgfortran3 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
libgl1-mesa-dri-lts-utopic:i386 : Depends: libgcc1:i386 (>= 1:4.7) but it is not going to be installed
libglu1-mesa:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libgomp1 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
libitm1 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
libjack-jackd2-0:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libllvm3.5:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libmysqlclient18:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-declarative:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-network:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-opengl:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-script:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-scripttools:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-sql:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-sql-mysql:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-xml:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqt4-xmlpatterns:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqtcore4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqtdbus4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqtgui4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libqtwebkit4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libquadmath0 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
libstdc++-4.8-dev : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
Depends: libgcc-4.8-dev (= 4.8.4-2ubuntu1~14.04) but it is not going to be installed
libstdc++6 : Depends: gcc-4.9-base (= 4.9.1-16ubuntu6) but 4.9.3-4 is to be installed
libstdc++6:i386 : Depends: gcc-4.9-base:i386 (= 4.9.1-16ubuntu6) but it is not going to be installed
Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
libtsan0 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but 4.8.5-1 is to be installed
sa-compile : Depends: gcc but it is not going to be installed
simplescreenrecorder-lib:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
你能帮帮我吗?我真的不知道该怎么办。
pl_rock。首先,谢谢你的帮助。
我按照你的建议做了,但没有成功。“apt-get -f install”的答案是:E:无法更正依赖项
为了清除 gcc,我必须使用“--force-all”,并且在清除 gcc(4.8 和 4.9)之后尝试 apt-get autoremove,但我得到了相同的输出:
root@gleidson-Inspiron-5423:/home/gleidson# apt-get autoremove Reading package lists... Done Building dependency tree
Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: cpp-4.8 : Depends: gcc-4.8-base (= 4.8.4-1) but it is not installed dkms : Depends: gcc but it is not installed gcc-multilib : Depends: gcc (>= 4:4.8.2-1ubuntu6) but it is not installed Depends: gcc-4.8-multilib (>= 4.8.2-5~) but it is not installed libasan0 : Depends: gcc-4.8-base (= 4.8.4-1) but it is not installed libatomic1 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed libc6:i386 : Depends: libgcc1:i386 but it is not installed libgcc1 : Depends: gcc-4.7-base (= 4.7.2-5) but it is not installed libgfortran3 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed libgl1-mesa-dri-lts-utopic:i386 : Depends: libgcc1:i386 (>= 1:4.7) but it is not installed libglu1-mesa:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libgomp1 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed libitm1 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed libjack-jackd2-0:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libllvm3.5:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libmysqlclient18:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-declarative:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-network:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-opengl:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-script:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-scripttools:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-sql:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-sql-mysql:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-xml:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqt4-xmlpatterns:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqtcore4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqtdbus4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqtgui4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libqtwebkit4:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libquadmath0 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed libstdc++-4.8-dev : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed Depends: libgcc-4.8-dev (= 4.8.4-2ubuntu1~14.04) but it is not installed libstdc++6 : Depends: gcc-4.9-base (= 4.9.1-16ubuntu6) but it is not installed libstdc++6:i386 : Depends: gcc-4.9-base:i386 (= 4.9.1-16ubuntu6) but it is not installed Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed libtsan0 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04) but it is not installed sa-compile : Depends: gcc but it is not installed simplescreenrecorder-lib:i386 : Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installed E: Unmet dependencies. Try using -f.
而且,如果我按照建议使用“-f”,我会得到:E:无法纠正依赖关系。
答案1
您遇到此问题是因为您重新安装了gcc
但仍然存在与新依赖项冲突的旧依赖项。因此运行命令:
apt-get -f install
它将解决依赖关系然后安装gcc
。如果仍然遇到问题,则清除 gcc,然后运行命令:
sudo apt-get autoremove
它将删除旧的依赖项,然后重新安装 gcc 及其依赖项