Uninstall all packages linux

How can I uninstall software?

Seeing there are various ways to install on Ubuntu. What are the various ways to uninstall items? Which ways always work? How can I be sure something was uninstalled?

11 Answers 11

If the application has been installed via the package manager, all you have to do is run

That should always work. If the terminal isn’t what stirs your tea, you could open System → Administration → Synaptic Package Manager, search for the package you want to remove, click on the checkbox next to it and select «mark for removal». Once you click «Apply», the package should be removed. There’s of course also the Ubuntu Software Center. It’s pretty much the same thing as Synaptic. Just search for the application name and click the «Remove» button.

Sometimes applications can be split up into multiple packages (for example, many games have a separate package for their music). To make sure that you uninstall all related packages AND configuration files, you can type

or -in Synaptic- «mark for complete removal» instead of just «mark for removal».

As for applications that have been manually compiled and installed, there’s not always a single way to remove them. The best thing to do is consult the README/INSTALL file that accompanied the source package — if one exists.

In the

Install synaptic

  • Synaptic : the same

A program selected with the option

 sudo apt-get remove && sudo apt-get autoremove 

It’s important to note that when you install things, they often depend on other packages. When you fire off apt-get remove it doesn’t remove the automatically-installed applications by default. This is often safer (if you’re temporarily removing something like ubuntu-desktop) but this can mean you end up with a load of cruft.

aptitude will automatically remove things (as well as having a nice interactive command line interface)

You can also search for cruft in synaptic using the «local or obsolete» filter under the status section.

the apt-get-version can be shorter & easier: sudo apt-get autoremove

+1 for autoremove it looks like that also removes dependencies that were installed along with the original program? nice to keep from cluttering things up.

Читайте также:  Linux поменять владельца папки рекурсивно

To find the package you want to remove, use

Copy the package name and then use command

Here’s a rundown of the possible ways:

If the package has been installed via a package manager, you can remove it with one of the tools provided with this purpose:

  • dpkg —remove : the most basic command-line tool. Avoid.
  • apt-get remove or aptitude remove : these are the standard command-line tools. Aptitude is slightly preferred: it’s a bit more sophisticated. E.g., it can keep a log file of all package operations.
  • synaptic : GUI tool accessible through the GUI menu under «System/Administration». Supports all features, a very nice program generally.
  • software center : even nicer GUI than synaptic . This is a better, updated version of the old «Add/Remove Programs»

All these get the job done. You can start with the most user-friendly (Software Center) and continue to aptitude, if you need certain features or install or remove programs very frequently.

Note that these operations remove the bulk of the program while sometimes leaving «configuration files» in locations such aus /etc/apache2. Most software doesn’t have configuration files there; some server software («daemons») do. In all but a few cases, keeping these configuration files will do no harm. If you want to remove everything, including configuration files, then you can use the «purge» operation. For aptitude, the command line is «aptitude purge.» (Tommy’s explication above of «purge» is not accurate. The «remove» operation, just like «purge», deletes all dependencies that were pulled in with the original program.)

If the program tells you the package has been removed, you can be sure that the files are gone. Sometimes packages installed as a matter of dependency are not removed immediately. They will be eventually deleted, at a subsequent run.

As to software installed from other channels (typically compiled from source), you’re mostly forced to remove the files installed manually. They are often located somewhere in /usr/local . Some software provides shortcuts such as «make uninstall». Don’t count on it, though. More often than not, the cleanest solution is to use the version provided through Ubuntu’s repositories, which can be uninstalled cleanly.

Источник

How to Remove Packages from Ubuntu & Debian

The APT (Advanced Package Tool) is a powerful package management tool for Debian based systems. It provides powerful command-line tool like “apt” or “apt-get”. Which is used to install, upgrade or remove a software package on your Debian system.

Читайте также:  Update mozilla in linux

In this tutorial, you will learn to how to uninstall or remove packages from a Ubuntu or Debian Linux system.

How to Remove Packages via Command Line

You can use “apt” command line tool for removing packages from your system. For older version of operating systems use “apt-get” command with the same options.

Use one of the below options to remove, purge packages from system. Clean the cache files to remove unused software’s from the system.

Using remove option:

To remove a specific package, use the apt remove command:

sudo apt remove [package-name] 

This command prompts apt to scan through the installed applications and attempt to remove or repair any that are broken.

Using purge option:

The default remove command only deletes the software files from the system, but keep all the configuration files for safety purpose. In case of accidental deletion the configuration and data files are safe.

If you want to completely remove all the data, application and configuration files, use –purge option with the above command. like:

sudo apt remove ––purge [package-name] 

Using clean option:

Use this option with apt to delete all the cache files of deleted software from your system.

Also removes the apt package manager cache from system.

Using autoremove option:

Most of the software’s installed the dependent packages on your system. Which you can see during the installation of any software on your system. But they still remains on your system after removing the original package your installed.

With the help of this command, you can remove orphaned dependencies from system

Any users don’t feel comfert with command line can use the graphical interface to remove packages from system.

Uninstall Packages via Graphical Interface

The Desktop users can remove packages using the Ubuntu software center. The Ubuntu software center provides you a graphical interface for installation, update and removal of the packages from system.

Search for the Ubuntu software center under the applications and launch it.

Open Ubuntu Software Center

Go to the installed tab. Here you will find a list of all packages installed on your Ubuntu system. Find your package and click “Remove” button in front of the package name. See below image:

Remove package from Ubuntu

A confirmation dialog will appear here. Again click click to complete deletion.

Delete Software from Ubuntu

You may prompted for a sudo password of your account to complete the package removal process.

Conclusion

This tutorial describes a several ways to remove packages from a Ubuntu Linux systems.

Читайте также:  404 Not Found

Источник

How can I uninstall all the packages I’ve installed today?

I was trying to get musepack encoder support built into ffmpeg today, and I inadvertently broke a few things but I’m not sure exactly which package I installed which broke them. How can I remove ALL packages I installed today, and start again from scratch more carefully? I can see a list of them in «Ubuntu Software Center» under today’s date in the «History», but I don’t want to go through uninstalling them one-by-one, because there are hundreds to do.

3 Answers 3

grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / ' | uniq | xargs apt-get -y remove 

found on commandlinefu worked fine for me

I just tested the grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk ‘/install / ‘ | uniq output, was exactly the packages I installed using apt-get today!! nice script buddy, +1.

E: Could not open lock file /var/lib/dpkg/lock-frontend — open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? even with sudo

The file /var/log/apt/history.log has what you need. Take a look at the answer: How to reinstall many removed packages at once? it’s a more detailed answer.

Disclaimer: Nala is still in a development stage, and is not recommended for any professional use.

For apt packages

If you’re ready to use the command line to install new packages, it’s possible to get an easy undo feature with the more modern apt front-end called nala (for 22.04 you have to enable the «universe» repository). Note: This will only work for apt / .deb packages.

From this point, use nala to install new packages on your system, using:

Leave security updates etc. to the unattended-upgrades package.

Now, when you run the command nala history , you get a list of the commands run with nala, including installed packages. To filter only new installations, use:

nala history | grep install 

An added bonus of the history feature is that you can undo any step in the history, so that you can easily reverse package installation procedures. This can be done by issuing the command:

Where is the ID number of the transaction in the history list you want to undo.

For snap packages

Snap has its own «undo» feature, where you can easily revert to the previously installed version. This is done with:

In case you want to revert to a specific revision of a snap package, this can be stated as well;

sudo snap revert --revision

Источник

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