![升级至新发行版](https://linux22.com/image/990410/%E5%8D%87%E7%BA%A7%E8%87%B3%E6%96%B0%E5%8F%91%E8%A1%8C%E7%89%88.png)
我正在使用 Ubuntu 15.10,并尝试升级到较新的发行版。尝试升级时出现以下错误:
Not enough free disk space
The upgrade has aborted. The upgrade needs a total of 1,134 M free
space on disk '/var'. Please free at least an additional 896 M of
disk space on '/var'. Empty your trash and remove temporary packages
of former installations using 'sudo apt-get clean'.
Not enough free disk space
The upgrade has aborted. The upgrade needs a total of 873 M free
space on disk '/usr'. Please free at least an additional 11.3 M of
disk space on '/usr'. Empty your trash and remove temporary packages
of former installations using 'sudo apt-get clean'.
我的df -h
样子是这样的:
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 784M 9.8M 774M 2% /run
/dev/sdb6 19G 505M 17G 3% /
/dev/sdb9 5.4G 4.3G 823M 85% /usr
tmpfs 3.9G 26M 3.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sdb10 2.7G 86M 2.5G 4% /usr/local
/dev/sdb13 1.9G 2.9M 1.7G 1% /srv
/dev/sdb14 1.9G 2.9M 1.7G 1% /opt
/dev/sdb7 227M 60M 151M 29% /boot
/dev/sdb1 496M 38M 459M 8% /boot/efi
/dev/sdb11 1.9G 27M 1.7G 2% /tmp
/dev/sdb12 1.9G 1.5G 275M 85% /var
/dev/sdb15 144G 25G 112G 19% /home
cgmfs 100K 0 100K 0% /run/cgmanager/fs
tmpfs 784M 48K 784M 1% /run/user/1000
虽然这里的大部分解决方案似乎都指向 /boot 已满的问题,但我认为我的问题不一样。当我运行 时ls /boot
,我得到:
abi-4.2.0-36-generic memtest86+.bin
config-4.2.0-36-generic memtest86+.elf
efi memtest86+_multiboot.bin
grub System.map-4.2.0-36-generic
initrd.img-4.2.0-36-generic vmlinuz-4.2.0-36-generic
lost+found vmlinuz-4.2.0-36-generic.efi.signed
因此我认为我不能删除这里的任何其他内容。
我尝试了各种其他解决方案sudo apt-get clean
,sudo apt-get autoremove
但似乎都不起作用。我该如何解决这个问题?
答案1
通过移出内容来释放 /var 中的空间,或者将所有 var 移至根文件系统 (root fs)...
$ sudo -i
# cd /
# mkdir var2
# cp -av var var2
# mv var var-orig
# mv var2 var
# vi /etc/fstab # and comment out the /var entry....
# reboot
...最后...
# do-release-upgrade
请注意,您原来的 var fs 现在未被使用并且可以被回收,但这是另一个讨论...:)