Remove program in linux

What is the correct way to completely remove an application?

So, what is the correct way? Is it necessary to use that «*»? After that, I also found these commands:

sudo updatedb sudo locate application sudo rm -rf (file/folder name) 

application* can on occasion give unexpected results — for example, if you have a file in the current directory named application_information , the shell would expand it before it’s passed to apt-get. If this is happening and you do want the literal asterisk, you can use application\* or ‘application*’

application* is even more dangerous where there are no files in the current directory: apt-get uses regular expressions, no glob patterns. People have almost wiped the whole system trying to remove wine* .

Neither application* nor application\* is safe! Quoting * with \ or ‘ ‘ only increases the risk, ensuring * is passed as-is to apt-get (though it usually is anyway!), causes apt-get to interpret the argument as a regex. In a regex * means «zero or more of the preceding character.» A common form of the mistake is to uninstall wine* , removing all packages with win (not wine , win ) anywhere in their names and all packages depending on any of them. See this explanation and possible fixes. @Izkata

9 Answers 9

  • apt-get remove packagename will remove the binaries, but not the configuration or data files of the package packagename . It will also leave dependencies installed with it on installation time untouched.
  • apt-get purge packagename or apt-get remove —purge packagename will remove about everything regarding the package packagename , but not the dependencies installed with it on installation. Both commands are equivalent. Particularly useful when you want to ‘start all over’ with an application because you messed up the configuration. However, it does not remove configuration or data files residing in users home directories, usually in hidden folders there. There is no easy way to get those removed as well.
  • apt-get autoremove removes orphaned packages, i.e. installed packages that used to be installed as an dependency, but aren’t any longer. Use this after removing a package which had installed dependencies you’re no longer interested in.
  • aptitude remove packagename or aptitude purge packagename (likewise) will also attempt to remove other packages which were required by packagename on but are not required by any remaining packages. Note that aptitude only remembers dependency information for packages that it has installed.

And many more exist. Lower-level dpkg -commands can be used (advanced), or GUI tools like Muon, Synaptic, Software Center, etc. There’s no single ‘correct way’ of removing applications or performing other tasks interacting with your package management.

Читайте также:  Linux команда перезагрузки службы

The list you found are just examples. Make sure you understand the meanings and try out what it wants to do before accepting the action (you need to press Y before it actually performs the actions as proposed).

The asterisk version in the question is probably wrong; apt-get accepts a regular expression and not a glob pattern as the shell. So what happens with

sudo apt-get remove application* 
  1. The shell tries to expand application* looking at the files in the current directory. If (as is normally the case) it finds nothing, it returns the glob pattern unaltered (supposing bash with default behavior here — zsh will error out).
  2. apt-get will remove the packages whose name contains a string that satisfies the regular expression application* , that is, applicatio followed by an arbitrary number of n : applicatio , application , applicationn , libapplicatio , etc.
  3. To see how this can be dangerous, try (without root for double safety) apt-get -s remove «wine*» ( -s will simulate the thing instead of doing it) — it will say is going to remove all packages that has «win» in their name and the dependant, almost the entire system.

Probably, the command that was meant is really

 sudo apt-get remove "^application.*" 

(note the quotes and the dot) which will remove all packages whose name starts with application .

are completely outside the scope of the package management. Do not remove files belonging to packages without using the package manager! It will get confused and is the wrong way to do things.

If you don’t know to which package a file belongs, try this:

Источник

4 Ways to Uninstall Software in Linux Mint

Usually, in Linux, there are always several ways to do one thing. For example, to install/uninstall an application, some prefer the use of the terminal, while others stick to a software manager.

It also happens there several ways to uninstall software in Linux Mint. I will show you 4 ways to do that and you will be able to pick your favorite.

  1. The simplest way is to right-click on an application in the main menu.
  2. You can uninstall an application using the software manager.
  3. If you use Synaptic, you can also do it from there.
  4. Finally, you can always go conservative and use the Linux Mint terminal.

The first two options are clearly focused on the novice user, while the last two are for more advanced users. So, let us start.

VIDEO TUTORIAL

1. Using the right-click in the menu

This is the easiest way to uninstall software in Linux Mint. This method is intended for novices and it is the simplest way. I must confess that I have been using Linux Mint for years and I did not know about this feature.

Читайте также:  How to untar linux

