我已经更新了我的 Ubuntu 22.04 LTS,更新时出现一些错误,并且无法安装某些软件。
akhil@KHUSHI:~/.config$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
更新:
akhil@KHUSHI:~/.config$ sudo apt-get update
Hit:1 https://deb.nodesource.com/node_16.x jammy InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 https://packages.microsoft.com/repos/edge stable InRelease
Hit:5 https://dl.winehq.org/wine-builds/ubuntu jammy InRelease
Hit:6 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Hit:8 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:9 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
W: https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
我的核心:
akhil@KHUSHI:~$ uname -r
5.15.0-52-generic
全面升级:
akhil@KHUSHI:~/.config$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
修复损坏的软件包:
akhil@KHUSHI:~/.config$ sudo apt -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-image-unsigned-5.15.0-50-generic
Suggested packages:
fdutils linux-doc | linux-source-5.15.0 linux-tools
linux-headers-5.15.0-50-generic linux-modules-extra-5.15.0-50-generic
The following packages will be REMOVED:
linux-image-5.15.0-50-generic
The following NEW packages will be installed:
linux-image-unsigned-5.15.0-50-generic
0 upgraded, 1 newly installed, 1 to remove and 8 not upgraded.
6 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 379 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-50-generic: dependency problems, but removing anyway as
you requested:
linux-modules-5.15.0-50-generic depends on linux-image-5.15.0-50-generic | linu
x-image-unsigned-5.15.0-50-generic; however:
Package linux-image-5.15.0-50-generic is to be removed.
Package linux-image-unsigned-5.15.0-50-generic is not installed.
(Reading database ... 331119 files and directories currently installed.)
Removing linux-image-5.15.0-50-generic (5.15.0-50.56) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-50-generic
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-probe: error: failed to get canonical path of `rpool/ROOT/ubuntu_
zs8jjk'.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.15.0-50-generic (--remove):
installed linux-image-5.15.0-50-generic package post-removal script subprocess
returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.15.0-50-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
更新 GRUB:
akhil@KHUSHI:~$ sudo update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of `rpool/ROOT/ubuntu_zs8jjk'.
akhil@KHUSHI:~$ sudo apt-get install --reinstall grub-efi-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-modules-5.15.0-50-generic : Depends: linux-image-5.15.0-50-generic but it is not going to be installed or
linux-image-unsigned-5.15.0-50-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
依赖项:
akhil@KHUSHI:~$ dpkg -L linux-image-5.15.0-50-generic
Package 'linux-image-5.15.0-50-generic' does not contain any files (!)
akhil@KHUSHI:~$ dpkg -l linux-image-5.15.0-50-generic
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-============-============-===================>
pH linux-image-5.15.0-50-generic 5.15.0-50.56 amd64 Signed kernel image>
[1]+ Stopped dpkg -l linux-image-5.15.0-50-generic
强制删除 linux-modules-5.15.0-50-generic:
akhil@KHUSHI:~$ sudo dpkg --purge --force-remove-reinstreq linux-image-5.15.0-50-generic
(Reading database ... 329778 files and directories currently installed.)
Removing linux-image-5.15.0-50-generic (5.15.0-50.56) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-50-generic
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-probe: error: failed to get canonical path of `rpool/ROOT/ubuntu_zs8jjk'.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.15.0-50-generic (--purge):
installed linux-image-5.15.0-50-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-5.15.0-50-generic
akhil@KHUSHI:~$ sudo apt-get remove --purge linux-image-5.15.0-50-generic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
linux-image-5.15.0-50-generic
0 upgraded, 0 newly installed, 1 to remove and 22 not upgraded.
2 not fully installed or removed.
After this operation, 11.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 329778 files and directories currently installed.)
Removing linux-image-5.15.0-50-generic (5.15.0-50.56) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-50-generic
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-probe: error: failed to get canonical path of `rpool/ROOT/ubuntu_zs8jjk'.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.15.0-50-generic (--remove):
installed linux-image-5.15.0-50-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.15.0-50-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
ZFS 列表:
akhil@KHUSHI:~$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
bpool 291M 1.47G 96K /boot
bpool/BOOT 290M 1.47G 96K none
bpool/BOOT/ubuntu_zs8jjk 290M 1.47G 290M /boot
rpool 120G 326G 192K /
rpool/ROOT 25.0G 326G 192K none
rpool/ROOT/ubuntu_zs8jjk 25.0G 326G 15.2G /
rpool/ROOT/ubuntu_zs8jjk/srv 216K 326G 216K /srv
rpool/ROOT/ubuntu_zs8jjk/usr 261M 326G 192K /usr
rpool/ROOT/ubuntu_zs8jjk/usr/local 260M 326G 260M /usr/local
rpool/ROOT/ubuntu_zs8jjk/var 9.53G 326G 192K /var
rpool/ROOT/ubuntu_zs8jjk/var/games 216K 326G 216K /var/games
rpool/ROOT/ubuntu_zs8jjk/var/lib 9.42G 326G 9.20G /var/lib
rpool/ROOT/ubuntu_zs8jjk/var/lib/AccountsService 260K 326G 260K /var/lib/AccountsService
rpool/ROOT/ubuntu_zs8jjk/var/lib/NetworkManager 728K 326G 728K /var/lib/NetworkManager
rpool/ROOT/ubuntu_zs8jjk/var/lib/apt 107M 326G 107M /var/lib/apt
rpool/ROOT/ubuntu_zs8jjk/var/lib/dpkg 124M 326G 124M /var/lib/dpkg
rpool/ROOT/ubuntu_zs8jjk/var/log 96.1M 326G 96.1M /var/log
rpool/ROOT/ubuntu_zs8jjk/var/mail 216K 326G 216K /var/mail
rpool/ROOT/ubuntu_zs8jjk/var/snap 8.00M 326G 8.00M /var/snap
rpool/ROOT/ubuntu_zs8jjk/var/spool 324K 326G 324K /var/spool
rpool/ROOT/ubuntu_zs8jjk/var/www 216K 326G 216K /var/www
rpool/USERDATA 93.9G 326G 192K /
rpool/USERDATA/akhil_pltcof 80.9G 326G 80.9G /home/akhil
rpool/USERDATA/root_pltcof 13.0G 326G 13.0G /root
rpool/keystore 518M 327G 63.5M -
由于这个问题,我无法安装新的应用程序、运行某些现有的应用程序或获取软件更新。
答案1
问题:
首先,我认为您有一些 Ubuntu Impish 存储库是手动添加的。Ubuntu Impish (21.10) 现已停用,因此不再受支持,并且存储库已被禁用。
接下来,AMCG ppa 上次可用于 Ubuntu Xenial。
在下面“已发布软件包的概览”,点击下拉菜单“出版于: 任何系列“过滤器,您将看到此 PPA 仅适用于 Xenial 和 Trusty。
此外,在 5.0 以上版本的内核中,Anbox 支持 ppa 不再是必要的. 任何比 19.04 更新的 Ubuntu 版本都不需要 anbox-support PPA 提供的额外内核模块。
解决方案:
最简单的解决方案是删除或注释掉源列表文件中的所有 Ubuntu Impish 行。
然后,使用以下add-apt-repository -r
命令删除不需要的 PPA 存储库:
sudo add-apt-repository -r ppa:amcg/ppa
sudo add-apt-repository -r ppa:morphis/anbox-support
此外,您可能需要重新安装 Brave 浏览器,因为它抛出了签名错误。请务必备份您当前的 Brave 浏览器,以防丢失书签和设置。虽然这可能超出了该问题的范围,但如果您需要帮助,您可以向社区询问并提出新问题。
然后运行:
sudo apt update
如果没有出现错误:
sudo apt full-upgrade
如果遇到问题,您可能需要运行:
sudo apt -f install
没有提到任何软件包 — 只需按原样运行最后一个命令,它将尝试修复任何损坏的软件包的问题。请务必注意输出,并且只有确定要继续时才选择 Y,因为这可能会删除或卸载软件包。
当您不再有任何错误时,请验证所有内容均已更新/升级:
sudo apt update
sudo apt full-upgrade