尝试安装、卸载或更新任何内容都会导致相同的错误代码

尝试安装、卸载或更新任何内容都会导致相同的错误代码

我运行sudo apt update然后sudo apt upgrade显示以下内容:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed
The following packages will be upgraded:
  cloud-init linux-firmware
2 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
4 not fully installed or removed.
Need to get 282 MB/295 MB of archives.
After this operation, 646 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu lunar-updates/main amd64 linux-firmware all 20230323.gitbcdcfbcf-0ubuntu1.7 [281 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu lunar-updates/main amd64 cloud-init all 23.3.1-0ubuntu1~23.04.1 [577 kB]
Fetched 282 MB in 19s (14.8 MB/s)                                              
Preconfiguring packages ...
(Reading database ... 330125 files and directories currently installed.)
Preparing to unpack .../linux-firmware_20230323.gitbcdcfbcf-0ubuntu1.7_all.deb .
..
Unpacking linux-firmware (20230323.gitbcdcfbcf-0ubuntu1.7) over (20230323.gitbcd
cfbcf-0ubuntu1.6) ...
Preparing to unpack .../cloud-init_23.3.1-0ubuntu1~23.04.1_all.deb ...
Unpacking cloud-init (23.3.1-0ubuntu1~23.04.1) over (23.2.2-0ubuntu0~23.04.1) ..
.
Setting up linux-image-6.2.0-34-generic (6.2.0-34.34) ...
Failed to create symlink to vmlinuz-6.2.0-34-generic: Operation not permitted at
 /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-6.2.0-34-generic (--configure):
 installed linux-image-6.2.0-34-generic package post-installation script subproc
ess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-hwe-22.04
:
 linux-image-generic-hwe-22.04 depends on linux-image-6.2.0-34-generic; however:
  Package linux-image-6.2.0-34-generic is not configured yet.

dpkg: error processing package linux-image-generic-hwe-22.04 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-hwe-22.04:
 linux-generic-hwe-22.04 depends on linux-image-generic-hwe-22.04 (= 6.2.0.34.34
); however:
  Package linux-image-generic-hwe-22.04 is not configured yet.

dpkg: error processing package linux-generic-hwe-22.04 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup erro
r from a previous failure.
                          No apport report written because the error message ind
icates its a followup error from a previous failure.
                                                    Setting up cloud-init (23.3.
1-0ubuntu1~23.04.1) ...
Installing new version of config file /etc/cloud/cloud.cfg ...
Removing obsolete conffile /etc/NetworkManager/dispatcher.d/hook-network-manager
 ...
Setting up linux-firmware (20230323.gitbcdcfbcf-0ubuntu1.7) ...
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for rsyslog (8.2302.0-1ubuntu3) ...
Errors were encountered while processing:
 linux-image-6.2.0-34-generic
 linux-image-generic-hwe-22.04
 linux-generic-hwe-22.04
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我运行sudo dpkg --configure -a它并返回

Setting up linux-image-6.2.0-34-generic (6.2.0-34.34) ...
Failed to create symlink to vmlinuz-6.2.0-34-generic: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-6.2.0-34-generic (--configure):
 installed linux-image-6.2.0-34-generic package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-generic-hwe-22.04:
 linux-generic-hwe-22.04 depends on linux-image-generic-hwe-22.04 (= 6.2.0.34.34); however:
  Package linux-image-generic-hwe-22.04 is not configured yet.

dpkg: error processing package linux-generic-hwe-22.04 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-6.2.0-34-generic
 linux-generic-hwe-22.04

然后,当我慢慢变成一个空壳时,我跑了sudo apt --fix-broken install,它又回来了

Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-6.2.0-33-generic
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
4 not fully installed or removed.
After this operation, 13.9 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 330145 files and directories currently installed.)
Removing linux-image-6.2.0-33-generic (6.2.0-33.33+1) ...
Failed to create symlink to vmlinuz-6.2.0-34-generic: Operation not permitted at
 /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-6.2.0-33-generic (--remove):
 installed linux-image-6.2.0-33-generic package post-removal script subprocess r
eturned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.2.0-33-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

第 64 行,如上一个结果中所述(为清楚起见添加了上下文):

 my $rand;
    while (($rand = int(rand(1000000))) && !symlink($source, "$dest.$rand")) {
    if ($! != POSIX::EEXIST) {
        die "Failed to create symlink to $source: $!"; <-- this line
    }
}

跑步sudo apt autoremove回报

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-6.2.0-33-generic
0 upgraded, 0 newly installed, 1 to remove and 23 not upgraded.
4 not fully installed or removed.
After this operation, 13.9 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 330145 files and directories currently installed.)
Removing linux-image-6.2.0-33-generic (6.2.0-33.33+1) ...
Failed to create symlink to vmlinuz-6.2.0-34-generic: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-6.2.0-33-generic (--remove):
 installed linux-image-6.2.0-33-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.2.0-33-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

跑步sudo apt install inxi回报

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-6.2.0-33-generic
0 upgraded, 0 newly installed, 1 to remove and 23 not upgraded.
4 not fully installed or removed.
After this operation, 13.9 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 330145 files and directories currently installed.)
Removing linux-image-6.2.0-33-generic (6.2.0-33.33+1) ...
Failed to create symlink to vmlinuz-6.2.0-34-generic: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-6.2.0-33-generic (--remove):
 installed linux-image-6.2.0-33-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.2.0-33-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

我会运行你们告诉我运行的任何程序并报告结果。这已经困扰我好几个星期了。

相关内容