当我运行时sudo apt-get upgrade
我收到此错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
linux-image-3.13.0-63-generic linux-image-3.13.0-65-generic
linux-image-3.13.0-73-generic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
linux-image-extra-3.13.0-63-generic linux-image-extra-3.13.0-65-generic
linux-image-extra-3.13.0-67-generic linux-image-extra-3.13.0-73-generic
linux-image-extra-3.13.0-74-generic
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
10 not fully installed or removed.
After this operation, 759 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 507628 files and directories currently installed.)
Removing linux-image-extra-3.13.0-63-generic (3.13.0-63.103) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-63-generic /boot/vmlinuz-3.13.0-63-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-63-generic /boot/vmlinuz-3.13.0-63-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-63-generic /boot/vmlinuz-3.13.0-63-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-63-generic
mktemp: failed to create file via template ‘/var/tmp/mkinitramfs-FW_XXXXXX’: No such file or directory
update-initramfs: failed for /boot/initrd.img-3.13.0-63-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.13.0-63-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.13.0-65-generic (3.13.0-65.106) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-65-generic
mktemp: failed to create file via template ‘/var/tmp/mkinitramfs-FW_XXXXXX’: No such file or directory
update-initramfs: failed for /boot/initrd.img-3.13.0-65-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.13.0-65-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.13.0-67-generic (3.13.0-67.110) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-67-generic /boot/vmlinuz-3.13.0-67-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-67-generic /boot/vmlinuz-3.13.0-67-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-67-generic
mktemp: failed to create file via template ‘/var/tmp/mkinitramfs-FW_XXXXXX’: No such file or directory
update-initramfs: failed for /boot/initrd.img-3.13.0-67-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.13.0-67-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.13.0-73-generic (3.13.0-73.116) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-73-generic /boot/vmlinuz-3.13.0-73-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-73-generic /boot/vmlinuz-3.13.0-73-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-73-generic
mktemp: failed to create file via template ‘/var/tmp/mkinitramfs-FW_XXXXXX’: No such file or directory
update-initramfs: failed for /boot/initrd.img-3.13.0-73-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.13.0-73-generic (--remove):
subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Removing linux-image-extra-3.13.0-74-generic (3.13.0-74.118) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-74-generic /boot/vmlinuz-3.13.0-74-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-74-generic /boot/vmlinuz-3.13.0-74-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-74-generic
mktemp: failed to create file via template ‘/var/tmp/mkinitramfs-FW_XXXXXX’: No such file or directory
update-initramfs: failed for /boot/initrd.img-3.13.0-74-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
No apport report written because MaxReports is reached already
dpkg: error processing package linux-image-extra-3.13.0-74-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-63-generic
linux-image-extra-3.13.0-65-generic
linux-image-extra-3.13.0-67-generic
linux-image-extra-3.13.0-73-generic
linux-image-extra-3.13.0-74-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是输出stat /var/tmp; mktemp /var/tmp/mkinitramfs-FW_XXXXXX
stat: cannot stat ‘/var/tmp’: No such file or directory
mktemp: failed to create file via template ‘/var/tmp/mkinitramfs-FW_XXXXXX’: No such file or directory
通过其他方式安装apt-get
也失败了。请帮忙!
答案1
您的/var/tmp
可能不存在,并且TMPDIR
env 可能未设置,这是偶然的。在这种情况下,在而不是中initramfs
创建文件,但仍在 中查找它。mkinitramfs-FW_XXXXXX
/tmp
/var/tmp
mktemp
/var/tmp
现在您必须重新创建/var/tmp
:
sudo mkdir /var/tmp
sudo chmod 777 /var/tmp