How good is Pop_OS at cleaning up after itself?

One of the things that always annoyed me about windows was all the orphaned and old files it leaves behind after an update. Slowly but surely it would start to eat at your hd space and you had to find cleaning software to dig it all out. Although it has improved dramatically over the years.

So I'm curious how Pop handles this. Do I need a cleaning program or does it manage old and unused files on its own?

Posted Jun 13, 2021, 1:02 AM UTC

34
mmstickDesktop Engineer•

Package managers on Linux take note of every file that a package installed, and what packages are installed. When you receive an upgrade, the package manager will remove all files that belonged to the installed package before extracting the new files from the new one. This applies globally to virtually every Linux distribution.

There can be some left over configuration files if you removed a package without using the --purge flag, but they're not going to cause any system slow downs or take up much space at all. Some software may have written config files locally if you ran it, but they also aren't going to cause any harm. Temporary files are wiped out by the next boot, if not on shut down.

13
sumthinrandomOP•

Very cool. Thank you for the reply!

2
doc_willis•

something to remember is that in general - the package manager tools do NOT 'clean up' the users home directory.

I see many cases where a person uninstalls a program (say firefox for example ) and then reinstalls it - and expects the program to have totally 'clean' 'back to defaults' settings.. Thats typically not how it works.

Also programs like STEAM and installing programs via WINE - can leave stuff in the users home even after removing steam or wine.

Good Luck.

3
sumthinrandomOP•

That makes sense. Those files are pretty easy to get to and clean up though. My concern was having to dig around in the root structure for random bits in an OS that I still know very little about.

I like to keep things tidy in my systems. It's nice to know I don't have to worry about too much.

2
doc_willis•

compared to windows... its not really an issue. :)

2
curiousguyhere2•

Bleachbit, sudo apt autoremove, sudo apt autoclean

can also clean the old files

Just one thing I observed:

when I did "fresh installation" using the bootable usb, there's one new bootloader being created. I did it for several times, and now I have some extra "Pop!OS" bootloaders should I open up the boot order menu... don't know how to get rid of it.

(clean installation and wipe the drive can do but that's not practical)

1
FictionWorm____•

and now I have some extra "Pop!OS" bootloaders should I open up the boot order menu... don't know how to get rid of it.

The active boot directory is here:

$ sudo ls -l /boot/efi/EFI/

Run,

$ sudo kernelstub -p
....
Root FS UUID:........3b597fc0-e0c6-4a...
....

Check the boot menu for old uuid's with

$ sudo grep -v <your_current_ROOT_FS_uuid> /boot/efi/loader/entries/Pop_OS*.conf

Example output,

$ sudo grep -v "3b597fc0" /boot/efi/loader/entries/Pop_OS*.conf

# /boot/efi/loader/entries/Pop_OS-current.conf:title Pop!_OS
# /boot/efi/loader/entries/Pop_OS-oldkern.conf:title Pop!_OS

If it looks like this then Backup all of /boot and /boot/efi

and remove the /boot/efi/EFI/Pop_OS-uuid directories that do not have the current Root FS UUID: in the name.

1
jedwards8th•

Linux and Pop do a good job cleaning up after itself, but it doesn't clean up after YOU at all.

There's great freedom and power in that, but with great power comes bash chops

4
Xeon-T•

Linux generally does a pretty good job cleaning up after itself compared to windows. The package manager / central software repository model makes this a bit cleaner/easier i think.

There are some apt commands that are useful, for accomplishing some tasks manually.

​

apt remove [package_name]

manually remove a package (config files, etc, will not be removed)

apt purge [package_name]

same as above except that config files will be removed.

apt autoclean

run this to automatically remove no longer useful packages from the package cache

apt autoremove

run this to automatically remove unneeded dependencies (packages that were downloaded because some other program needed them that are no longer necessary).

apt-get check

check is a diagnostic tool, it updates the package cache and checks for broken dependencies.

​ man apt

man apt-get

3
SnillyWead•

apt check shows this: Invalid operation check

2
Xeon-T•

Ah, good catch, it looks like this command is only works with apt-get so: sudo apt-get check

2
SnillyWead•

Yep.

1
derpOmatticPop!_Enthusiast•

How good is Pop_OS at cleaning up after itself?

As pointed out by much more knowledgeable people than myself, Pop, and Linux in general, does a good job of cleaning up after itself. However, you have a part to play in how effective it is also. Any operating system can accumulate unwanted bulk if you let it, or configure it to.

For example, whenever I do a fresh installation of Pop, one of the first things I do is go to Settings> Privacy> File History & Trash and change the default duration from never to 7 days. Same with Trash and Temp, except I do 3 days.

Another good way to prevent unnecessary bulk while you're learning is, to trial or test software on a second old machine that you have no problem with reinstalling if it crashes. If you find a program that works wonderfully and suits your needs, then install it on your "good" machine. My test machine definitely gets filled with all kinds of crud, despite being fresh installed a couple of times every year. The machine I'm typing this on has been upgraded from 18.10 all through to 20.10, and is still fast and stable due to my test machine taking the brunt of my research and testing.

Pop's package manager apt does a great job of cleaning up, but sometimes you have to use autoremove and purge to take it further. Despite apt's success at cleaning up, sometimes things slip through the cracks. I use dpkg-clean to catch leftover configs and orphans. It works a treat.

2
zmaint•

You will need to do a sudo apt autoclean and a flatpak remove --unused from time to time.

0