Jo *_*ter 6 upgrade partitioning
我目前正在运行 Ubuntu 15.10,但正在尝试升级到 16.04。当我运行时sudo do-release-upgrade,进程中止并显示以下消息:
Not enough free disk space
The upgrade has aborted. The upgrade needs a total of 2,206 M free
space on disk '/var'. Please free at least an additional 4,623 k of
disk space on '/var'. Empty your trash and remove temporary packages
of former installations using 'sudo apt-get clean'.
Run Code Online (Sandbox Code Playgroud)
我试过了,sudo apt-get clean但它并没有显着减少空间,此外,我不太明白为什么会发生这个错误。我的磁盘分区如下所示:
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 787M 9.8M 777M 2% /run
/dev/sda6 26G 14G 11G 58% /
tmpfs 3.9G 233M 3.7G 6% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 923M 8.6M 851M 1% /tmp
/dev/sda3 3.7G 1.4G 2.1G 40% /var
/dev/sda2 78G 47G 28G 63% /home
/dev/sda1 256M 32M 225M 13% /boot/efi
tmpfs 787M 12K 787M 1% /run/user/121
tmpfs 787M 20K 787M 1% /run/user/1000
Run Code Online (Sandbox Code Playgroud)
如果 /var 分区不是安装操作系统的地方,为什么升级程序需要空间?
另外,以防万一,这是 /var 的内部(对我来说看起来很正常):
total 88
drwxr-xr-x 15 root root 4096 Aug 17 2015 .
drwxr-xr-x 23 root root 4096 Feb 4 19:38 ..
drwxr-xr-x 2 root root 4096 Jan 26 19:38 backups
drwxr-xr-x 22 root root 4096 Oct 23 22:24 cache
drwxrwsrwt 2 root whoopsie 4096 Feb 3 22:25 crash
drwxr-xr-x 79 root root 4096 Feb 4 19:38 lib
drwxrwsr-x 2 root staff 4096 Apr 17 2015 local
lrwxrwxrwx 1 root root 9 Aug 16 2015 lock -> /run/lock
drwxrwxr-x 13 root syslog 4096 Feb 4 18:45 log
drwx------ 2 root root 16384 Aug 16 2015 lost+found
drwxrwsr-x 2 root mail 4096 Apr 22 2015 mail
drwxrwsrwt 2 root whoopsie 4096 Apr 22 2015 metrics
drwxr-xr-x 2 root root 4096 Apr 22 2015 opt
lrwxrwxrwx 1 root root 4 Aug 16 2015 run -> /run
drwxr-xr-x 9 root root 4096 Feb 26 2016 spool
drwxrwxrwt 126 root root 20480 Feb 4 20:11 tmp
drwxrwxr-x 2 root plugdev 4096 Sep 3 2013 upek_data
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常感激!
小智 4
如果 /var 分区不是安装操作系统的地方,为什么升级程序需要该分区上的空间?
更新程序需要下载新版本的所有替换 .deb 软件包,然后才能安装它们。它将这些文件存储在 /var/cache/apt/archives 中。
根据您提供的信息,您有一个单独的 /var 分区,只剩下大约 2 GB 的空间。您当前的根分区使用大约 14 GB。即使考虑到不需要在新版本中复制的无关包(例如旧内核等),两者之间的差异也太大了,根据更新程序,大约为 4.6 GB。
如果您没有选择单独的 /var 分区,而只是将 /var 保留在根分区内(看到您有一个相当大的 / 分区),则不会发生此问题。
解决该问题的一种方法是通过从 /dev/sda6 或 /dev/sda2 占用空间来调整(扩大)/var 分区的大小。您必须从实时介质(而不是当前的硬盘驱动器安装)执行此操作,因为您无法在安装分区时对其进行修改。我个人更喜欢使用实时 ubuntu U 盘中的 gparted 工具。
注意:如果您还没有这样做,现在是备份系统的好时机。一旦下载了所需的文件并开始更新,就无法返回到以前的版本,除非您重新安装或有备份来恢复。