How to Remove Software on Ubuntu

Tech reviewed: Deepak Prasad
How to Remove Software on Ubuntu

Ubuntu ships software through several channels—APT .deb packages, Snap, Flatpak, local .deb files, and sometimes tarballs or scripts you dropped in /usr/local. Each channel has its own uninstall command, and using the wrong one leaves binaries, menu entries, or config files behind.

This guide covers every practical way to remove software on Ubuntu: find the real package name, apt remove vs purge, Snap and Flatpak uninstalls, the graphical Ubuntu Software / App Center path, cleaning rc leftovers, and what to do when you installed outside APT. I ran the terminal examples on Ubuntu 25.04 with small packages (sl, cowsay, figlet, hello-world snap) so you can compare your output. Where APT behavior surprised me—autoremove pulling in unrelated tools, figlet staying as rc after remove—the fix is in the same section.

Tested on: Ubuntu 25.04 (Plucky Puffin); kernel 6.14.0-37-generic.

IMPORTANT
Match the uninstall method to how you installed the app. sudo apt remove firefox does nothing if Firefox came from Snap; snap remove does nothing for a plain apt package. When in doubt, check with dpkg -l packagename, snap list, and flatpak list --app.

Quick command summary

Task Command
Remove APT package (keep config) sudo apt remove packagename
Remove APT package + config sudo apt purge packagename
Drop unused dependency packages sudo apt autoremove
Find package owning a command dpkg -S "$(command -v binary)"
List installed APT packages apt list --installed (pipe to grep -i keyword)
Purge rc leftover sudo apt purge packagename or sudo dpkg --purge packagename
Uninstall Snap sudo snap remove snapname
Uninstall Flatpak flatpak uninstall APP_ID
Confirm APT package gone apt-cache policy packagename
Confirm command gone command -v binary (no output if removed)
List rc config leftovers dpkg -l (lines starting with rc)

Choose the removal method first

How it was installed What to run
sudo apt install … or Ubuntu Software (deb) sudo apt purge packagename
sudo apt install ./something.deb sudo apt purge packagename (name inside the .deb, not the filename)
sudo snap install … sudo snap remove snapname
flatpak install … flatpak uninstall APP_ID
Copied binary or make install to /usr/local Delete files manually or run make uninstall if upstream provides it
Language-specific (pip, npm, cargo install) Use that tool's uninstall (pip uninstall, npm uninstall -g, delete ~/.cargo/bin/…)

For stack-specific teardown (Docker, Python interpreters, Yazi, qBittorrent), see the dedicated guides linked in Related uninstall guides at the end.


Find the package name

Menu labels rarely match APT names. Before you remove anything, resolve the real identifier.

If the command still exists

bash
dpkg -S "$(command -v figlet)"

On my host, while figlet was installed:

text
figlet: /usr/bin/figlet

The package name is the part before the colon: figlet. See also dpkg command examples.

Search installed packages

bash
apt list --installed 2>/dev/null | grep -i cowsay
text
cowsay/plucky,now 3.03+dfsg2-8 all [installed]

The name before / is what you pass to apt remove or apt purge.

Search the archive (not yet installed)

bash
apt search '^sl$'

Use apt show sl for a description and dependencies before you remove a metapackage like ubuntu-desktop—purging the wrong name can pull a large tree.

TIP
Tab completion helps: type sudo apt purge and press Tab twice to list installed package names, or dpkg -l | grep -i keyword for a shorter list.

Remove APT packages (apt remove and apt purge)

Most Ubuntu software—CLI tools, libraries, server daemons, and many GUI apps—comes from APT. Use sudo for system-wide packages.

apt remove — drop the program, may keep config

bash
sudo apt remove sl

The summary line shows what will be removed:

text
REMOVING:
  sl

Summary:
  Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 38
  Freed space: 60.4 kB

Afterward, command -v sl printed nothing and dpkg -l sl reported no package—sl has almost no config files, so it disappeared completely.

apt purge — remove program and system config

bash
sudo apt purge figlet

Use purge when you want /etc snippets and dpkg config state gone. For figlet, a plain remove left a residual rc row (removed but config files remain):

