安装一些软件包和库后,我在软件包管理器上遇到错误,我无法运行任何更新,因为它显示:
软件包系统已损坏如果您正在使用第三方存储库,请禁用它们,因为它们是问题的常见来源。现在在终端中运行以下命令:apt-get install -f
我尝试按照它说的做,它返回:
jara@jara-Aspire-5738:~$ 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:
libcaca-dev libopencv2.3-bin nite-dev python-bluez ps-engine libslang2-dev
python-sphinx ros-electric-geometry-tutorials
ros-electric-geometry-visualization python-matplotlib libzzip-dev
ros-electric-orocos-kinematics-dynamics ros-electric-physics-ode
libbluetooth-dev libaudiofile-dev libassimp2 libnetpbm10-dev
ros-electric-laser-pipeline python-epydoc ros-electric-geometry-experimental
libasound2-dev evtest python-matplotlib-data libyaml-dev ros-electric-bullet
ros-electric-executive-smach ros-electric-documentation libgl2ps0
libncurses5-dev ros-electric-robot-model texlive-fonts-recommended
python-lxml libwxgtk2.8-dev daemontools libxxf86vm-dev libqhull-dev
libavahi-client-dev ros-electric-geometry libgl2ps-dev libcurl4-openssl-dev
assimp-dev libusb-1.0-0-dev libopencv2.3 ros-electric-diagnostics-monitors
libsdl1.2-dev libjs-underscore libsdl-image1.2 tipa libusb-dev libtinfo-dev
python-tz python-sip libfltk1.1 libesd0 libfreeimage-dev
ros-electric-visualization x11proto-xf86vidmode-dev python-docutils
libvtk5.6 ros-electric-assimp x11proto-scrnsaver-dev libnetcdf-dev
libidn11-dev libeigen3-dev joystick libhdf5-serial-1.8.4
ros-electric-joystick-drivers texlive-fonts-recommended-doc esound-common
libesd0-dev tcl8.5-dev ros-electric-multimaster-experimental ros-electric-rx
libaudio-dev ros-electric-ros-tutorials libwxbase2.8-dev
ros-electric-visualization-common python-sip-dev
ros-electric-visualization-tutorials libfltk1.1-dev libpulse-dev libnetpbm10
python-markupsafe openni-dev tk8.5-dev wx2.8-headers freeglut3-dev
libavahi-common-dev python-roman python-jinja2
ros-electric-robot-model-visualization libxss-dev libqhull5 libaa1-dev
ros-electric-eigen freeglut3 ros-electric-executive-smach-visualization
ros-electric-common-tutorials ros-electric-robot-model-tutorials libnetcdf6
libjs-sphinxdoc python-pyparsing libaudiofile0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libcv-dev
The following NEW packages will be installed
libcv-dev
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,114 kB of archives.
After this operation, 11.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 261801 files and directories currently installed.)
Unpacking libcv-dev (from .../libcv-dev_2.1.0-7build1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
(-- unpack):
trying to overwrite '/usr/bin/opencv_haartraining', which is also in package
libopencv2.3-bin 2.3.1+svn6514+branch23-12~oneiric
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试过人们在互联网上推荐的所有方法,例如:
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install
我也尝试安装突触管理器,但它不允许我安装任何东西。
正如你所看到的,什么都不起作用,所以我很绝望!
我正在使用 ubuntu 11.10,64 位
谢谢!!
答案1
指挥 OP 尝试:
sudo apt-get install -f
上述命令的错误报告:
dpkg: error processing /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/opencv_haartraining', which is also in package
libopencv2.3-bin 2.3.1+svn6514+branch23-12~oneiric
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
从上面的错误报告中可以清楚地看到,运行sudo apt-get install -f
命令时dpkg
尝试提取并安装/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
文件。安装需要将opencv_haartraining
文件放在/usr/bin
目录中。
/usr/bin/opencv_haartraining
但是当看到目录中有同样的文件时感到震惊/usr/bin
并产生错误,因为这个文件在libopencv2.3-bin
包安装期间已经被放置了。
解决方案对于上述错误,可以libopencv2.3-bin
通过运行删除已经安装的包,
sudo dpkg -P libopencv2.3-bin
然后这样做,
sudo apt-get install -f
现在上述命令会自动尝试安装/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
包,并且由于现在没有任何阻止,因此它可以成功安装包。
答案2
http://www.iasptk.com/ubuntu-fix-broken-package-best-solution
尝试后
sudo dpkg --configure -a
和
sudo apt-get install -f
损坏软件包的问题仍然存在,解决方案是手动编辑 dpkg 状态文件。
sudo nano /var/lib/dpkg/status
(你可以使用 vim 代替 nano)
找到损坏的包,删除有关它的整个信息块并保存文件。
答案3
首先删除libcv-dev
包
sudo dpkg -r libcv-dev
然后
sudo apt-get install -f
这
sudo apt-get update
答案4
/var/lib/dpkg/status
使用运行相同操作系统版本的另一个系统中的相同文件替换这些文件。这对我有用。