我正在从 3.8.5 升级python3
到 3.9,所以我(可能不应该)最终apt
删除了python-apt
.之后,我尝试重新安装它,但出现了以下错误:
$ sudo apt-get install python3-apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
apg app-install-data apport-symptoms appstream-data-pop appstream-data-pop-icons apt-config-icons-hidpi
apt-config-icons-large apt-config-icons-large-hidpi aptdaemon-data avahi-utils cabextract cups-pk-helper
firmware-manager-notify firmware-manager-shared gir1.2-flatpak-1.0 gir1.2-goa-1.0 gir1.2-ostree-1.0
gir1.2-packagekitglib-1.0 gir1.2-snapd-1 gnome-control-center-faces gnome-shell-extension-alt-tab-raise-first-window
gnome-shell-extension-always-show-workspaces gnome-shell-extension-appindicator gnome-shell-extension-desktop-icons
gnome-shell-extension-pop-battery-icon-fix gnome-shell-extension-pop-shop-details gtk2-engines-murrine icu-devtools
ippusbxd libcolord-gtk1 libfirmware-manager libflatpak-dev libflatpak0 libgsound0 libhandy-1-0 libicu-dev libmspack0
libostree-dev libpop-upgrade-gtk libqt5designer5 libqt5help5 librygel-core-2.6-2 librygel-db-2.6-2 librygel-renderer-2.6-2
librygel-server-2.6-2 libs76-hidpi-widget libsbc1 libwhoopsie-preferences0 libwhoopsie0 libxatracker2 libxml2-dev
mobile-broadband-provider-info network-manager-gnome pop-gnome-shell-theme pop-gtk-theme pop-icon-theme pop-shell
pop-shell-shortcuts pop-sound-theme pop-theme pop-upgrade pulseaudio-module-bluetooth python3-blinker python3-click
python3-colorama python3-cups python3-cupshelpers python3-dateutil python3-debconf python3-defer python3-distro-info
python3-entrypoints python3-gdbm python3-httplib2 python3-jwt python3-keyring python3-launchpadlib
python3-lazr.restfulclient python3-lazr.uri python3-oauthlib python3-problem-report python3-pyflatpak python3-pyqt5
python3-requests-unixsocket python3-secretstorage python3-simplejson python3-sip python3-wadllib rygel
system-config-printer system-config-printer-common system-config-printer-udev whoopsie-preferences x11-apps
x11-session-utils xbitmaps xinit xinput xserver-xorg-input-all xserver-xorg-input-libinput xserver-xorg-video-all
xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-nouveau
xserver-xorg-video-radeon xserver-xorg-video-vesa xserver-xorg-video-vmware xwayland
Use 'sudo apt autoremove' to remove them.
Suggested packages:
python3-apt-dbg python-apt-doc
The following NEW packages will be installed
python3-apt
0 to upgrade, 1 to newly install, 0 to remove and 21 not to upgrade.
1 not fully installed or removed.
Need to get 152 kB of archives.
After this operation, 694 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/system76/pop/ubuntu focal/main amd64 python3-apt amd64 2.1.2pop0~1587756471~20.04~cd2988e [152 kB]
Fetched 152 kB in 1s (132 kB/s)
Selecting previously unselected package python3-apt.
(Reading database ... 295195 files and directories currently installed.)
Preparing to unpack .../python3-apt_2.1.2pop0~1587756471~20.04~cd2988e_amd64.deb ...
Unpacking python3-apt (2.1.2pop0~1587756471~20.04~cd2988e) ...
Setting up initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: deferring update (trigger activated)
Setting up python3-apt (2.1.2pop0~1587756471~20.04~cd2988e) ...
Processing triggers for initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: Generating /boot/initrd.img-5.8.16-xanmod1
cryptsetup: WARNING: Resume target cryptswap uses a key file
kernelstub.Config : INFO Looking for configuration...
kernelstub : INFO System information:
OS:..................Ubuntu 20.04
Root partition:....../dev/dm-1
Root FS UUID:........4270b8f1-42f2-41af-b42c-e6963dcf34be
ESP Path:............/boot/efi
ESP Partition:......./dev/sda1
ESP Partition #:.....1
NVRAM entry #:.......-1
Boot Variable #:.....0000
Kernel Boot Options:.quiet loglevel=0 systemd.show_status=false splash
Kernel Image Path:.../boot/vmlinuz-5.8.16-xanmod1
Initrd Image Path:.../boot/initrd.img-5.8.16-xanmod1
Force-overwrite:.....False
kernelstub.Installer : INFO Copying Kernel into ESP
kernelstub.Installer : INFO Copying initrd.img into ESP
kernelstub.Installer : INFO Setting up loader.conf configuration
kernelstub.Installer : INFO Making entry file for Ubuntu
kernelstub.Installer : INFO Backing up old kernel
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 247, in copy_files
shutil.copy(src, dest)
File "/usr/lib/python3.9/shutil.py", line 415, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.9/shutil.py", line 272, in copyfile
_fastcopy_sendfile(fsrc, fdst)
File "/usr/lib/python3.9/shutil.py", line 163, in _fastcopy_sendfile
raise err from None
File "/usr/lib/python3.9/shutil.py", line 149, in _fastcopy_sendfile
sent = os.sendfile(outfd, infd, offset, blocksize)
OSError: [Errno 28] No space left on device: '/proc/cmdline' -> '/boot/efi/EFI/Ubuntu-4270b8f1-42f2-41af-b42c-e6963dcf34be/cmdline'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/kernelstub", line 244, in <module>
main()
File "/usr/bin/kernelstub", line 241, in main
kernelstub.main(args)
File "/usr/lib/python3/dist-packages/kernelstub/application.py", line 346, in main
installer.copy_cmdline(simulate=no_run)
File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 214, in copy_cmdline
self.copy_files(
File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 251, in copy_files
raise FileOpsError("Could not copy one or more files.")
kernelstub.installer.FileOpsError: Could not copy one or more files.
run-parts: /etc/initramfs/post-update.d//zz-kernelstub exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
所以我尝试了各种各样的东西,包括但不限于:
dpkg --configure -a
(同样的错误)。sudo killall dpkg
,返回了dpkg: no process found
update-initramfs -u
。回到:
$ update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.8.16-xanmod1
I: The initramfs will attempt to resume from /dev/sda4
I: (UUID=cac83f23-4172-4dac-93f5-9cda57338121)
I: Set the RESUME variable to override this.
kernelstub.Config : INFO Looking for configuration...
kernelstub : INFO System information:
OS:..................Ubuntu 20.04
Root partition:....../dev/dm-1
Root FS UUID:........4270b8f1-42f2-41af-b42c-e6963dcf34be
ESP Path:............/boot/efi
ESP Partition:......./dev/sda1
ESP Partition #:.....1
NVRAM entry #:.......-1
Boot Variable #:.....0000
Kernel Boot Options:.quiet loglevel=0 systemd.show_status=false splash
Kernel Image Path:.../boot/vmlinuz-5.8.16-xanmod1
Initrd Image Path:.../boot/initrd.img-5.8.16-xanmod1
Force-overwrite:.....False
kernelstub.Installer : INFO Copying Kernel into ESP
kernelstub.Installer : ERROR Couldn't copy the kernel onto the ESP!
This is a critical error and we cannot continue. Check your settings to see if there is a typo. Otherwise, check permissions and try again.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 247, in copy_files
shutil.copy(src, dest)
File "/usr/lib/python3.9/shutil.py", line 415, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.9/shutil.py", line 272, in copyfile
_fastcopy_sendfile(fsrc, fdst)
File "/usr/lib/python3.9/shutil.py", line 163, in _fastcopy_sendfile
raise err from None
File "/usr/lib/python3.9/shutil.py", line 149, in _fastcopy_sendfile
sent = os.sendfile(outfd, infd, offset, blocksize)
OSError: [Errno 28] No space left on device: '/boot/vmlinuz-5.8.16-xanmod1' -> '/boot/efi/EFI/Ubuntu-4270b8f1-42f2-41af-b42c-e6963dcf34be/vmlinuz.efi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 121, in setup_kernel
self.copy_files(
File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 251, in copy_files
raise FileOpsError("Could not copy one or more files.")
kernelstub.installer.FileOpsError: Could not copy one or more files.
run-parts: /etc/initramfs/post-update.d//zz-kernelstub exited with return code 170
- 清除旧内核。目前我在:
root@jeffs-workstation:/boot# ls -l
total 324360
-rw-r--r-- 1 root root 249178 Oct 18 07:31 config-5.8.16-xanmod1
drwx------ 5 root root 4096 Dec 31 1969 efi
-rw-r--r-- 1 root root 96567350 Oct 29 17:18 initrd.img-5.8.16-xanmod1
-rw-r--r-- 1 root root 96567347 Oct 29 17:17 initrd.img-5.8.16-xanmod1.dpkg-bak
-rw-r--r-- 1 root root 118900024 Oct 29 17:13 initrd.img-5.8.17-xanmod1
lrwxrwxrwx 1 root root 25 Oct 29 15:14 initrd.img.old -> initrd.img-5.8.16-xanmod1
-rw-r--r-- 1 root root 5334591 Oct 18 07:31 System.map-5.8.16-xanmod1
-rw-r--r-- 1 root root 14497152 Oct 18 07:31 vmlinuz-5.8.16-xanmod1
lrwxrwxrwx 1 root root 22 Oct 29 15:14 vmlinuz.old -> vmlinuz-5.8.16-xanmod1
- 重新配置 cryptswap,因为这是另一个错误 (
update-initramfs: Generating /boot/initrd.img-5.8.16-xanmod1 cryptsetup: WARNING: Resume target cryptswap uses a key file
)。从那以后 cryptswap 就再也没有抱怨过:
root@jeffs-workstation:/boot# sudo swapoff -a
root@jeffs-workstation:/boot# sudo cryptsetup remove /dev/mapper/cryptswap
root@jeffs-workstation:/boot# sudo vim /etc/crypttab
root@jeffs-workstation:/boot# /sbin/mkswap /dev/sda4
mkswap: /dev/sda4: warning: wiping old swap signature.
Setting up swapspace version 1, size = 4 GiB (4294959104 bytes)
no label, UUID=cac83f23-4172-4dac-93f5-9cda57338121
root@jeffs-workstation:/boot# swapon /dev/sda4
root@jeffs-workstation:/boot# vim /etc/fstab
apt install -f
也返回相同的错误。apt-get autoclean
、clean
、autoremove
、remove
等遇到同样的错误。fdisk -l
返回这个:
root@jeffs-workstation:/boot# fdisk -l
Disk /dev/loop0: 97.76 MiB, 102486016 bytes, 200168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 55.37 MiB, 58052608 bytes, 113384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 162.89 MiB, 170778624 bytes, 333552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 62.9 MiB, 65105920 bytes, 127160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 66.72 MiB, 69947392 bytes, 136616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1ER1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D0A60BA4-4AC7-4CB0-AC4C-0BDC43CAAE4E
Device Start End Sectors Size Type
/dev/sda1 4096 1023998 1019903 498M EFI System
/dev/sda2 1024000 9412606 8388607 4G Microsoft basic data
/dev/sda3 9412608 3898636462 3889223855 1.8T Linux filesystem
/dev/sda4 3898636464 3907025070 8388607 4G Linux swap
Disk /dev/sdb: 29.84 GiB, 32017047552 bytes, 62533296 sectors
Disk model: LITEONIT LMS-32S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/cryptdata: 1.83 TiB, 1991265836544 bytes, 3889191087 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/data-root: 1.83 TiB, 1991262601216 bytes, 3889184768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
此外,/boot/efi
根据桌面通知,它是空的。
我能做些什么?
答案1
我遇到了同样的问题,在查看我的分区后,我发现我的 EFI 分区已满(尝试该df
命令),环顾四周后我发现本指南,查看我的 /boot/efi/EFI 文件夹后,我似乎有一个不需要的文件夹(标有“Ubuntu”的文件夹)删除该文件夹后,它似乎已修复,并且我能够再次运行 apt 命令