text
rc  figlet         2.2.5-3      amd64        Make large character ASCII banners out of ordinary text

rc means "removed, config files still on disk." Finish cleanup with:

bash
sudo apt purge figlet

or sudo dpkg --purge figlet. After purge, dpkg-query: no packages found matching figlet is what you want.

NOTE
apt remove and apt purge do not delete your data under /home. Mail in ~/Mail, browser profiles, and game saves stay unless the app stored them there and you delete the folders yourself.

apt autoremove — clean dependency orphans (read the list)

When you remove a package, APT may suggest dependencies that are "no longer required":

text
The following packages were automatically installed and are no longer required:
  fortunes-min  librecode3
Use 'sudo apt autoremove' to remove them.

Run:

bash
sudo apt autoremove

This one caught me: after removing cowsay, a later autoremove on the same host also removed fzf, ripgrep, zoxide, and xsel because APT had marked them auto-installed and nothing else depended on them anymore—even though I still wanted those CLI tools for other workflows. Always read the REMOVING list before you confirm. For deeper cleanup of caches and orphans, see remove unused packages on Ubuntu.

Wrong package name

bash
sudo apt remove this-package-does-not-exist
text
Error: Unable to locate package this-package-does-not-exist

Double-check spelling and whether the app is a Snap or Flatpak instead.


Remove Snap packages

Snaps are common for desktop apps (Firefox, Chromium, IDE bundles). List them:

bash
snap list

Install and remove a tiny test snap:

bash
sudo snap install hello-world
hello-world
sudo snap remove hello-world
text
hello-world 6.4 from Canonical** installed
Hello World!
hello-world removed (snap data snapshot saved)

A second snap list hello-world reports no matching snaps installed. Wrong names fail clearly:

text
snap "nonexistent-snap-xyz" is not installed

Use the Name column from snap list, not the store title. Some snaps need sudo; others work as your user—if remove fails, retry with sudo snap remove name.


Remove Flatpak applications

Flatpak apps use an Application ID (reverse-DNS), not a short name. List installed apps:

bash
flatpak list --app

Example row on my system:

text
Yazi	io.github.sxyazi.yazi	25.4.8	stable	system

Uninstall by ID:

bash
flatpak uninstall io.github.sxyazi.yazi

Add --delete-data to drop app data under ~/.var/app/. System-wide installs (system) may need sudo flatpak uninstall … depending on how the app was installed.

I did not remove the Flatpak Yazi build here because it is shared with other work on this host; the command above is the standard path from Flathub installs. If flatpak install fails with permission errors in a locked-down environment, fix Flatpak system helper access first—uninstall syntax is still flatpak uninstall APP_ID.


Uninstall from Ubuntu Software (GUI)

On Ubuntu 24.04 and newer, open App Center (or Ubuntu Software on older releases):

  1. Open the store from the dock or Activities search.
  2. Go to Installed (or the manage / library tab).
  3. Find the application.
  4. Click Uninstall or Remove and confirm.

The GUI calls the same backend as the terminal—APT for .deb packages, Snap for snaps. It is the easiest path when you do not know the package name, but it may not list command-line-only tools you installed with apt and no desktop file.

Synaptic (sudo apt install synaptic) is still available for power users: search, mark for Complete Removal (purge), apply.


Remove .deb files and manual installs

Local .deb you installed with apt

bash
sudo apt install ./package.deb

Remove with:

bash
sudo apt purge packagename

Use the package name inside the deb (dpkg -I package.deb | grep Package), not necessarily the file name.

dpkg -r / dpkg -P (low level)

Prefer apt purge for dependency handling. dpkg is appropriate when APT is confused:

bash
sudo dpkg -r packagename    # remove
sudo dpkg -P packagename    # remove + purge config

dpkg -r figlet left the same rc state as apt remove; dpkg -P cleared it.

Manual / compile installs

If you built from source with sudo make install, look for make uninstall in the source tree. Many projects do not ship one—you must remove files listed in the install step, often under /usr/local/bin and /usr/local/share.

AppImages and portable tarballs: delete the file and any .desktop entry you created in ~/.local/share/applications/.


Confirm the software is gone

APT packages

bash
apt-cache policy figlet

