Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of uninstalling apache by linux

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to uninstall apache from linux. I hope you will gain a lot after reading this article. Let's discuss it together.

How does linux uninstall apache?

Method one

The code is as follows:

1.

Root@server ~] # rpm-qa | grep httpd httpd-2.2.3-11.el5_2.centos.4 httpd-manual-2.2.3-11.el5_2.centos.4

Description: rpm-qa | grep httpd command is used to list all httpd-related packages

My above example is the list of rpm packages on which Linux installs apache by default, and the list may be different if it is another version of Linux, but don't worry, whatever it is, uninstall it from the bottom package until the first one is uninstalled.

For example, in this example, we should uninstall the httpd-manual-2.2.3-11.el5_2.centos.4 method first as follows:

The code is as follows:

Rpm-e httpd-manual-2.2.3-11.el5_2.centos.4

(generally speaking, it is not necessary to bring the version number, for example, it can be written directly as rpm-e httpd-manual)

The code is as follows:

Rpm-e httpd-- nodeps

Php and mysql are uninstalled in the same way as apache.

Note: if you can't uninstall when uninstalling, the system will generally prompt for package dependencies and list the names of dependent packages. Uninstall prompted dependent packages first.

If there is a package that cannot be uninstalled, you can add the parameter-nodeps to uninstall it. For example, if we uninstall httpd-manual-2.2.3-11.el5_2.centos.4, it cannot be uninstalled.

Just use:

[root@localhost] # rpm-e httpd-manual-2.2.3-11.el5_2.centos.4-- nodeps

Method two

The code is as follows:

Uninstall the command apache

Sudo apt-get remove apache

Uninstall the association

Sudo apt-get autoremove

Manually delete configuration

Sudo find / usr-name "* apache*"-exec rm-rf {}; sudo find / etc-name "* apache*"-exec rm-rf {}; sudo find / var-name "* apache*"-exec rm-rf {}

Similarly, you can use this method to uninstall other software.

Description: rpm-qa | grep httpd command is used to list all apache-related packages. My example above is the list of rpm packages in which apache is installed by default in Linux AS4.

Description: rpm-e is the command to uninstall the rpm package, followed by the package name, the final version number is not required. Rpm-e xxxx

Note: if you can't uninstall when uninstalling, the system will generally prompt for package dependencies and list the names of dependent packages. Uninstall prompted dependent packages first.

If there is really a package that cannot be uninstalled, you can add the parameter-nodeps to uninstall it. For example, if we uninstall php-4.3.9-3.15, it really cannot be uninstalled.

such as

View the source code printing help

Rpm-e xxx-- nodeps

Notice that it's two.

Description: RPM (RedHat Packge Manager) is a RedHat software package manager, it can be easily used to install, upgrade, uninstall, verify, query and other operations of the rpm form of software packages, and uninstall the software can also be installed in multiple directories to delete clean files, so it is recommended for beginners to use the rpm form of software packages as much as possible.

In the parameters of rpm,-I is the installation,-v is the check,-h is the installation progress with a hash, and * .rpm is the file name of the software package (here * .rpm refers specifically to files other than * .src.rpm with the suffix rpm). The parameter-e is the deleted package, and packgename is the package name, which is different from the file name of the package. It is often the string that precedes the version number in the file name. For example, apache-3.1.12-i386.rpm and apache-devel-3.1.12-i386.rpm are the package file names, and their package names are apache and apache-devel, respectively. For more rpm parameters, please see the man page: man rpm.

If you do not like to install or uninstall these packages under the character interface, you can use graphical package management programs with graphical interfaces such as glint, xrpm, or KDE kpackge under X-Window, so that the installation, upgrade, uninstallation, verification and query of the software package can be easily completed with the click of the mouse.

2. Binary software package in the form of * .tar.gz/*.tgz, * .bz2

Install: tar zxvf * .tar.gz or tar yxvf * .bz2

Uninstalling: manually deletin

Description: the binary package in the form of * .tar.gz / * .bz2 is packaged with tar tools and compressed with gzip/bzip2, and can be unpacked directly during installation. For software with only a single directory after decompression, uninstall with the command "rm-rf software directory name"; if the files are scattered in multiple directories, you must delete them one by one (slightly troublesome). If you want to know which files are installed in the system when unpacking, you can use the command "tar ztvf * .tar.gz" / "tar ytvf * .bz2" to get the list. The parameter z of tar is to call gzip to extract, x is to unpack, v is to check, f is to display the result, y is to call bzip2 to extract, and t is the list of files to list the package.

After reading this article, I believe you have a certain understanding of the method of uninstalling apache from linux. Want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report