4

I've done a bit of searching, and have come to no perfect answer, so I'm wondering, is there a good way to uninstall (and purge dependencies of) unused applications/programs in my Ubuntu Server install?

When I first installed 16.04, there were a ton of programs that were pre-installed, and I know they're not all useless, but how do I get rid of the ones that I'm never going to use (programs that haven't been used or run for since install)? Because when I use

apt list --installed

there are so many programs that I can't even scroll back far enough to see the first ones.

Any suggestions?

1

1 Answer 1

5

Use an interactive tool that lets you easily get information about a package (its description, its dependencies, what depends on it, …). You can use aptitude in a text terminal. There are also GUI programs for that.

Beware that it's difficult to know whether a package is necessary. Sometimes a package may be used in a way that isn't obvious to the uninitiated. With Linux kernels between 2.6.30 and 3.19, file access times are not saved accurately by default. Even with systems that are set up to save file access times, the information may not be complete, e.g. for files that are access during the early boot before the root partition is mounted read-write (for example, based on access times alone, you'd end up reporting the kernel as unused).

Programs that are installed but not running only hurt if you're short on disk space. Disk space was mildly expensive 20 years ago, but today, installed programs take up a negligible amount in most scenarios, and this does not justify a hunt for unused programs. If you are short on disk space (e.g. on a cheap VPS), you can use the following command to list packages by size:

dpkg-query -W -f='${Installed-Size;8}  ${Package}\n' | sort -n

Programs that are installed and running but not actually used can hurt because use memory or they're a security risk. However, there's no way to determine that automatically, you really have to understand what the program is doing.

You must log in to answer this question.

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