当我在 Ubuntu 16.04 机器上安装/卸载软件包时,出现以下错误。请帮忙。
sudo apt-get install slack
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
amd64-microcode intel-microcode iucode-tool libstd-rust-1.36 linux-headers-4.15.0-76 linux-headers-4.15.0-76-generic linux-headers-generic-hwe-16.04
linux-modules-4.15.0-76-generic thermald
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
slack
0 upgraded, 1 newly installed, 0 to remove and 255 not upgraded.
3 not fully installed or removed.
Need to get 1,550 B of archives.
After this operation, 25.6 kB of additional disk space will be used.
Get:1 https://packagecloud.io/slacktechnologies/slack/debian jessie/main amd64 slack all 1.2.1 [1,550 B]
Fetched 1,550 B in 4s (361 B/s)
Selecting previously unselected package slack.
(Reading database ... 438564 files and directories currently installed.)
Preparing to unpack .../archives/slack_1.2.1_all.deb ...
Unpacking slack (1.2.1) ...
Setting up initramfs-tools (0.122ubuntu8.14) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.157.22) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-58-generic
cp: cannot create regular file '/var/tmp/mkinitramfs_LmQYTP/init': No such file or directory
/usr/sbin/mkinitramfs:276: no such file or directory: /var/tmp/mkinitramfs_LmQYTP/conf/arch.conf
mkdir: cannot create directory ‘/var/tmp/mkinitramfs_LmQYTP//conf’: File exists
cp: failed to access '/var/tmp/mkinitramfs_LmQYTP//conf/conf.d': Not a directory
touch: cannot touch '/var/tmp/mkinitramfs_LmQYTP/etc/fstab': No such file or directory
ln: failed to create symbolic link '/var/tmp/mkinitramfs_LmQYTP/etc/mtab': No such file or directory
mkdir: cannot create directory ‘/var/tmp/mkinitramfs_LmQYTP/sbin’: File exists
E: /usr/share/initramfs-tools/hooks/brltty failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.15.0-58-generic with 1.
dpkg: error processing package linux-firmware (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up linux-image-4.15.0-72-generic (4.15.0-72.81~16.04.1) ...
Setting up slack (1.2.1) ...
Processing triggers for initramfs-tools (0.122ubuntu8.14) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-58-generic
cp: cannot create regular file '/var/tmp/mkinitramfs_OIbFBx//lib/modules/4.15.0-58-generic/kernel/drivers/phy/samsung/phy-exynos-usb2.ko': No such file or directory
cp: cannot create regular file '/var/tmp/mkinitramfs_OIbFBx//lib/modules/4.15.0-58-generic/kernel/drivers/usb/phy/phy-generic.ko': No such file or directory
rm: cannot remove '/var/tmp/mkinitramfs_OIbFBx/lib/modules/4.15.0-58-generic/kernel/drivers': Directory not empty
cp: cannot create regular file '/var/tmp/mkinitramfs_OIbFBx/init': No such file or directory
/usr/sbin/mkinitramfs:276: no such file or directory: /var/tmp/mkinitramfs_OIbFBx/conf/arch.conf
mkdir: cannot create directory ‘/var/tmp/mkinitramfs_OIbFBx//conf’: File exists
cp: failed to access '/var/tmp/mkinitramfs_OIbFBx//conf/conf.d': Not a directory
touch: cannot touch '/var/tmp/mkinitramfs_OIbFBx/etc/fstab': No such file or directory
ln: failed to create symbolic link '/var/tmp/mkinitramfs_OIbFBx/etc/mtab': No such file or directory
mkdir: cannot create directory ‘/var/tmp/mkinitramfs_OIbFBx/sbin’: File exists
E: /usr/share/initramfs-tools/hooks/brltty failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.15.0-58-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for linux-image-4.15.0-72-generic (4.15.0-72.81~16.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-72-generic
cp: cannot create regular file '/var/tmp/mkinitramfs_c2rv1o//lib/modules/4.15.0-72-generic/kernel/drivers/usb/phy/phy-generic.ko': No such file or directory
rm: cannot remove '/var/tmp/mkinitramfs_c2rv1o/lib/modules/4.15.0-72-generic/kernel/drivers': Directory not empty
cp: cannot create regular file '/var/tmp/mkinitramfs_c2rv1o/init': No such file or directory
/usr/sbin/mkinitramfs:276: no such file or directory: /var/tmp/mkinitramfs_c2rv1o/conf/arch.conf
mkdir: cannot create directory ‘/var/tmp/mkinitramfs_c2rv1o//conf’: File exists
cp: failed to access '/var/tmp/mkinitramfs_c2rv1o//conf/conf.d': Not a directory
touch: cannot touch '/var/tmp/mkinitramfs_c2rv1o/etc/fstab': No such file or directory
ln: failed to create symbolic link '/var/tmp/mkinitramfs_c2rv1o/etc/mtab': No such file or directory
mkdir: cannot create directory ‘/var/tmp/mkinitramfs_c2rv1o/sbin’: File exists
E: /usr/share/initramfs-tools/hooks/brltty failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.15.0-72-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.15.0-72-generic (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-firmware
initramfs-tools
linux-image-4.15.0-72-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您似乎正在从 获得 slack https://packagecloud.io/slacktechnologies/slack/debian jessie/main
。我不推荐这样做。slack
目前支持的所有 Ubuntu 版本的 slack 都可以在 Universe 存储库中找到这里。似乎还有大量软件包 (255) 您尚未更新。我会从那里开始,并按照您的输出建议进行清理,根据sudo apt autoremove
您的输出,实际上似乎正在破坏该过程的是以下软件包。
Linux 固件, initramfs 工具和 Linux-映像-4.15.0-72-通用
我会尝试重新安装软件包及其安装的依赖项对于每一种情况,密切关注输出以确定方法是否成功。如果不成功,你可能不得不清除并重新安装包的命令对于那些失败的人。
笔记:您还应该仔细查看 和 中的权限,/var/tmp
并确定它们是否合理。此建议与报告的错误有关,4.15.0-58-generic
这些错误似乎也未成功安装。