0

I get the following error, when i install/uninstall a package on my Ubuntu 16.04 machine. Please help.

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 Answers1

2

You appear to be obtaining slack from https://packagecloud.io/slacktechnologies/slack/debian jessie/main. This I don't recommend. slack for all currently supported versions of Ubuntu is available in the Universe repository here. There also appears to be a large number of packages (255) that you haven't yet updated. I would start there and also clean up as your output suggests with sudo apt autoremove Based on your output what actually seems to be blowing up the process is the following packages.

linux-firmware , initramfs-tools and linux-image-4.15.0-72-generic

What I would do is attempt to Reinstall package and its installed dependencies for each of these, paying close atttention to the output to determine if the approach is successful. If not successful, you might have to go so far as to Command to purge and reinstall package for those that failed.

Note: You should also take a closer look at the permissions of and in /var/tmp and determine if they are sane. This advice relates to the errors reported regarding 4.15.0-58-generic which also appears to be unsuccessfully installed.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183