I've been using Linux (mainly Ubuntu) for about two years now. I've had several installations on several machines. Something that inevitably happens on any OS installation is that I install something I need that day, maybe a library or CLI utility, use it for a week, and then forget about it.

I'm sure I've got several GB of unused packages taking up space on my installations. How can I clean up my installation to make sure that I only have things that I want?

I'm aware of apt-get autoremove to remove unused dependencies.

I'm aware of apt list --installed to view all packages installed through apt.

I'm aware of dpkg -L to view all files installed from a package.

Suppose I were to look though the output of apt list --installed and remove things I don't want by either apt-get purge or deleting every file from dpkg -L <package>. Eventually, I would have cleaned up everything installed through my package manager, right?

Where else should I look? Not everything on my computer was installed through apt. For example, .deb packages like google-chrome and things installed via scripts. Where would these things live? And what's the best way to find them?

My goal is to shrink my installation down to basically a fresh install plus the things I use all the time.

Thanks, all!

  • .deb packages (like google-chrome) are listed since they utilize the package management to be installed.
    – Krackout
    Commented Aug 8, 2020 at 9:54
  • 1
    A good method to get rid of old program packages, that you no longer use is to make a fresh installation, and then add the [extra] packages that you need, when you need them. I think it can be at least as fast and smooth as uninstalling things that you can hardly remember. Please remember that installing a Linux distro is very fast. - You might keep the home directory for the settings and of course your personal files. I keep the personal files in a 'data' partition, so it is independent of the operating system. It is a good time now right after the release of Ubuntu 20.04.1 LTS.
    – sudodus
    Commented Aug 8, 2020 at 19:33
  • You just need to search for manually installed packages and then purge them.
    – paladin
    Commented Feb 16 at 9:20

1 Answer 1


One method for keeping your machine clean is to install everything you want to test or for a specific purpose inside a docker container (this is what I actually do).

Another method is to test the snap/flatpak/appimage packages. These are bundles with all the libraries they use already included, easy to install, easy to remove and conflict avoidance.

You must log in to answer this question.

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