{"id":666,"date":"2024-07-09T13:40:30","date_gmt":"2024-07-09T13:40:30","guid":{"rendered":"https:\/\/linuxresellerwebhosting.in\/blog\/?p=666"},"modified":"2024-07-09T13:40:30","modified_gmt":"2024-07-09T13:40:30","slug":"remove-package-in-ubuntu-easy-way","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/","title":{"rendered":"Remove Package in Ubuntu:How to Uninstall"},"content":{"rendered":"<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">Remove Package in Ubuntu :During software installation, package managers download and install the main binary package and all the necessary dependencies. Once the application is no longer needed, it is advisable to remove it since its packages take up storage space and may hinder performance.<\/span><\/p>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">This guide teaches you how to uninstall or remove packages in Ubuntu using the command line<\/span><\/p>\n<p class=\"h3\">Prerequisites<\/p>\n<ul>\n<li>Ubuntu installed (this tutorial uses Ubuntu 22.04).<\/li>\n<li>Command-line access.<\/li>\n<li>A user account with\u00a0sudo\u00a0privileges.<\/li>\n<\/ul>\n<h2 id=\"ftoc-heading-1\" class=\"wp-block-heading ftwp-heading\"><span class=\"ez-toc-section\" id=\"Remove_Package_in_Ubuntu_via_CLI\"><\/span>Remove Package in Ubuntu\u00a0via CLI<span class=\"ez-toc-section-end\"><\/span><\/h2><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Remove_Package_in_Ubuntu_via_CLI\" >Remove Package in Ubuntu\u00a0via CLI<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Option_1_Uninstall_Ubuntu_Packages_with_APT\" >Option 1: Uninstall Ubuntu Packages with APT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Completely_Uninstalling_a_Package\" >Completely Uninstalling a Package<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Removing_Unused_Dependencies\" >Removing Unused Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Cleaning_Up\" >Cleaning Up<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Example\" >Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Checking_Installed_Packages\" >Checking Installed Packages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Verifying_Package_Removal\" >Verifying Package Removal<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Removing_PPAs_Personal_Package_Archives\" >Removing PPAs (Personal Package Archives)<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#a_Using_aptitude\" >a. Using aptitude<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/remove-package-in-ubuntu-easy-way\/#Removing_Specific_Versions\" >Removing Specific Versions<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>The default Ubuntu command-line application management tools are APT, DPKG, and Snap. Each utility provides methods for uninstalling and removing software from the system.<\/p>\n<p>Read the sections below for instructions on uninstalling packages using the Ubuntu CLI.<\/p>\n<h3 id=\"ftoc-heading-2\" class=\"wp-block-heading ftwp-heading\"><span class=\"ez-toc-section\" id=\"Option_1_Uninstall_Ubuntu_Packages_with_APT\"><\/span>Option 1: Uninstall Ubuntu Packages with APT<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The APT package manager offers several ways to remove unwanted packages. The most common way to uninstall an app with APT is to use the <strong><code>apt remove<\/code><\/strong> command:<\/p>\n<p>To remove a package but keep its configuration files, use the following command:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md\">\n<pre>sudo apt remove &lt;package_name&gt;<\/pre>\n<div class=\"flex items-center\">\n<h3><span class=\"ez-toc-section\" id=\"Completely_Uninstalling_a_Package\"><\/span>Completely Uninstalling a Package<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To remove a package along with its configuration files, use the following command:<\/p>\n<pre>sudo apt purge &lt;package_name&gt;<\/pre>\n<\/div>\n<\/div>\n<div>\n<h3><span class=\"ez-toc-section\" id=\"Removing_Unused_Dependencies\"><\/span>Removing Unused Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>After uninstalling a package, you might want to remove packages that were installed as dependencies but are no longer needed. Use the following command:<\/p>\n<pre>sudo apt autoremove<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Cleaning_Up\"><\/span>Cleaning Up<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To clean up the local repository of retrieved package files, you can use:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md\">\n<pre>sudo apt clean<\/pre>\n<div class=\"flex items-center\">\n<h3><span class=\"ez-toc-section\" id=\"Example\"><\/span>Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you want to completely remove the package <code>example-package<\/code>, you would run:<\/p>\n<\/div>\n<\/div>\n<pre>sudo apt purge example-package\r\nsudo apt autoremove<\/pre>\n<div><\/div>\n<\/div>\n<div>These commands will ensure that <code>example-package<\/code> and its associated dependencies that are no longer required are removed from your system.<\/div>\n<div><\/div>\n<div>\n<h3><span class=\"ez-toc-section\" id=\"Checking_Installed_Packages\"><\/span>Checking Installed Packages<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To see a list of all installed packages on your system, you can use:<\/p>\n<pre>dpkg --list<\/pre>\n<p>If you want to filter the list by a specific package name, you can use <code>grep<\/code>:<\/p>\n<pre>dpkg --list | grep &lt;package_name&gt;<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Verifying_Package_Removal\"><\/span>Verifying Package Removal<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To verify that a package has been successfully removed, you can use:<\/p>\n<pre>dpkg --list | grep &lt;package_name&gt;<\/pre>\n<p>If the package does not appear in the list, it has been removed.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Removing_PPAs_Personal_Package_Archives\"><\/span>Removing PPAs (Personal Package Archives)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you have installed packages from a PPA and want to remove the PPA, you can use the <code>add-apt-repository<\/code> command. First, list the PPAs:<\/p>\n<pre>ls \/etc\/apt\/sources.list.d\/<\/pre>\n<p>Then, remove the desired PPA:<\/p>\n<pre>sudo add-apt-repository --remove ppa:&lt;ppa_name&gt;<\/pre>\n<p>After removing the PPA, update your package list:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md\">\n<pre>sudo apt update<\/pre>\n<div class=\"flex items-center\"><strong>Advanced Package Management<\/strong><\/div>\n<\/div>\n<div>\n<h4><span class=\"ez-toc-section\" id=\"a_Using_aptitude\"><\/span>a. Using <code>aptitude<\/code><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><code>aptitude<\/code> is an alternative to <code>apt<\/code> that provides more options and a text-based interface. To install <code>aptitude<\/code>:<\/p>\n<pre>sudo apt install aptitude<\/pre>\n<p>You can then use <code>aptitude<\/code> to remove packages:<\/p>\n<pre>sudo aptitude remove &lt;package_name&gt;\r\nsudo aptitude purge &lt;package_name&gt;<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Removing_Specific_Versions\"><\/span>Removing Specific Versions<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>If you need to remove a specific version of a package, use:<\/p>\n<pre>sudo apt remove &lt;package_name&gt;=&lt;version&gt;<\/pre>\n<p class=\"h3\"><strong>Conclusion<\/strong><\/p>\n<p>After reading this article, you should be ready to uninstall or remove packages in Ubuntu. The guide provided detailed instructions for package removal using both the command line and the GUI.<\/p>\n<p>Next, learn how to list all installed packages in Ubuntu.<\/p>\n<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Remove Package in Ubuntu :During software installation, package managers download and install the main binary package and all the necessary<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[1],"tags":[],"class_list":["post-666","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=666"}],"version-history":[{"count":3,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/666\/revisions"}],"predecessor-version":[{"id":862,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/666\/revisions\/862"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}