2

I have ubuntu 18.04, trying to upgrade to 18.10 but disk only has 2,8GB free. I see I have 398MB in var/lib/apt/lists which seems really too much.

I ran sudo apt-get clean but it does literally nothing. Also tried BleachBit but the lists are still there.

What is the right way to clean that? Or maybe shouldn't I do that at all?

Thank you!

Chiara

chiarac
  • 51
  • 4
    Can you please try sudo apt autoremove and see if that helps? You will probably need to reboot once before upgrading. If that works, your question is a probably duplicate of https://askubuntu.com/questions/142926/cant-upgrade-due-to-low-disk-space-on-boot – Tom Brossman Nov 02 '18 at 14:52
  • Hi, thank you for answering! I tried but nothing, it says 0 updated, 0 installed, 0 to be removed – chiarac Nov 04 '18 at 12:05

1 Answers1

0

Don't Delete. These are lists of packages available, if you delete them you won't be able to install anything. Unless you make them again by apt update and then same size of space will be needed.

If you have extra kernels

sudo apt purge $(dpkg -l|egrep 'linux-image-[0-9]|linux-headers-[0-9]'|awk '{print $3,$2}'|grep -v `uname -r|cut -f1,2 -d"-"`|sort -nr|tail -n +4|awk '{ print $2}')

may clear some space.

Vijay
  • 8,056