Uninstalling Software in Debian Server

To uninstall a software on Debian server, run

apt remove PKG_NAME

Example

uninstall software on debian server

To all installed software with specific name, run

Advertisement

dpkg-query -l PKG_NAME

Example

root@lab:~# dpkg-query -l 'nginx*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version          Architecture Description
+++-==============-================-============-=========================================================
ii  nginx          1.14.2-2+deb10u3 all          small, powerful, scalable web/proxy server
ii  nginx-common   1.14.2-2+deb10u3 all          small, powerful, scalable web/proxy server - common files
un  nginx-doc                        (no description available)
un  nginx-extras                     (no description available)
ii  nginx-full     1.14.2-2+deb10u3 amd64        nginx web/proxy server (standard version)
un  nginx-light                      (no description available)
root@lab:~#

In above list, packages start with

ii = installed
un = currently not installed on the server

When you uninstall a package, it won’t remove all config files, such packages list as uninsalled (un). To completely delete a package, its config file and data, use

apt remove --purge PKG_NAME

Example

apt remove --purge apache2

After removing a software package, you may need to run apt autoremove to remove any unused dependency.

apt autoremove
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement