6 commands to clean up your Ubuntu system from the terminal

6 commands to clean up your Ubuntu system from the terminal

6 commands to clean up your Ubuntu system from the terminal

https://www.howtogeek.com/6-commands-to-clean-up-your-ubuntu-system-from-the-terminal/

Publish Date: 2026-02-24 10:00:00

Source Domain: www.howtogeek.com

Keeping your computer free of digital clutter is an important part of maintenance, while also making sure you always have space for new files and programs. Here are some simple commands that will let you clean up your Ubuntu system from the terminal, no GUI required—well, with one exception.

Note that in most cases, these commands will work on any Debian-based system. I tested them on both an Ubuntu install, as well as a Linux Mint machine. On both systems, I gained a lot of space, a lot more than I expected, in fact.

Uninstall programs

The first place to start when cleaning up your Ubuntu system is to check the programs you have installed and then remove them. To do so, you’ll need to get a list of everything installed on your system. There are two terminal commands for this, either:

dpkg –list

Or alternatively this one:

apt list –installed

However, I’m not a fan of this approach as you’ll get massive lists you’ll need to scroll through manually, and they include dependencies you may not know the use of. Unless you really know what you’re doing, it’s better to go to your list of installed apps in your GUI. Depending on the system you’re rocking, there are different places for it, but it’s in your software center. Below is what it looks like in Linux Mint.

To remove programs, just either do so via the software center, or enter the following in the terminal:

sudo apt-get…

Source