我无法执行任何安装,显然也无法升级。
例如,我想安装 ukuu,然后
错误消息如下:
sudo apt install ukuu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
aptitude aptitude-common aria2 libcwidget3v5
Suggested packages:
aptitude-doc-en | aptitude-doc apt-xapian-index debtags tasksel libcwidget-dev
The following NEW packages will be installed:
aptitude aptitude-common aria2 libcwidget3v5 ukuu
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
8 not fully installed or removed.
Need to get 4,022 kB of archives.
After this operation, 17.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ubuntu.ntc.net.np/ubuntu zesty/main amd64 aptitude-common all 0.8.3-1ubuntu4 [835 kB]
Get:2 http://ppa.launchpad.net/teejee2008/ppa/ubuntu zesty/main amd64 ukuu amd64 17.2.3~77~ubuntu17.04.1 [217 kB]
Get:3 http://ubuntu.ntc.net.np/ubuntu zesty/main amd64 libcwidget3v5 amd64 0.5.17-4ubuntu2 [292 kB]
Get:4 http://ubuntu.ntc.net.np/ubuntu zesty/main amd64 aptitude amd64 0.8.3-1ubuntu4 [1,446 kB]
Get:5 http://ubuntu.ntc.net.np/ubuntu zesty/universe amd64 aria2 amd64 1.30.0-2 [1,233 kB]
Fetched 4,022 kB in 6s (598 kB/s)
Selecting previously unselected package aptitude-common.
(Reading database ... 487093 files and directories currently installed.)
Preparing to unpack .../aptitude-common_0.8.3-1ubuntu4_all.deb ...
Unpacking aptitude-common (0.8.3-1ubuntu4) ...
Selecting previously unselected package libcwidget3v5:amd64.
Preparing to unpack .../libcwidget3v5_0.5.17-4ubuntu2_amd64.deb ...
Unpacking libcwidget3v5:amd64 (0.5.17-4ubuntu2) ...
Selecting previously unselected package aptitude.
Preparing to unpack .../aptitude_0.8.3-1ubuntu4_amd64.deb ...
Unpacking aptitude (0.8.3-1ubuntu4) ...
Selecting previously unselected package aria2.
Preparing to unpack .../aria2_1.30.0-2_amd64.deb ...
Unpacking aria2 (1.30.0-2) ...
Selecting previously unselected package ukuu.
Preparing to unpack .../ukuu_17.2.3~77~ubuntu17.04.1_amd64.deb ...
Unpacking ukuu (17.2.3~77~ubuntu17.04.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu2) ...
Processing triggers for libglib2.0-0:amd64 (2.52.0-1) ...
No such key 'sort-directories-first' in schema 'org.gnome.nautilus.preferences' as specified in override file '/usr/share/glib-2.0/schemas/20_ubuntu-gnome-default-settings.gschema.override'; ignoring override for this key.
No such key 'enable-interactive-search' in schema 'org.gnome.nautilus.preferences' as specified in override file '/usr/share/glib-2.0/schemas/20_ubuntu-gnome-default-settings.gschema.override'; ignoring override for this key.
Processing triggers for menu (2.1.47ubuntu1) ...
###Then Problem starts with the linux-image as###
Setting up linux-image-4.10.0-24-generic (4.10.0-24.28) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-19-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-24-generic /boot/vmlinuz-4.10.0-24-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-24-generic /boot/vmlinuz-4.10.0-24-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-24-generic /boot/vmlinuz-4.10.0-24-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-24-generic
cp: cannot stat '/etc/udev/rules.d/60-vboxdrv': No such file or directory
cp: cannot stat '(copy).rules': No such file or directory
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-24-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.10.0-24-generic.postinst line 1052.
dpkg: error processing package linux-image-4.10.0-24-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up aptitude-common (0.8.3-1ubuntu4) ...
Setting up linux-image-4.10.0-21-generic (4.10.0-21.23) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-24-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-21-generic /boot/vmlinuz-4.10.0-21-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-21-generic /boot/vmlinuz-4.10.0-21-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-21-generic /boot/vmlinuz-4.10.0-21-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-21-generic
cp: cannot stat '/etc/udev/rules.d/60-vboxdrv': No such file or directory
cp: cannot stat '(copy).rules': No such file or directory
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-21-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.10.0-21-generic.postinst line 1052.
dpkg: error processing package linux-image-4.10.0-21-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up aria2 (1.30.0-2) ...
Processing triggers for libc-bin (2.24-9ubuntu2.2) ...
Setting up linux-image-4.10.0-19-generic (4.10.0-19.21) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-21-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic
dkms: WARNING: Linux headers are missing, which may explain the above failures.
please install the linux-headers-4.10.0-19-generic package to fix this.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-19-generic
cp: cannot stat '/etc/udev/rules.d/60-vboxdrv': No such file or directory
cp: cannot stat '(copy).rules': No such file or directory
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-19-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.10.0-19-generic.postinst line 1052.
dpkg: error processing package linux-image-4.10.0-19-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libcwidget3v5:amd64 (0.5.17-4ubuntu2) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-4.10.0-24-generic; however:
Package linux-image-4.10.0-24-generic is not configured yet.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-image-extra-4.10.0-24-generic:
linux-image-extra-4.10.0-24-generic depends on linux-image-4.10.0-24-generic; however:
Package linux-image-4.10.0-24-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.10.0-24-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-4.10.0-19-generic:
linux-image-extra-4.10.0-19-generic depends on linux-image-4.10.0-19-generic; however:
Package linux-image-4.10.0-19-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.10.0-19-generic (--configure):
dependency problems - leaving unconfigured
Setting up aptitude (0.8.3-1ubuntu4) ...
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode
dpkg: dependency problems prevent configuration of linux-image-extra-4.10.0-21-generic:
linux-image-extra-4.10.0-21-generic depends on linux-image-4.10.0-21-generic; however:
Package linux-image-4.10.0-21-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.10.0-21-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.10.0.24.26); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Setting up ukuu (17.2.3~77~ubuntu17.04.1) ...
Processing triggers for libc-bin (2.24-9ubuntu2.2) ...
Processing triggers for menu (2.1.47ubuntu1) ...
Errors were encountered while processing:
linux-image-4.10.0-24-generic
linux-image-4.10.0-21-generic
linux-image-4.10.0-19-generic
linux-image-generic
linux-image-extra-4.10.0-24-generic
linux-image-extra-4.10.0-19-generic
linux-image-extra-4.10.0-21-generic
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
/var/lib/dpkg/status
我尝试从 Synaptic Package Manager 中删除损坏的软件包
uname -r
4.10.0-22-generic
我还尝试清理 /boot 中除 4.10.0-22-generic 之外的其他版本
答案1
一个空格就60-vboxdrv (copy).rules
造成了整个问题
我检查了以下错误
cp: cannot stat '/etc/udev/rules.d/60-vboxdrv': No such file or directory
cp: cannot stat '(copy).rules': No such file or directorye
60-vboxdrv.rules
然后我意识到我有一天在目录中/etc/udev/rules.d/
以60-vboxdrv (copy).rules
nautilus(GUI) 的形式复制了规则,由于空格,它读取/etc/udev/rules.d/60-vboxdrv
为(copy).rules
。我本可以重命名并删除空格,而不是删除文件并保留原始文件。
我应该仔细检查所有错误。