2

When doing a release upgrade I get the error:

The upgrade has aborted. The upgrade needs a total of 1,279 M free space on disk '/'.

I used to solve this problem by moving the /var/cache/apt directory to my home partition (which has plenty of space), and then making a symlink to it:

sudo mv /var/cache/apt ~/.
sudo ln -s ~/apt /var/cache/apt

This worked up till 16.04. It appears to no longer work in 16.10.

Does anybody know a way to get around this disk space issue without installing from a USB key or uninstalling packages?

  • Note that his is NOT a duplicate of http://askubuntu.com/questions/298487/not-enough-free-disk-space-when-upgrading or http://askubuntu.com/questions/822973/not-enough-free-disk-space-for-software-update, etc. since those posts talk about free space in '/boot' and not '/'. – krumpelstiltskin Oct 14 '16 at 11:26
  • 1
    /etc/apt is not such big folder to help here – Anwar Oct 14 '16 at 11:42
  • @Anwar: sorry, I fixed the typo. – krumpelstiltskin Oct 14 '16 at 11:49
  • You problem is that your disk partition for Ubuntu is way too small, and you're running out of space. Edit your question to include a screenshot of gparted, and I'll see if there's a fix by repartitioning your disk. Cheers, Al – heynnema Oct 14 '16 at 13:21
  • I don't need a bigger partition since I have all the packages I need and there is still 1G of leeway. What I'm looking for is a workaround for the problem of updating the system. I realize that this wouldn't be a problem if I had a bigger '/' partition but my disk is small! – krumpelstiltskin Oct 14 '16 at 13:32
  • Obviously 1G leeway isn't enough, so you'll either have to delete stuff, or repartition. Did you clean up old kernels as @Anwar suggested? And still, if you upload that screenshot that I asked for, maybe I can help further. Cheers, Al – heynnema Oct 14 '16 at 15:11

1 Answers1

2

Update after OPs comment

If moving /var/cache/apt to home doesn't help, check that your home partition has enough space. You can also try removing the extra icon themes you installed. A few icon themes can easily eat upto 1GB+ space these days.

Another option is removing older kernels you're not using. Use this question as a help How do I remove old kernel versions to clean up the boot menu?


/etc/apt is not too big a folder to gain you significant improvement on the disk size. On the other hand, You can try moving the /var/cache/apt folder instead to your home and symlinking it, because that one is used to download all those .deb files.

Using your same commands before, you can do this

sudo mv /var/cache/apt ~/.
sudo ln -s ~/apt /var/cache/apt

Of course, You need to remove the folder /var/cache/apt first after mv-ing.

Anwar
  • 76,649
  • I'm sorry! It was a typo. I meant '/var/cache/apt'. – krumpelstiltskin Oct 14 '16 at 11:49
  • @krumpelstiltskin I've added a few more suggestions. what's your / partition size? – Anwar Oct 14 '16 at 12:09
  • /dev/sda5 17G 15G 990M 94% / /dev/sda7 367G 289G 59G 84% /home – krumpelstiltskin Oct 14 '16 at 12:43
  • oh. 17G is too low for /. Use baobab to check which files/directories are much space. – Anwar Oct 14 '16 at 12:46
  • I'm really just curious in getting a workaround for not having a giant '/' directory. I had a workaround that no longer works :(. – krumpelstiltskin Oct 14 '16 at 12:57
  • @krumpelstiltskin Have you done what I wrote in the answer? icon themes and older kernels? – Anwar Oct 14 '16 at 12:58
  • I've installed the new system by removing some kruft packages etc. But AGAIN: this question is about how to trick the update manager into knowing I have enough space (since I've moved /var/cache/apt to my home directory)! – krumpelstiltskin Oct 18 '16 at 08:23
  • I tried mounting an extra disk at /var/cache/apt. Before and after, the upgrade tool complained about lack of disk space, but after mounting the extra disk, the amount of missing space had decreased from 3-ish to 2-ish G (trying to upgrade 18.04 to 20.04). Looks like /var/cache/apt isn’t the only folder involved, but I have no clue as to whether the extra space outside of it is even temporary at all, and where the extra files get stored. – user149408 Nov 19 '20 at 22:11