最近在使用Ubuntu的过程中碰到问题,安装软件没法安装,基本上都是由于安装了不兼容的软件包导致的,整理了下以下方法,供参考解决。
报错信息如下:
root@abc:/home/ght# apt-get install snmpd
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:
libnih1 : PreDepends: libc6 (< 2.16) but 2.19-0ubuntu6 is to be installed
snmpd : Depends: libsnmp15 (>= 5.4.3~dfsg) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
解决尝试以下方法:
尝试一,卸载已经安装的错误的包,那个包报错找哪个包:
1)dpkg -l | grep libc6 发现有libc6-i386 之后,移除它 dpkg -r libc6-i386
2)dpkg -l | grep libgcc1 发现有libgcc1:i386, 移除它dpkg -r libgcc1:i386
3) dpkg -l | grep libselinux1 发现有libselinux1:i386,移除它dpkg -r libselinux1:i386
尝试二,如果上面的还不行的话,试着执行下面这个:
sudo aptitude -f install
尝试三:
apt-get install -f
我尝试完这一步后解决~