安装新的内核映像 - 无法打开“/boot/vmlinuz-5.xxx-generic.dpkg-new”:操作不允许

安装新的内核映像 - 无法打开“/boot/vmlinuz-5.xxx-generic.dpkg-new”:操作不允许

我所做的只是运行apt upgrade,但安装无法升级到linux-image-5.8.0-34-generic。这是一个双启动系统,但据我所知,它有问题的文件位于常规系统分区(安装在 /)上,而不是位于的分区上/boot/efi/

如果您能就正在发生的事情或我可以提供的其他信息提供任何提示或建议,我将不胜感激。

适当的输出:

root@CSD-17459:~# apt 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:
  linux-headers-5.4.0-42 linux-headers-5.4.0-42-generic linux-image-5.4.0-42-generic linux-modules-5.4.0-42-generic linux-modules-extra-5.4.0-42-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-5.8.0-34-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.8-source-5.8.0 linux-hwe-5.8-tools
The following NEW packages will be installed:
  linux-image-5.8.0-34-generic
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
58 not fully installed or removed.
Need to get 0 B/9,499 kB of archives.
After this operation, 9,748 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 393849 files and directories currently installed.)
Preparing to unpack .../linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb ...
Unpacking linux-image-5.8.0-34-generic (5.8.0-34.37~20.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb (--unpack):
 unable to open '/boot/vmlinuz-5.8.0-34-generic.dpkg-new': Operation not permitted
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

这里是 dpkg 命令的 strace 和它抱怨的文件:

root@CSD-17459:~# strace -v -P /boot/vmlinuz-5.8.0-34-generic.dpkg-new dpkg -i /var/cache/apt/archives/linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb 
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6633, si_uid=0, si_status=1, si_utime=0, si_stime=0} ---
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6634, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
(Reading database ... 393849 files and directories currently installed.)
Preparing to unpack .../linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb ...
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6638, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
Unpacking linux-image-5.8.0-34-generic (5.8.0-34.37~20.04.2) ...
rmdir("/boot/vmlinuz-5.8.0-34-generic.dpkg-new") = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/boot/vmlinuz-5.8.0-34-generic.dpkg-new", O_WRONLY|O_CREAT|O_EXCL, 000) = 12
write(12, "MZ\352\7\0\300\7\214\310\216\330\216\300\216\3201\344\373\374\276@\0\254 \300t\t\264\16\273\7\0"..., 32768) = 32768
# ...
# many more binary blob write() calls here
# ....
sync_file_range(12, 0, 0, SYNC_FILE_RANGE_WRITE) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6644, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
fchown(12, 0, 0)                        = 0
fchmod(12, 0600)                        = 0
close(12)                               = 0
utimes("/boot/vmlinuz-5.8.0-34-generic.dpkg-new", [{tv_sec=1609958683, tv_usec=0} /* 2021-01-06T12:44:43-0600 */, {tv_sec=1608216088, tv_usec=0} /* 2020-12-17T08:41:28-0600 */]) = 0

# ERROR HERE
openat(AT_FDCWD, "/boot/vmlinuz-5.8.0-34-generic.dpkg-new", O_WRONLY) = -1 EPERM (Operation not permitted)

dpkg: error processing archive /var/cache/apt/archives/linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb (--install):
 unable to open '/boot/vmlinuz-5.8.0-34-generic.dpkg-new': Operation not permitted
rmdir("/boot/vmlinuz-5.8.0-34-generic.dpkg-new") = -1 ENOTDIR (Not a directory)
lstat("/boot/vmlinuz-5.8.0-34-generic.dpkg-new", {st_dev=makedev(0x103, 0x5), st_ino=787680, st_mode=S_IFREG|0600, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=18984, st_size=9716640, st_atime=1609958684 /* 2021-01-06T12:44:44.289897140-0600 */, st_atime_nsec=289897140, st_mtime=1608216088 /* 2020-12-17T08:41:28-0600 */, st_mtime_nsec=0, st_ctime=1609958684 /* 2021-01-06T12:44:44.285897140-0600 */, st_ctime_nsec=285897140}) = 0
unlink("/boot/vmlinuz-5.8.0-34-generic.dpkg-new") = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6647, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6656, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6657, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb
+++ exited with 1 +++

答案1

正是防病毒软件阻止了软件包的安装,正如 @khrysro 所言。暂时停用该服务后,安装过程便顺利完成。

答案2

就我而言,McAfee 代理这就是导致问题的原因。

我必须运行以下命令来卸载它,因为我不太需要它:

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

我也可以通过在此处下载安装程序来重新安装:

https://ui-usw003.mvision.mcafee.com/ComputerMgmt/agentPackage.get?token=be9becf628d1c82d1af74f1496bd8aca87c26a2e

然后打开我的终端,然后导航到下载安装程序的文件夹,然后运行以下命令:

sh McAfeeSmartInstall.sh

就这样。

我希望这有帮助

相关内容