Install and remove software with apt

On Debian and Ubuntu, apt is the package manager you should prefer over random installers. It tracks files so you can remove them later and it receives security updates.

Search and install

apt search htop
apt show htop
sudo apt install htop

apt show tells you the package is from Ubuntu/Debian, not from a random PPA. Read the description before you install.

Remove vs purge

sudo apt remove htop
sudo apt purge htop
sudo apt autoremove

remove deletes the program and leaves config. purge also drops config in /etc. autoremove deletes unused libraries left behind. Run it after big desktop removals; it can also remove old kernels, which is what you want if / is tight — see Disk is full.

Snaps and Flatpaks

Ubuntu may install some apps as snaps. They update separately and can use a lot of disk. That is not “apt is broken”; it is a second store. Flatpak is another. Know which one you used when something “will not uninstall.”

Do not make a habit of curl | bash

Vendor install scripts can work. They can also add a repo with a signing key you never review. Prefer:

  • An official .deb that uses apt afterward, or
  • A distro package, or
  • A documented repo with HTTPS and a pinned key.

If you did add a bad PPA, remove the file in /etc/apt/sources.list.d/, then sudo apt update.