我无法使用sudo apt install
我尝试过的任何软件包sudo apt --fix broken install
但是它不断遇到依赖性错误。
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-image-5.11.0-41-generic
Suggested packages:
fdutils linux-doc | linux-hwe-5.11-source-5.11.0 linux-hwe-5.11-tools
The following NEW packages will be installed:
linux-image-5.11.0-41-generic
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
7 not fully installed or removed.
Need to get 0 B/11.5 MB of archives.
After this operation, 11.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 259233 files and directories currently installed.)
Preparing to unpack .../linux-image-5.11.0-41-generic_5.11.0-41.45~20.04.1_amd64.deb ...
Unpacking linux-image-5.11.0-41-generic (5.11.0-41.45~20.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.11.0-41-generic_5.11.0-41.45~20.04.1_amd64.deb (--unpack):
unable to open '/boot/vmlinuz-5.11.0-41-generic.dpkg-new': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-5.11.0-41-generic_5.11.0-41.45~20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您可以轻松修复此问题!
您需要强制覆盖文件,可能是上次运行 时apt upgrade
,内核升级了。您似乎使用了防病毒软件,如果是,则禁用它并继续,如果不是,则继续
因此,在确保您的防病毒服务已被禁用后,请运行 -
sudo dpkg -i --force-overwrite /var/cache/apt/archives/linux-image-5.11.0-41-generic_5.11.0-41.45~20.04.1_amd64.deb
现在问题应该已经解决了
答案2
阻止是由防病毒程序造成的。删除它们:
sudo dpkg --purge mfedx
sudo dpkg --purge mcafeetp
sudo dpkg --purge mcafeeespaac
sudo dpkg --purge mcafeeespfileaccess
Sudo dpkg --purge mcafeeesp
sudo dpkg --purge mcafeert
sudo dpkg --purge mfecma
sudo dpkg --purge mfert