How to uninstall packages with apt

January 28, 2008

Decorative PictureInstalling packages with apt is generally very easy. Uninstalling (or removing) packages can be slightly more annoying.

The standard command for removing packages with apt is

apt-get remove <package-name>

This should always work as long as

  • The package doesn’t have dependencies
  • The commands needed to remove the package execute correctly.

Note that this leaves all the configuration files in place – so that if you decide to reinstall the packages again at a later date they should be configured exactly as before.

If you want to remove these configuration files for some reason (for example if you’ve completely destroyed them by your editting) then you purge the package instead with:

apt-get --purge remove <package-name>

Things that can go wrong

You don’t know the name of the package

This can be more of a probably than one might at first envisage – and it is definitely annoying when it happens. To find the package name you can use apt-cache, a command for returning information from the local cache of all available packages.

apt-cache search <keyword regex>

searches for all packages in the repository that contain the regular expression in their name of description and returns a list. Performing

apt-cache search <word> | less

and then searching for other relevant words using “/<other-word>” can be a very effective way of finding package names.

If you are getting too many results you might like to try

apt-cache --names-only search <keyword>

which will only search the package name and not the description.

Entry Filed under: Uncategorized. Tags: , , , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Meta

Facets

Add new tag AOP apt aspect oriented programming assumes knowledge autiobiographical bash scripts bell books clarity code samples configuration console emacs for the benefit of google functional programming graphical design hacks higher-order functions howtos intention revealing programming keyboard links linux note to self opinions parsing patterns philosophising philosophizing programming python random ideas refactoring removing packages stories succinct svn systems stuff theoretical philosophizing typing vim viper work ethic you probably don't want to read this

Archives

Pages

 

January 2008
M T W T F S S
« Dec   Feb »
 123456
78910111213
14151617181920
21222324252627
28293031