背景:我刚刚在 Windows Subsystem For Linux 中安装了 Ubuntu 16.04。然后我运行sudo apt-get install -y ros-lunar-desktop-full
安装 ROS。当它在另一个终端中运行时,我尝试安装 sublime text,这杀死了我的第一个终端中的 dpkg 进程。我现在似乎有一个彻底损坏的 apt 缓存,无法弄清楚如何让它再次工作。
aaron@AX311-5874:~$ sudo apt-get install -y ros-lunar-desktop-full
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:
libmono-system-configuration4.0-cil : Depends: libmono-system-xml4.0-cil (>= 4.2.0) but it is not going to be installed
libmono-system-security4.0-cil : Depends: libmono-system-xml4.0-cil (>= 4.2.0) but it is not going to be installed
libmono-system4.0-cil : Depends: libmono-system-xml4.0-cil (>= 4.2.0) but it is not going to be installed
ros-lunar-desktop-full : Depends: ros-lunar-desktop but it is not going to be installed
Depends: ros-lunar-perception but it is not going to be installed
Depends: ros-lunar-simulators but it is not going to be installed
Depends: ros-lunar-urdf-tutorial but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
aaron@AX311-5874:~$ sudo apt-get -f install
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:
blt cmake cmake-data docutils-common docutils-doc fltk1.3-doc fluid fonts-lato fonts-lyx freeglut3 freeglut3-dev gazebo7 gazebo7-common gazebo7-plugin-base
google-mock libaec0 libarchive13 libarmadillo6 libarpack2 libasyncns0 libaudio2 libboost-iostreams1.58.0 libboost-program-options1.58.0
libbulletcollision2.83.6 libbulletdynamics2.83.6 libcdparanoia0 libconsole-bridge0.2v5 libdap17v5 libdapclient6v5 libdouble-conversion1v5 libdrm-dev
libegl1-mesa-dev libepsilon1 libevdev2 libflann1.8 libfltk-forms1.3 libfltk-images1.3 libfltk1.3 libfreeimage3 libfreexl1 libgazebo7 libgdal1i
libgeos-3.5.0 libgeos-c1v5 libgl1-mesa-dev libgl1-mesa-glx libglade2-0 libgles2-mesa libgles2-mesa-dev libglu1-mesa libglu1-mesa-dev
libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtest-dev libgts-0.7-5 libhdf4-0-alt libhdf5-10 libignition-math2 libilmbase12 libinput-bin libinput10
libjasper1 libjsoncpp1 libjxr0 libkmlbase1 libkmldom1 libkmlengine1 liblapack3 liblinearmath2.83.6 libminizip1 libmirclient-dev libmircommon-dev
libmircookie-dev libmircookie2 libmircore-dev libmng2 libmtdev1 libmysqlclient20 libnetcdf11 libnotify4 libodbc1 libogdi3.2 libogre-1.9.0v5 libopenexr22
libopenjp2-7 libopenni0 libpoppler58 libpq5 libproj9 libprotobuf-dev libprotobuf9v5 libqt4-declarative libqt4-network libqt4-opengl libqt4-script
libqt4-sql libqt4-xml libqt4-xmlpatterns libqt5concurrent5 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5qml5
libqt5quick5 libqt5quickparticles5 libqt5quicktest5 libqt5quickwidgets5 libqt5script5 libqt5scripttools5 libqt5sql5 libqt5svg5 libqt5svg5-dev libqt5test5
libqt5webkit5 libqt5webkit5-dev libqt5widgets5 libqt5xml5 libqtcore4 libqtdbus4 libqtgui4 libqtwebkit4 libraw15 libruby2.3 libsdformat4 libsimbody3.5v5
libspatialite7 libspnav0 libsuperlu4 libswscale-ffmpeg3 libsz2 libtar0 libtbb2 libtcl8.6 libtinyxml2-2v5 libtinyxml2.6.2v5 libtk8.6 libudev-dev
liburdfdom-model0.4 liburiparser1 libwacom-common libwacom2 libwayland-bin libwayland-dev libwebpmux1 libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev
libxcb-glx0 libxcb-glx0-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present-dev libxcb-randr0 libxcb-randr0-dev libxcb-render-util0
libxcb-shape0 libxcb-shape0-dev libxcb-sync-dev libxcb-util1 libxcb-xfixes0-dev libxcb-xkb1 libxerces-c3.1 libxkbcommon-dev libxkbcommon-x11-0
libxshmfence-dev libxslt1.1 libxss1 libxt-dev libxv1 libxxf86dga1 libxxf86vm-dev libxxf86vm1 libzzip-0-13 mesa-common-dev mysql-common odbcinst
odbcinst1debian2 proj-data qt5-qmake qtbase5-dev qtbase5-dev-tools qtchooser qtcore4-l10n qtdeclarative5-dev qtscript5-dev qtscript5-private-dev rake ruby
ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3 rubygems-integration sdformat-sdf tk8.6-blt2.5 ttf-dejavu-core
ttf-liberation x11proto-dri2-dev x11proto-gl-dev x11proto-xf86vidmode-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libmono-system-xml4.0-cil
The following NEW packages will be installed:
libmono-system-xml4.0-cil
0 to upgrade, 1 to newly install, 0 to remove and 4 not to upgrade.
83 not fully installed or removed.
Need to get 0 B/810 kB of archives.
After this operation, 3,275 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 77831 files and directories currently installed.)
Preparing to unpack .../libmono-system-xml4.0-cil_4.2.1.102+dfsg2-7ubuntu4_all.deb ...
Unpacking libmono-system-xml4.0-cil (4.2.1.102+dfsg2-7ubuntu4) ...
dpkg: error processing archive /var/cache/apt/archives/libmono-system-xml4.0-cil_4.2.1.102+dfsg2-7ubuntu4_all.deb (--unpack):
trying to overwrite '/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll', which is also in package libboost-regex1.58-dev:amd64 1.58.0+dfsg-5ubuntu3.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libmono-system-xml4.0-cil_4.2.1.102+dfsg2-7ubuntu4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试强制覆盖这个答案,问题已经修复,但我认为我的libboost-regex
软件包现在已损坏。我该怎么办?
答案1
为了彻底解决问题,请重新安装所有可能有问题的软件包:
sudo apt-get install --reinstall libmono-system-configuration4.0-cil libmono-system-security4.0-cil libmono-system4.0-cil ros-lunar-desktop-full libmono-system-xml4.0-cil ros-lunar-desktop ros-lunar-perception ros-lunar-simulators ros-lunar-urdf-tutorial
这可能会产生一些错误,因此请运行:
sudo apt-get -f install
重复此操作直到一切都修复。
如果您怀疑任何其他软件包有问题,只需重新安装:
sudo apt-get install --reinstall [broken-package-here]