uninstalling software in debian server

From WebHostingNeeds.com
Jump to: navigation, search

To uninstall, use

apt-get remove PACKAGE_NAME

For example, to uninstall apache

First we list all packages installed on the server with name apache

Toripo01:~# dpkg-query -l 'apache*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                      Version                   Description
+++-=========================-=========================-==================================================================
un  apache-common             <none>                    (no description available)
un  apache-utils              <none>                    (no description available)
un  apache2                   <none>                    (no description available)
un  apache2-common            <none>                    (no description available)
un  apache2-modules           <none>                    (no description available)
un  apache2-mpm-event         <none>                    (no description available)
un  apache2-mpm-itk           <none>                    (no description available)
un  apache2-mpm-perchild      <none>                    (no description available)
ii  apache2-mpm-prefork       2.2.3-4+etch4             Traditional model for Apache HTTPD 2.1
un  apache2-mpm-worker        <none>                    (no description available)
ii  apache2-utils             2.2.3-4+etch4             utility programs for webservers
ii  apache2.2-common          2.2.3-4+etch4             Next generation, scalable, extendable web server
Toripo01:~#

Now let us uninstall apache

Toripo01:~# apt-get remove apache2-mpm-prefork
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  apache2-mpm-prefork libapache2-mod-php5
0 upgraded, 0 newly installed, 2 to remove and 2 not upgraded.
Need to get 0B of archives.
After unpacking 6115kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 23197 files and directories currently installed.)
Removing libapache2-mod-php5 ...
Module php5 disabled; run /etc/init.d/apache2 force-reload to fully disable.
Removing apache2-mpm-prefork ...
Stopping web server (apache2)...apache2: Could not reliably determine the server's fully qualified domain name, using 172.16.4.200 for ServerName
.
Toripo01:~#

Checking again list of software installed.

See apache2-mpm-prefork is no more listed as installed.

Toripo01:~# dpkg-query -l 'apache*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                      Version                   Description
+++-=========================-=========================-==================================================================
un  apache-common             <none>                    (no description available)
un  apache-utils              <none>                    (no description available)
un  apache2                   <none>                    (no description available)
un  apache2-common            <none>                    (no description available)
un  apache2-modules           <none>                    (no description available)
un  apache2-mpm-event         <none>                    (no description available)
un  apache2-mpm-itk           <none>                    (no description available)
un  apache2-mpm-perchild      <none>                    (no description available)
pn  apache2-mpm-prefork       <none>                    (no description available)
un  apache2-mpm-worker        <none>                    (no description available)
ii  apache2-utils             2.2.3-4+etch4             utility programs for webservers
ii  apache2.2-common          2.2.3-4+etch4             Next generation, scalable, extendable web server
Toripo01:~#