While installed:

text
figlet:
  Installed: 2.2.5-3

After purge:

text
figlet:
  Installed: (none)

Commands on PATH

bash
command -v cowsay

No output means the shell cannot find the binary. Some packages split the app across multiple deb names—remove every package from dpkg -S if pieces remain.

List config-only leftovers

bash
dpkg -l | awk '/^rc/ {print $2}'

Purge names you no longer need with sudo apt purge packagename.


Troubleshooting

Symptom Likely cause Fix
Unable to locate package Wrong name or Snap/Flatpak app Check snap list and flatpak list --app
App gone but rc in dpkg -l Used remove not purge sudo apt purge packagename
autoremove dropped tools you still want Packages were auto-installed orphans Reinstall with sudo apt install …; pin or mark manual if needed
Menu icon remains after purge .desktop from Snap/Flatpak/manual install Log out/in; remove stray file in ~/.local/share/applications/
snap remove says not installed Different snap name or revision snap list --all for disabled revisions
Flatpak uninstall cannot find ref Wrong APP_ID Copy ID from flatpak list --app exactly

These pages go deeper when you are removing a full stack, not a single package:


Summary

To remove software on Ubuntu, first identify how it was installed, then use the matching tool: sudo apt purge for APT and Software Center .deb apps, sudo snap remove for snaps, flatpak uninstall APP_ID for Flatpaks, and manual deletion for /usr/local or portable binaries. Use apt remove when you might reinstall and want to keep /etc config; use purge or dpkg --purge to clear rc leftovers. Run apt autoremove only after you read the removal list—it can delete dependency packages you still care about. Confirm with apt-cache policy, command -v, and optionally dpkg -l | awk '/^rc/' for stragglers.

Official background: Ubuntu Help — remove applications and Ask Ubuntu — uninstall software.


Frequently Asked Questions

1. What is the difference between apt remove and apt purge on Ubuntu?

apt remove deletes the program binaries but can leave configuration files marked rc in dpkg. apt purge removes the package and its system configuration files under /etc. Use purge when you do not plan to reinstall the app or you want a clean slate.

2. How do I find the package name before uninstalling on Ubuntu?

Run dpkg -S "$(command -v appname)" if the command is still on PATH, or apt list --installed | grep -i keyword, or apt search keyword. GUI apps are often named differently from the menu label—for example the package may be chromium-browser while the icon says Chromium.

3. How do I uninstall a Snap application on Ubuntu?

List snaps with snap list, then run sudo snap remove packagename. Firefox and other default snaps use the name shown in the first column of snap list, not always the friendly title.

4. How do I uninstall a Flatpak app on Ubuntu?

Run flatpak list --app to see the Application ID in the second column, then flatpak uninstall APP_ID. Example: flatpak uninstall io.github.sxyazi.yazi. Add --delete-data if you also want to drop app data.

5. Will apt autoremove break other software I still use?

It can. autoremove deletes packages APT marked as automatically installed when nothing else depends on them. After removing one app, autoremove might remove tools another program still expects—read the proposed list before confirming, or skip autoremove if you are unsure.

6. How do I remove leftover configuration after apt remove?

Run sudo apt purge packagename on packages showing rc in dpkg -l, or sudo dpkg --purge packagename. You can list leftovers with dpkg -l | awk "/^rc/ {print $2}".

7. How do I uninstall software I installed from a .deb file?

If you installed with sudo apt install ./package.deb, remove it with sudo apt purge packagename—the same as archive packages. If you only ran sudo dpkg -i package.deb, prefer sudo apt purge packagename so dependencies are handled cleanly.

8. Can I uninstall Ubuntu apps from the graphical Software center?

Yes. Open Ubuntu Software or App Center, go to the Installed tab, pick the app, and click Remove or Uninstall. That calls the same APT or Snap backend as the terminal commands—useful when you do not know the package name yet.
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, …

  • Red Hat Certified System Administrator in Red Hat OpenStack
  • Certified Kubernetes Application Developer (CKAD)
  • Red Hat Certified Specialist in Ansible Automation
  • Go (programming language)
  • Python (programming language)
  • DevOps
  • Computer Security