所以我刚刚在我的 2014 年中 Macbook Pro Retina 上安装了 Ubuntu 15.10 作为独立分区。
一切运行正常,我安装的每个应用程序也都正常运行,但无论如何,每次安装或更新时仍然会出现一些错误。
alex@Alex-LinuxTop:~$ sudo apt-get install vlc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
i965-va-driver liba52-0.7.4 libaacs0 libass5 libavcodec-ffmpeg56 libavformat-ffmpeg56 libavutil-ffmpeg54
libbasicusageenvironment0 libbdplus0 libbluray1 libcddb2 libchromaprint0 libcrystalhd3 libdc1394-22 libdca0 libdirectfb-1.2-9
libdvbpsi10 libdvdnav4 libdvdread4 libebml4v5 libenca0 libfaad2 libgles1-mesa libgles2-mesa libgme0 libgroupsock1 libgsm1
libiso9660-8 libkate1 liblivemedia23 libmad0 libmatroska6v5 libmodplug1 libmp3lame0 libmpcdec6 libmpeg2-4 libopenjpeg5 libopus0
libpostproc-ffmpeg53 libproxy-tools libqt5x11extras5 libresid-builder0c2a libschroedinger-1.0-0 libsdl-image1.2 libsdl1.2debian
libshine3 libsidplay2v5 libsoxr0 libssh-gcrypt-4 libssh2-1 libswresample-ffmpeg1 libswscale-ffmpeg3 libtwolame0 libupnp6
libusageenvironment1 libva-drm1 libva-x11-1 libva1 libvcdinfo0 libvdpau1 libvlc5 libvlccore8 libx264-146 libx265-59
libxcb-composite0 libxcb-xv0 libxvidcore4 libzvbi-common libzvbi0 va-driver-all vdpau-va-driver vlc-data vlc-nox
vlc-plugin-notify vlc-plugin-samba
Suggested packages:
libbluray-bdj libchromaprint-tools python-acoustid firmware-crystalhd libdvdcss2 opus-tools nvidia-vdpau-driver vdpau-driver
libx265-59-dbg xvba-va-driver videolan-doc
The following NEW packages will be installed:
i965-va-driver liba52-0.7.4 libaacs0 libass5 libavcodec-ffmpeg56 libavformat-ffmpeg56 libavutil-ffmpeg54
libbasicusageenvironment0 libbdplus0 libbluray1 libcddb2 libchromaprint0 libcrystalhd3 libdc1394-22 libdca0 libdirectfb-1.2-9
libdvbpsi10 libdvdnav4 libdvdread4 libebml4v5 libenca0 libfaad2 libgles1-mesa libgles2-mesa libgme0 libgroupsock1 libgsm1
libiso9660-8 libkate1 liblivemedia23 libmad0 libmatroska6v5 libmodplug1 libmp3lame0 libmpcdec6 libmpeg2-4 libopenjpeg5 libopus0
libpostproc-ffmpeg53 libproxy-tools libqt5x11extras5 libresid-builder0c2a libschroedinger-1.0-0 libsdl-image1.2 libsdl1.2debian
libshine3 libsidplay2v5 libsoxr0 libssh-gcrypt-4 libssh2-1 libswresample-ffmpeg1 libswscale-ffmpeg3 libtwolame0 libupnp6
libusageenvironment1 libva-drm1 libva-x11-1 libva1 libvcdinfo0 libvdpau1 libvlc5 libvlccore8 libx264-146 libx265-59
libxcb-composite0 libxcb-xv0 libxvidcore4 libzvbi-common libzvbi0 va-driver-all vdpau-va-driver vlc vlc-data vlc-nox
vlc-plugin-notify vlc-plugin-samba
0 upgraded, 76 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
Need to get 21.1 MB of archives.
After this operation, 89.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:75 http://us.archive.ubuntu.com/ubuntu/ wily/universe vlc-plugin-notify amd64 2.2.1-3 [5,216 B]
Get:76 http://us.archive.ubuntu.com/ubuntu/ wily/universe vlc-plugin-samba amd64 2.2.1-3 [4,910 B]
Fetched 21.1 MB in 6s (3,329 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package libbasicusageenvironment0.
(Reading database ... 219118 files and directories currently installed.)
Preparing to unpack .../libbasicusageenvironment0_2014.01.13-1_amd64.deb ...
Unpacking libbasicusageenvironment0 (2014.01.13-1) ...
Selecting previously unselected package libcrystalhd3:amd64.
Preparing to unpack .../libcrystalhd3_1%3a0.0~git20110715.fdd2f19-11build1_amd64.deb ...
Unpacking libmpcdec6:amd64 (2:0.1~r459-4.1build1) ...
Selecting previously unselected package libmpeg2-4:amd64.
[..]
Selecting previously unselected package vlc-plugin-samba.
Preparing to unpack .../vlc-plugin-samba_2.2.1-3_amd64.deb ...
Unpacking vlc-plugin-samba (2.2.1-3) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu3) ...
Processing triggers for bamfdaemon (0.5.2~bzr0+15.10.20150627.1-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.58ubuntu1) ...
Setting up linux-image-4.2.0-25-generic (4.2.0-25.30) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-4.2.0-25-generic
) points to /boot/initrd.img-4.2.0-25-generic
(/boot/initrd.img-4.2.0-25-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.2.0-25-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-4.2.0-25-generic
) points to /boot/vmlinuz-4.2.0-25-generic
(/boot/vmlinuz-4.2.0-25-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.2.0-25-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.2.0-25-generic
Found initrd image: /boot/initrd.img-4.2.0-25-generic
Found linux image: /boot/vmlinuz-4.2.0-16-generic
Found initrd image: /boot/initrd.img-4.2.0-16-generic
/etc/grub.d/40_custom.save: 1: /etc/grub.d/40_custom.save: z: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.2.0-25-generic.postinst line 1025.
dpkg: error processing package linux-image-4.2.0-25-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up grub-efi-amd64 (2.02~beta2-29ubuntu0.3) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.2.0-25-generic
Found initrd image: /boot/initrd.img-4.2.0-25-generic
Found linux image: /boot/vmlinuz-4.2.0-16-generic
Found initrd image: /boot/initrd.img-4.2.0-16-generic
/etc/grub.d/40_custom.save: 1: /etc/grub.d/40_custom.save: z: not found
dpkg: error processing package grub-efi-amd64 (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
grub-efi-amd64-signed depends on grub-efi-amd64 (= 2.02~beta2-29ubuntu0.3); however:
Package grub-efi-amd64 is not configured yet.
dpkg: error processing package grub-efi-amd64-signed (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-4.2.0-25-generic:
linux-image-extra-4.2.0-25-generic depends on linux-image-4.2.0-25-generic; however:
Package linux-image-4.2.0-25-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.2.0-25-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-4.2.0-25-generic; however:
Package linux-image-4.2.0-25-generic is not configured yet.
linux-image-generic depends on linux-image-extra-4.2.0-25-generic; however:
Package linux-image-extra-4.2.0-25-genericNo apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
is not configured yet.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.2.0.25.27); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image-4.2.0-25-generic:
linux-signed-image-4.2.0-25-generic depends on linux-image-4.2.0-25-generic (= 4.2.0-25.30); however:
Package linux-image-4.2.0-25-generic is not configured yet.
dpkg: error processing package linux-signed-image-4.2.0-25-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image-generic:
linux-signed-image-generic depends on linux-signed-image-4.2.0-25-generic; however:
Package linux-signed-image-4.2.0-25-generic is not configured yet.
linux-signed-image-generic depends on linux-image-extra-4.2.0-25-generic; however:
Package linux-image-extra-4.2.0-25-generic is not configured yet.
dpkg: error processing package linux-signed-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-generic:
linux-signed-generic depends on linux-signed-image-generic (= 4.2.0.25.27); however:
Package linux-signed-image-generic is not configured yet.
dpkg: error processing package linux-signed-generic (--configure):
dependency problems - leaving unconfigured
Setting up libbasicusageenvironment0 (2014.01.13-1) ...
Setting up libcrystalhd3:amd64 (1:0.0~git20110715.fdd2f19-11build1) ...
Setting up libdirectfb-1.2-9:amd64 (1.2.10.0-5.1) ...
Setting up libdvdread4:amd64 (5.0.0-1ubuntu1) ...
[...]
Setting up vlc-plugin-notify (2.2.1-3) ...
Setting up vlc-plugin-samba (2.2.1-3) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for vlc-nox (2.2.1-3) ...
Errors were encountered while processing:
linux-image-4.2.0-25-generic
grub-efi-amd64
grub-efi-amd64-signed
linux-image-extra-4.2.0-25-generic
linux-image-generic
linux-generic
linux-signed-image-4.2.0-25-generic
linux-signed-image-generic
linux-signed-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
抱歉,代码太长了,但这是我安装 VLC 时的代码。这些软件包:
Errors were encountered while processing:
linux-image-4.2.0-25-generic
grub-efi-amd64
grub-efi-amd64-signed
linux-image-extra-4.2.0-25-generic
linux-image-generic
linux-generic
linux-signed-image-4.2.0-25-generic
linux-signed-image-generic
linux-signed-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
他们总是犯同样的错误。
我尝试卸载并重新安装,我尝试运行
sudo apt-get install -f
但也没有修复它。
谢谢您的帮助!
答案1
我不是 100% 肯定,但我认为这是你的问题:
/etc/grub.d/40_custom.save: 1: /etc/grub.d/40_custom.save: z: not found
在我看来,您的/etc/grub.d/40_custom.save
文件已损坏,其中有一个杂散z
字符,系统试图将其解释为命令。我建议您检查此文件。根据文件名,我预计这是旧文件的备份,但我对此并不完全确定。如果我没记错的话,删除它可能是合适的。
答案2
您曾尝试过aptitude
代替吗apt-get
?
你可以试试
aptitude install linux-image-4.2.0-25-generic
它应该尝试修复这个损坏的包并比 apt-get 显示更多的解决方案?
我了解到 aptitude 可以更有效地提供依赖关系问题的解决方案(即,如果需要,它会建议您降级软件包),而 apt-get 对安装依赖关系的要求则更为严格!