修复软件包目录时:无法删除必要的系统软件包

修复软件包目录时:无法删除必要的系统软件包

我最近犯了一个错误,试图在我的 Precise 安装中安装 Trusty 的较新版本的 libattr1,以便我可以使用 Trusty 较新的 CMake(我知道这是个坏主意)。安装进行到一半时,它失败并出现错误。现在,软件中心希望我修复软件包目录。然而,当我尝试时,我得到了这个:

无法删除基本系统软件包:无法删除软件包 libacl1:i386

当我尝试安装某些东西时,Apt-get 给出了一个更具描述性的错误:

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:
 libattr1 : Breaks: libattr1:i386 (!= 1:2.4.46-8ubuntu2) but 1:2.4.46-5ubuntu1 is installed
 libattr1:i386 : Breaks: libattr1 (!= 1:2.4.46-5ubuntu1) but 1:2.4.46-8ubuntu2 is installed
E: Unmet dependencies. Try using -f.

似乎是循环依赖问题之类的。当我运行 时sudo apt-get install -f,出现以下内容:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  bluez-alsa:i386 libsdl-ttf2.0-0:i386 libgconf-2-4:i386 libstdc++5:i386
  libgail18:i386 libqt4-qt3support:i386 libcupsimage2:i386 libnss3:i386
  gtk2-engines:i386 libgudev-1.0-0:i386 libcairo-gobject2:i386
  libavc1394-0:i386 libaio1:i386 odbcinst1debian2:i386 libqt4-test:i386
  libqt4-designer:i386 libsdl-mixer1.2:i386 libcap2:i386 libproxy1:i386
  ibus-gtk:i386 libdbus-glib-1-2:i386 libtdb1:i386 libspeex1:i386
  libibus-1.0-0:i386 libcanberra-gtk-module:i386 libcanberra0:i386
  gtk2-engines-murrine:i386 libwavpack1:i386 libqt4-opengl:i386
  libsoup-gnome2.4-1:i386 gstreamer0.10-plugins-good:i386 libiec61883-0:i386
  libsdl-image1.2:i386 libxaw7:i386 libgdbm3:i386 libesd0:i386 libmikmod2:i386
  libpulse-mainloop-glib0:i386 libaa1:i386 libao4:i386 pax libxmu6:i386
  libcanberra-gtk0:i386 libvorbisfile3:i386 libqt4-svg:i386
  libgail-common:i386 libraw1394-11:i386 libnspr4:i386 libshout3:i386
  libdv4:i386 rpm librpmbuild2 gstreamer0.10-x:i386 libsdl-net1.2:i386
  libgnome-keyring0:i386 libxtst6:i386 gtk2-engines-pixbuf:i386
  libtag1c2a:i386 libssl0.9.8:i386 libmad0:i386 gtk2-engines-oxygen:i386
  lib32z1 xaw3dg:i386 librpmsign0 libpulsedsp:i386 libodbc1:i386
  libqt4-scripttools:i386 lsb-core libxp6:i386 alien libxmlrpc-core-c3
  ncurses-term icc-profiles-free glib-networking:i386 libsoup2.4-1:i386
  libtag1-vanilla:i386 libaudiofile1:i386
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  google-earth-stable ia32-libs ia32-libs-multiarch:i386 libacl1:i386
  libattr1:i386 softmaker-freeoffice
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 484 MB disk space will be freed.
Do you want to continue [Y/n]? 

想到要删除所有那些看似至关重要的软件包,我就感到害怕。我该怎么办?我现在甚至不敢重启电脑。

答案1

有时如果一切都坏了,这个命令可以提供帮助。

sudo dpkg --configure -a

答案2

解决了!我检查了评论中指出的答案最后做了这样的事情:

sudo mv /usr/share/doc/libattr1/changelog.Debian.gz # /usr/share/doc/libattr1/changelog.Debian.gz.old
# the above was because apt-get was complaining about files not being the same
sudo apt-get install -f libattr1=1:2.4.46-5ubuntu1

相关内容