当我尝试此命令时收到此错误代码:
sudo apt-get install -f
有人知道该怎么修复吗?谢谢!
$ sudo apt-get install --fix-broken && sudo apt-get autoremove && sudo apt-get update
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
linux-image-extra-3.13.0-63-generic
The following NEW packages will be installed:
linux-image-extra-3.13.0-63-generic
0 upgraded, 1 newly installed, 0 to remove and 19 not upgraded.
2 not fully installed or removed.
Need to get 0 B/36.8 MB of archives.
After this operation, 152 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 301192 files and directories currently installed.)
Preparing to unpack .../linux-image-extra-3.13.0-63-generic_3.13.0-63.103_amd64.deb ...
Unpacking linux-image-extra-3.13.0-63-generic (3.13.0-63.103) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-extra-3.13.0-63-generic_3.13.0-63.103_amd64.deb (--unpack):
trying to overwrite '/lib/modules/3.13.0-63-generic/kernel/mm/hwpoison-inject.ko', which is also in package linux-image-3.13.0-63-generic 3.13.0-63.104~precise1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-extra-3.13.0-63-generic_3.13.0-63.103_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
使用 2 个命令修复此问题:
sudo dpkg -P linux-image-generic
sudo dpkg -P linux-generic