• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Swift Guides

Howtos, Tutorials & Guides

  • Home
  • Servers
  • Applications
  • Opinions
  • Search
You are here: Home / Servers / Easy Guide to Uninstall or Remove Packages from Ubuntu

Easy Guide to Uninstall or Remove Packages from Ubuntu

May 31, 2024 by Sourabh Verma

When you install a package on Ubuntu, the package manager installs the binary packages with all the other dependencies. In the future, when the package is no longer needed, you should uninstall it because loading the server with unneeded packages will slow down the server. Here is an easy guide to uninstall or remove packages from Ubuntu.

Easy-Guide-to-Uninstall-or-Remove-Packages-from-Ubuntu
Easy-Guide-to-Uninstall-or-Remove-Packages-from-Ubuntu

We will be using the command line (cli) method to uninstall or remove the packages

Prerequisite

  • Ubuntu OS installed with Initial configuration done
  • Root or a sudo user ready

Application management tools installed in Ubuntu are APT, DPKG, and Snap. We will see methods to uninstall or remove packages using these three.

Method 1 – Uninstall Packages with APT

Uninstalling packages using apt is simple. You have to follow the “apt remove” syntax to remove any package.

$ sudo apt remove {Package-name}

For Example

If you want to remove curl using apt, then you can use it as

$ sudo apt remove curl

Always keep in mind, that “apt remove” just removes the packages from the system but keeps the configuration file. In case you want to remove the package along with the configuration file, then you can use “apt purge” syntax

$ sudo apt purge {package-name}

For Example

If you want to completely remove curl with all its configuration files using apt purge, then you can use

$ sudo apt purge curl

You can even clear the package cache using the “apt clean” syntax

$ sudo apt clean

Method 2 – Uninstall Ubuntu Package with DPKG

To remove installed packages using DPKG you can use “dpkg -r” syntax

$ sudo dpkg -r {Package-name}

For Example

If you want to remove curl using DPKG, you can use

$ sudo dpkg -r curl

If you want to remove curl along all its dependencies using DPKG, then you can use

$ sudo dpkg -P {Package-name}

For Example

You want to remove curl along with all its dependencies using DPKG

$ sudo dpkg -P curl

Method 3 – Uninstall Ubuntu Packages with Snap

Snap is the most popular package management tool used in Debian-based Linux distros like Ubuntu. Since Snap contains all the dependencies on its own, you have to remove the package only.

To remove any package using Snap, you can use the syntax “snap remove”

$ sudo snap remove {Package-name}

For Example

If you want to remove curl using snap, then you can use

$ sudo snap remove curl

You can even see the list of installed packages using snap

$ sudo snap list

That’s all for now.

Category: Servers Tagged In: Server, Ubuntu

Like my work? Don't Forget to Share

Share on Facebook Share on Twitter Share on LinkedIn Share on Reddit Share on WhatsApp Share via Email

Hi, welcome to SwiftGuides! With over 12 years of experience in Linux, SysAdmin, databases, cloud computing, and other IT-related areas, I make sure publish easy-to-follow, 100% working tutorials. I hope you like my work. Thanks!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Stay With Us

Follow on Facebook Follow on Twitter Follow on LinkedIn Follow on Reddit Subscribe on YouTube Follow on Instagram

SwiftGuides: Howtos, Tutorials & Guides © 2025 · All Rights Reserved

  • Contact Us
  • Privacy Policy
  • Disclaimer