0

Something's eating up file system space so I'm trying to clean up. I was also considering upgrading to 22.04.1 but I'm not sure having looked through this site. Right now I don't have enough free space (811.7MB) for the upgrade to run.

Output from du -sh /* showed that /snap was 22G so I had a look at it:

4.5K /snap/bare
4.0K /snap/bin
315M /snap/chromium
692M /snap/core
339M /snap/core18
396M /snap/core20
1.3G /snap/gnome-3-28-1804
1.7G /snap/gnome-3-34-1804
2.0G /snap/gnome-3-38-2004
19M /snap/gnome-system-monitor
427K /snap/gtk2-common-themes
726M /snap/gtk-common-themes
2.3G /snap/kde-frameworks-5-96-qt-5-15-5-core20
963M /snap/kde-frameworks-5-qt-5-14-core18
2.2G /snap/kde-frameworks-5-qt-5-15-3-core20
1.1G /snap/kde-frameworks-5-qt-5-15-core20
5.5G /snap/libreoffice
460M /snap/phatch-gui
4.0K /snap/README
337M /snap/snapd
312M /snap/snap-store
152M /snap/video-downloader
1.1G /snap/vlc

Is it safe to get rid of the files I've bolded? I had some difficulties upgrading from 18.04 to 20.04 after I got my laptop so it's probably my fault that there are files hanging around.

Are there any other files I should look for?

Thanks!

1 Answer 1

1

It is never safe to get rid of system files simply by "getting rid of them", i.e., deleting them directly.

To temporarily gain space on the system partition, use the dedicated tools to remove system files.

Snap

If you want to temporarily remove space occupied by snaps, it would be safe to use the dedicated tools to remove components.

  • Use snap list to see all installed snaps.
  • Use snap remove <snap package> to remove all packages

Then, more space can be gained by removing the "snapshots", i.e., archives of configuration data of previous versions.

  • snap saved will show any snapshots currently saved.
  • snap forget <nr> where <nr> is the number of the set (first column in previous command) will remove that set.

The snapshots cannot be restored, but you typically will not need that. The snap applications can be easily reinstalled.

Temporary space could also be obtained by other cleanup operations:

Remove archived installation files

sudo apt clean will remove all downloaded .deb installation files.

The system will download these again if needed in the future

Remove some large packages

sudo apt remove <package>: you can temporarily remove some larger applications such as libreoffice or gimp to gain quite some free space. Doing so, your user configuration is preserved. When you later reinstall them, they will look and behave as you last closed them.

Applications removed by the package manager are easily reinstalled using the package manager

Clean unused dependencies

sudo apt autoremove will remove all automatically installed packages that are not anymore dependent on any manually installed package, including these of the packages you temporarily removed. This may liberate quite some space.

The system will automatically reinstall these if they are ever needed by a package you install in the future

3
  • snap list gives me the same list as above with the exception of /snap/bin and /snap/README. Wouldn't snap remove then get rid of the system files I was asking about (1804) as well as the newer ones (2004). Would I be able to reboot without those files?
    – Rosalyn
    Aug 31, 2022 at 16:01
  • Sorry, I think I misread the information on the remove command. It looks like the snap to be removed should be specified so I can remove the entries in bold from my original list one at a time and that would be the safe way to do it? Thanks.
    – Rosalyn
    Aug 31, 2022 at 16:18
  • Yes, you should remove one by one. There was a misformatting which might have put you on the wrong food. Your system will work perfectly fine, even with snap removed, fully removed, however in the latter case there will be no software store, and in 22.04, there will be no browser. So it is better you just leave Firefox there.
    – vanadium
    Aug 31, 2022 at 19:25

You must log in to answer this question.

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