Uninstalling programs by command line.

Linux has different methods to install programs, you can install from the repositories, either by a package manager or by command line, or by compiling the source code of the program to install. In the same way, and as expected, Linux has different methods for uninstalling packages and programs.

You can uninstall programs from the software center of your distro, or from a terminal. For the first, the method of installing / uninstalling programs depends largely on the software center of the distribution you use, while the second is a fairly simple and consistent procedure within Gnu / Linux systems.

linux-tux-console

The truth, it may be more convenient to uninstall programs from terminal. This is because despite the fact that many still do not feel comfortable working with the command line, it is precisely there where you can see exactly what you are running / installing and in this case, uninstalling from your computer.

To remove a show from your distribution, we will use the same library apt. Run:

sudo apt-get remove

Many times, the application can be derived from multiple packages, as well as generating various configuration files created by the program. Therefore, when executing the above command, only the program is uninstalled, but the rest of the packages and configuration files used by the program are still kept.

To uninstall the program and in turn, delete all the files associated with it within the distro, run:

sudo apt-get --purge remove

So that –Purge on the line, it is in charge of eliminating the files associated with the program that is being uninstalled.

In the case of wanting to uninstall a program without touching the configuration files, you execute the first line, in the event that you want to delete everything, then you execute the second, it all depends on what you want to eliminate.

Removing remaining libraries

When you install a program, it usually asks for permission to install some libraries and dependencies that it needs to be used. At the time of uninstalling the program, these libraries are wandering through your distribution looking for a program to belong to. The truth is that these must also be eliminated

So if you run:

sudo apt-get autoremove

now, all the dependencies that were still there will be uninstalled anyway.

Also, you can combine the actions, and run a single command line:

sudo apt-get purge –auto-remove

For all cases, in the uninstallation process within the terminal it advises which packages will be uninstalled, how much memory space will be freed after installation, and of course, if you agree. After accepting, pressing S, the uninstallation of the program will be completed.

Port

Note: The command apt-get can also be replaced by aptitude, for all executables within the post.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

5 comments, leave yours

Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Ibsebleo said

    Good article! I just think it should be pointed out in the headline this method is only used to uninstall packages in debian / ubuntu and derivatives. Cheers

  2.   TheGuillox said

    Is doing "sudo apt-get remove –purge" the same as just "sudo apt-get purge"?

  3.   Perver said

    Someone tell me how I can add several repositories with a single command and then update and install several programs in the same way?

    I always add a repository, give update, then install the program and so on for each one. I would like to know how I simplify everything with a few commands.

  4.   Walter said

    It remains to add a dash (-) in the last example. Check please.

  5.   albpina said

    I can't uninstall in these ways it tells me: syntactic error near unexpected element `newline '