0

I can't upgrade from 18.04 to 20.04 because I don't have enough free space. Is there a tool that could :

  • list all packages currently installed
  • check if they exist for 20.04, if so
  • uninstall them,
  • upgrade system,
  • then reinstall them

?

I got 1.5 gb free on / and 1gb on /home, installation wants 4gb more.

4
  • 1
    The entire system is really nothing but packages. This is essentially what the upgrade does, except it doesn't remove packages. You could do this yourself though. How much free space do you have? What's the total capacity of the partition where / is located?
    – Nmath
    Mar 31, 2022 at 22:03
  • 2
    You are making a Well Known Error: Applying a "solution" before diagnosing the problem. Don't do that.
    – waltinator
    Mar 31, 2022 at 23:05
  • Assuming that you haven't collected too much junk, the most common way to fix this is to re-partition your drive. Edit your question and show me a screenshot of gparted. Start comments to me with @heynnema or I'll miss them.
    – heynnema
    Mar 31, 2022 at 23:31
  • > The entire system is really nothing but packages There are packages and packages. You can remove Inkscape, Gimp, Open Office without too much trouble. Remove libc is more problematic.
    – v1nce
    Apr 1, 2022 at 8:22

1 Answer 1

0

Indeed, an update temporarily requires more room than the final installed operating system.

There are tools that do all you want: the APT tools (apt, apt-get. the lower level tools dpkg, etc.). What you intend to to, is the complicated way. There are a few more easy ways to release some space. Take your pick below: it will be sufficient to release one or a few gigabytes to be able to upgrade.

  • Clear cached installation files and remove all packages that are not anymore needed.

    sudo apt clean;  sudo apt autoremove
    
  • Reduce the size of log files: reduce the log of systemd and other system logs:

    sudo journalctl --vacuum-size=50M
    sudo rm -v /var/log/*.log* /var/log/syslog*
    
  • Remove any applications you installed yourself and reinstall them after the upgrade. Their system wide and user settings will be preserved after the reinstall.

  • If you do not have a separate partition for /home, then just deleting the contents of your ~/.cache directory may release several gigabytes of data. These data are automatically recreated when needed. If that is not enough, move your user documents, moves, etc out and put them back after install. If that still is not enough, you may move your entire home folder (/home/yourlogin) out, including hidden files. In that case, make sure your backup preserves the ownership and permissions of the files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .