我正在使用 Ubuntu 12.04 LTS,每当我使用时:
sudo apt-get remove
sudo apt-get install
它回复说:
cp: failed to extend `/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是正确的吗?
正在安装/移除吗?
回复:
sudo apt-get install -f
是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.99ubuntu13.4) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
ln: failed to create hard link `/boot/initrd.img-3.5.0-47-generic.dpkg-bak' => `/boot/initrd.img-3.5.0-47-generic': Operation not permitted
cp: writing `/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device
cp: failed to extend `/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您的错误指出:
设备上没有剩余空间
从 Dash 打开系统监视器并选择文件系统选项卡。
如果问题仅与 /boot 分区有关,请尝试以下操作:
sudo apt-get autoremove
如果不起作用,则说明 /boot 中没有空间
您有很多未使用的内核。使用以下命令删除除最后一个内核之外的所有内核:
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
答案2
cp: failed to extend `/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device
您必须释放该/boot
分区。删除所有旧的未使用的内核。