So, you have to open the Linux Mint menu and look for a program you want to uninstall. I will be uninstalling GIMP image editor as an example. You right-click on the program and you will see the option to uninstall it.

Uninstall software in Linux mint from the main menu by right-click on a program

After that, you have to type your user password. Then, you need to confirm that you want to uninstall the software. After this, the program will be removed from your system.

Confirm that you want to remove the package in Linux Mint

As you can see, you can uninstall software in Linux Mint can be really quick.

By the way, if you liked this Linux Mint icons, you can read how to install them in these Linux Mint icons and themes post.

2. Using the Software Manager

The second way to uninstall software in Linux Mint is through the Software Manager. So, you open Linux Mint Software Manager.

Open the Software Manager from the Linux Mint menu

Then, search for the program you want to uninstall. Again, I will use GIMP here.

Search for a program to remove using the Linux Mint software manager

Finally, click on the Remove button and it will start the uninstall process.

Remove software in Linux Mint using the Linux Mint software manager

As you can see, this way requires more steps than the previous one, but it may be useful if you are testing different programs and you need to remove a program without leaving the Software Manager.

3. Using Synaptic package manager

Similarly to the previous way, you can uninstall programs on Linux Mint is by using the Synaptic package manager. Synaptic is also a software manager but it is a bit more advanced than the Linux Mint Software Manager.

So, open Synaptic from the main menu.

Open Synaptic package manager from Linux Mint menu

Next, in the search field, type the name of the program you want to remove. Again, in this case, I will remove GIMP. Select the package and right-click on it.

Two options to remove a package in Synaptic

Here, you have two options to uninstall it:

Mark for Removal will just remove a program. Basically, it will do the same what has been done through the Linux Mint menu and through the Software Manager. The second option, Mark for Complete Removal, in addition to removing the program, will also remove all the configuration files in your /etc directory. So, this way you can keep your system clean.

Note that this uninstall does not remove the configuration files from your home directory. If you want to completely get rid of all files associated with a program, you need to remove its config files from your home directory manually. To find these files, unable “Show hidden files” in the view menu of your file manager and search for folders with the program name you want to remove. Usually, they are located right in your home or in ~/.config .

So, for complete removal, choose the Complete removal option and click on the Apply button.

Читайте также:  Linux ntp команда синхронизации

Apply the complete removing of a package in Synaptic

Synaptic will show you a summary of what is going to be done. In my example, you can see many programs will be unchanged and only GIMP will be removed. After you click apply, GIMP will be uninstalled.

The summary of the uninstall changes in Synaptic

4. Using the terminal

Similarly to Synaptic way shown above, you have two options to remove software in Linux Mint using the terminal. Moreover, as you will see below, you can also remove orphan packages using the terminal.

Standard way

So, the most common and standard way is with this command:

sudo apt-get remove package_name 

And this will be equivalent to the simple remove option in Synaptic. That is it will remove the package but not its configuration files in /etc .

Completely remove (advanced)

However, if you want to completely remove the program you can use the command purge instead of remove .

sudo apt-get purge package_name 

And this will be equivalent to the Complete Removal in Synaptic — it will remove the package and the configuration files located in /etc .

Complete uninstall software in Linux Mint using the terminal

Both the purge and remove commands will show you a summary of what is going to be removed. Read it carefully and confirm if you agree to remove listed packages. Be careful here because sometime purge may remove important programs as dependencies.

Remove orphan packages

Finally, using the terminal, you can also remove orphan packages using the following command.

You can delete the orphan packages using the terminal

And if you want to remove the GIMP configuration files from your home directory, you can also remove them from the command line.

Now all GIMP files are removed.

As you can see the command line way is even more advanced because you are given more flexibility and more options here. For example, we did not see any autoremove option before when we tried to remove through the Linux Mint menu, through the Software Manager, and in the Synaptic package manager.

Conclusion

In Linux, there are always different ways to do the same thing and it is nice because each of these options fits certain users. The different ways to uninstall software in Linux Mint proves it. Some are ideal for newbies whereas others are better for more powerful users.

If you know more ways to uninstall programs on Linux Mint, please leave a comment below.

If you liked this Linux Mint there, you can find how to configure it in this Linux Mint themes post. There are also a list of thing you can do after installing Linux Mint.

Average Linux UserFollow I am the founder of the Average Linux User project, which is a hobby I work on at night. During the day I am a scientist who uses computers to analyze genetic data.

Источник

Оцените статью
Adblock
detector