So spent the afternoon simply trying to upgrade from Ubuntu 18.04 to 20.04
using the following command
sudo update-manager -c -dBut repeatedly get the following error popup when the installation is half complete
Not enough free disk space
The upgrade has aborted. The upgrade needs a total of 4,520 M free space on disk '/'. Please free at least an additional 3,510 M of disk space on '/'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.I've gone thru all the usual steps to free up space including removing ALL but necessary linux kernels et. Search and found a similar 3 year old question hereCan't update ubuntu - not enough free disk space
This is the result of a $df command
Filesystem 1K-blocks Used Available Use% Mounted on
udev 32870524 0 32870524 0% /dev
tmpfs 6588324 2076 6586248 1% /run
/dev/sda2 41153856 38030268 1010052 98% /
tmpfs 32941612 0 32941612 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 32941612 0 32941612 0% /sys/fs/cgroup
/dev/loop0 56320 56320 0 100% /snap/core18/1705
/dev/nvme1n1p1 491209736 71596 466116444 1% /mnt/xxxxxxxxxxxx
/dev/loop1 114432 114432 0 100% /snap/cmake/340
/dev/loop2 116992 116992 0 100% /snap/cmake/283
/dev/loop3 56320 56320 0 100% /snap/core18/1754
/dev/loop4 56064 56064 0 100% /snap/core18/1668
/dev/sda1 562084 7324 554760 2% /boot/efi
/dev/loop5 114432 114432 0 100% /snap/cmake/323
/dev/sda3 660427896 538425036 88432044 86% /home
tmpfs 6588320 52 6588268 1% /run/user/1000Can any experienced linux users suggest what steps i should take next? Thanks and regards
11 Answer
friend. You can try some things to free a bit (or a lot) of space from the / partition. Let's see in order of potential benefit:
1. (Re)move the swapfile
It seems your installation doesn't include a swap partition and is probably using a swapfile for memory swap. The default location for it is /swapfile, occupying many gigabytes of space in your small system partition. You could:
- disable the swap and remove the swapfile temporarily during the upgrade;
- move the swapfile to another partition (ex.:
/home) with more free space; - shrink the
/homepartition and create a swap partition to substitute the swapfile.
Search the internet for how to do this.
2. Uninstall large unused packages
You could search for packages that you installed manually but doesn't need anymore, or even just uninstall some large packages temporarily and reinstall after the upgrade.
Here is a command to list the 20 installed packages in Debian-based systems that use most disk space:
$ dpkg-query -Wf '${Installed-Size}\t${db:Status-Abbrev} ${Package}\n' | grep 'ii ' | sort -n | tail -n 20If you don't recognize a particular package, which is probably a dependence for other important package, you can investigate with:
apt rdepends --installed <package-name>Be careful to only remove manually installed packages/dependencies!
3. Clean up packages
As a last resource, run these two commands:
$ sudo apt autoremove --purge
$ sudo apt autoclean