Uninstalling packages in linux

How can you completely remove a package?

I am trying to do a clean install of the octave3.2 package. To do this, I removed it, then tried to reinstall it. When I reinstalled, an error occurred. It could be a bug in the package, but I want to make sure I have everything removed so that I can do a clean install. Is it enough to do this?

sudo apt-get --purge remove octave3.2 

10 Answers 10

This is a very general answer to the question about the effects of purging packages. For advice specific to your situation, you’ll have to edit your question to include additional information—in particular, the complete and exact text of the error message you are getting.

Removing packages with sudo apt purge . or sudo apt —purge remove . will remove them and all their global (i.e., systemwide) configuration files. This is usually what people mean when they talk about completely removing a package.

But that doesn’t mean your system is the same as it was before the package was installed. In particular:

  • This does not remove packages that were installed as dependencies, when you installed the package you’re now removing. Assuming those packages aren’t dependencies of any other packages, and that you haven’t marked them as manually installed, you can remove the dependencies with sudo apt autoremove or (if you want to delete their systemwide configuration files too) sudo apt —purge autoremove .
  • This does not remove non-systemwide configuration files. Specifically, it does not remove user-specific configuration:
    • It does not remove the configuration files and directories located in users’ home directories (or in the .config subdirectory of their home directories), created by the software the package provides.
      • If these files/folders are not stored in .config , they usually start with a . themselves. Either way, you can see them with ls by using the -a or -A flag, and you can see them in Nautilus and most other file browsers/managers by pressing Ctrl + H or going to View >Show Hidden Files.

      Источник

      Ubuntu Uninstall Package Tutorial

      In the following Ubuntu uninstall package tutorial, we’ll take you through the step by step instructions for uninstalling a package on Ubuntu from both GUI and command line. We’ll also show you options for deleting or keeping the configuration files that are associated with a package. Use whichever method below that you find most convenient for your situation.

      If there’s software on your Ubuntu Linux system that you wish to remove, there are a few ways to go about uninstalling the associated packages. Since Ubuntu can install packages through apt or through Snap, there are also two ways for removing these. Then again, the GUI method can remove both. We’ll cover all methods below.

      In this tutorial you will learn how to:

      • Uninstall a package via GNOME GUI
      • Remove a package via command line
      • Use snap command to uninstall a snap package
      • Remove unused packages

      Ubuntu uninstall package Tutorial

      Software Requirements and Linux Command Line Conventions
      Category Requirements, Conventions or Software Version Used
      System Ubuntu Linux
      Software N/A
      Other Privileged access to your Linux system as root or via the sudo command.
      Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
      $ – requires given linux commands to be executed as a regular non-privileged user

      Uninstall a package via GNOME GUI

      The default desktop environment for Ubuntu is GNOME. Thus, these instructions and screenshots will be specifically tailored to those running GNOME. If you’re using a different desktop environment, the process should be quite similar but the menus will look a little different.

        Open the “Ubuntu Software” application from GNOME’s app launcher.

      Locate the Ubuntu Software utility

      Use this menu to remove any listed package

      Note that the Ubuntu Software app typically only lists applications that were installed via GUI or apps that have a GUI themselves. You also can’t remove system applications from this menu. For more advanced control over all the packages on your system, it’s recommended to use the command line approach covered below.

      Uninstall a package via command line

      There are actually three different commands that can be used to uninstall a package from Ubuntu. Two of those are apt and apt-get, and the other one is dpkg. Opting to use apt for removing packages is the most recommended approach, but for the sake of completeness, we’ll cover all methods.

        First, you’ll need to know the name of the package you want to remove. Use one of the commands below to get a list of all the packages on your system. Pipe to grep if you have some idea of how the package might be named.

      $ sudo apt remove package-name OR $ sudo apt-get remove package-name OR $ sudo dpkg -r package-name
      $ sudo apt purge package-name OR $ sudo apt-get purge package-name OR $ sudo dpkg -P package-name

      Uninstalling a package on Ubuntu

      Uninstall a Snap package

      The Snap package manager is somewhat new but it’s part of all newer versions of Ubuntu. It works independently of apt, so uninstalling software that was installed as a Snap package will require a separate command.

        To see a list of installed Snap packages on your system, execute the following command in terminal.

      $ sudo snap remove package-name

      Uninstall unused packages

      While installing some software, your package manager may download dependencies that are required to install a package properly. When it finishes installing a package, these dependencies will linger on your system but be unused. Therefore, it’s recommended to run the following command occasionally to remove any unused packages from your system.

      Conclusion

      In this tutorial, we learned how to uninstall a package in Ubuntu from both GUI and command line. The GUI method can be more convenient for some users but its power pales in comparison to the command line method. For the command line, it’s recommended that you stick to the apt command, as apt-get is more for system scripts and dpkg doesn’t handle dependencies as well as apt does.

      Источник

      How to uninstall package on Ubuntu

      Are you a new Ubuntu user and facing storage problems and want to delete unnecessary packages then you are in the right place. Ubuntu allows you to install and uninstall the package by both graphical user interface and command line interface.

      A “package” is a compressed file archive that contains all of the files that come with a given application in Linux distributions. New software for Linux-based PCs is delivered and maintained by a package. Executable installers are used in the same way as executable installers are used on Windows-based machines.

      In this article two ways to uninstall a package from the Ubuntu system are discussed. You can follow any of the two according to your requirements.

      Uninstalling Package Using Software Center of Ubuntu

      Software center is like the App store of Apple and allows you to install and uninstall packages. If you are a new user and find the command line difficult then you can uninstall the package through the software center if it’s installed by Ubuntu software center.

      Step 1: Open Ubuntu Software Center
      Click on icon of Software Center from the list of icons on left side of Ubuntu screen:

      Step 2: Open installed apps
      Click on installed tab on Ubuntu software center:

      Step 3: Remove Package/App
      Now you can remove any package which is present in installed packages of Ubuntu software center. I am removing Document Scanner from installed packages by clicking on the “Remove” button in front of package to be removed:

      A dialogue box will appear, click on Remove:

      Uninstalling Package on Ubuntu Using Command Line

      Some installed packages are not available in “installed packages” of Ubuntu software center so we can remove them using the terminal. There are three ways to remove package using command Line:

      Uninstalling Package using “apt” : The best way is to use the “apt” command to remove packages.

      The apt( Advance Packaging Tool) is the default package manager of Ubuntu.

      Set the package-name which you want to remove.

      Example: Run the below mentioned command to remove “nodejs” package from Ubuntu system:

      In place of “nodejs” write the name of the package you want to remove.

      Uninstalling Package Using “dpkg”: We can also remove package from system using dpkg command, dpkg is a Debian package manager that allows you to install, build, uninstall, and manage packages:

      Change “package-name” according to your requirement.

      Example: Run the below mentioned command to remove “make” package from Ubuntu system:

      In place of “make” write the name of the package you want to remove.

      Uninstalling Package using “snap”: Although the Snap package manager is very new, it is included in all current Ubuntu editions. To uninstall packages, which were installed as snap packages you need to run the snap command which works independent of apt command. The syntax is given below:

      Set “package-name” which you want to remove.

      Example: Run the below mentioned command to remove “rocketchat-server” package (which is installed as snap package) from Ubuntu system:

      In place of “rocketchat-server” write the name of the package you want to remove.

      Uninstalling unnecessary Packages : Your package management may download dependencies that are required to correctly install a package while installing some software. These dependencies will remain on your system after it finishes installing a package, but they will be unused. As a result, it’s a good idea to run the following command on a regular basis to clear out any unwanted packages from your system.

      Run the below mentioned command to remove unused packages:

      Conclusion

      To free up the space occupied by some unused packages, Ubuntu allows you to remove these unnecessary packages from your system. In this article we discussed in detail how to uninstall unwanted packages using the Ubuntu software center and using the command line in which commands are discussed to remove packages from the system; using apt, dpkg and snap. Read the article carefully to uninstall unnecessary packages from your Ubuntu system.

      About the author

      Alishba Iftikhar

      I am currently an undergraduate student in my 1st year. I am an internee author with Linuxhint and loved learning the art of technical content writing from senior authors. I am looking forward to opting my career as a full time Linux writer after I graduate.

      Источник

      Читайте также:  Настройка thunderbird в линукс
Оцените статью
Adblock
detector