内核软件包阻止升级 Ubuntu

内核软件包阻止升级 Ubuntu

操作系统:Ubuntu 20.04.4 LTS

我正在运行这个命令:

sudo apt upgrade

然后它会抛出这个错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-unsigned-5.18.0-051800-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 11,3 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: warning: files list file for package 'linux-modules-5.13.0-48-generic' mis
sing; assuming package has no files currently installed
(Reading database ... 428444 files and directories currently installed.)
Removing linux-image-unsigned-5.18.0-051800-generic (5.18.0-051800.202205222030)
 ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.18.0-051800-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/tela/theme.txt
/etc/grub.d/41_linux_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-unsigned-5.18.0-051800-generic (--rem
ove):
 installed linux-image-unsigned-5.18.0-051800-generic package post-removal scrip
t subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-unsigned-5.18.0-051800-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我尝试时sudo apt --fix-broken install,输出是:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-unsigned-5.18.0-051800-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 11,3 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: warning: files list file for package 'linux-modules-5.13.0-48-generic' mis
sing; assuming package has no files currently installed
(Reading database ... 428444 files and directories currently installed.)
Removing linux-image-unsigned-5.18.0-051800-generic (5.18.0-051800.202205222030)
 ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.18.0-051800-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/tela/theme.txt
/etc/grub.d/41_linux_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-unsigned-5.18.0-051800-generic (--rem
ove):
 installed linux-image-unsigned-5.18.0-051800-generic package post-removal scrip
t subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-unsigned-5.18.0-051800-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我尝试了这些:

sudo apt remove linux-image-unsigned-5.18.0-051800-generic
sudo apt autoremove

这些命令都会抛出相同的错误。然后我想也许我可以重新安装这个包,

sudo apt-get install linux-modules-5.18.0-051800-generic

它抛出这个错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-modules-5.18.0-051800-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-modules-5.18.0-051800-generic' has no installation candidate

此外, sudo apt update的输出是:

Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease                  
Hit:3 http://packages.microsoft.com/repos/code stable InRelease                
Hit:4 http://tr.archive.ubuntu.com/ubuntu focal InRelease                      
Hit:5 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu focal InRelease      
Hit:6 https://updates.signal.org/desktop/apt xenial InRelease                  
Hit:7 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease         
Get:8 http://tr.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]     
Hit:9 http://ppa.launchpad.net/audio-recorder/ppa/ubuntu focal InRelease       
Hit:10 http://repo.mysql.com/apt/ubuntu bionic InRelease                       
Hit:11 http://ppa.launchpad.net/costales/yaru-colors-folder-color/ubuntu focal InRelease
Hit:12 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease          
Ign:13 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 InRelease    
Hit:14 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease          
Hit:15 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release
Get:16 http://tr.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:17 http://ppa.launchpad.net/gerardpuig/ppa/ubuntu focal InRelease      
Hit:18 http://ppa.launchpad.net/gezakovacs/ppa/ubuntu focal InRelease
Hit:20 http://ppa.launchpad.net/numix/ppa/ubuntu focal InRelease
Hit:21 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Hit:22 http://ppa.launchpad.net/papirus/papirus/ubuntu focal InRelease
Hit:23 http://ppa.launchpad.net/teejee2008/ppa/ubuntu focal InRelease
Fetched 336 kB in 2s (149 kB/s)                      
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

笔记:我已经从以下网址下载安装了此内核https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D我原来的内核是(uname -r):5.13.0-35-generic

我安装了这个,因为旧的版本也阻止了升级。我尝试安装apt-mark hold这些包,但也没有用。

我不明白为什么我无法升级我的系统。如果我可以删除这个新内核,我该怎么做?

答案1

经过多次尝试,我通过删除 41_linux_proxy 解决了我的问题@没有人评论中的建议。

但我完全同意@Nmath因为我的包管理器完全搞砸了。重新安装 Ubuntu 是个好办法,不过目前我已经解决了。

相关内容