Basic knowledge
How to Uninstall Installed Software in Linux
Installing and uninstalling Linux software has always been a difficult problem for many new users. In Windows, we can use the software's own installation and uninstallation program or "Add/Remove Programs" in the control panel to achieve. Similar to it, there is a powerful software installation and uninstallation tool under Linux called RPM. It can be used to create, install, query, update, and uninstall software. This tool is used from the command line. Type rpm at the Shell prompt to get help for this command.
software installation
1. Offline installation
There are mainly two different forms of offline installation of software under Linux. The first installation file is named xxx.tar.gz; the other installation file is named xxx.i386.rpm. The software released in the first way is mostly sent in source code form; the second way is sent directly in binary form.
For the first one, the installation method is as follows:
1. First, copy the installation files to your directory. For example, if you are logged in as root, copy the software to /root.
#cp xxx.tar.gz /root
2. Since the file is compressed and packed, it should be decompressed. The command is:
#tar xvzf filename.tar.gz If it is in filename.tar.bz2 format, it should be tar jxvf filename.tar.bz2 to decompress
3. After executing this command, the installation file will be decompressed in the current directory according to the path. Use the ls command to see the decompressed files. Usually in the files generated after decompression, there are "Install" files. This file is a plain text file and details how to install the package.
4. Execute an executable script program named configure generated after decompression. It is used to check whether the system has the library required for compilation, and whether the version of the library meets the needs of compilation and other system information required for installation. Prepare for subsequent compilation work. The command is: #./configure
If you want to install the software to the specified directory, you should use #./configure --prefix=/ to the directory specified by yourself. For example, if I want to install an mlterm into the /opt/mlterm directory, you should enter the following
#./configure --prefix=/opt/mlterm
5. After the check is passed, the MakeFile file for compilation will be generated. At this point, you can start compiling. The compilation process takes different time depending on the size of the software and the performance of the computer. The command is: #make.
6. After successful compilation, type the following command to start the installation:
#make install
7. After the installation is completed, the temporary files generated during the compilation process and the files generated during the configuration process should be cleared. Type the following command:
#make clean
#make distclean
At this point, the software installation is complete.
For the second, the installation method is much simpler.
As in the first method, copy the installation files to your directory. Then use rpm to install the file. The command is as follows:
#rpm -i filename.i386.rpm
rpm will automatically unpack the installation files and install the software to the default directory. And the software installation information is registered in the rpm database. The function of parameter i is to make rpm enter install mode.
Uninstalling the software
1. The uninstallation of the software is mainly carried out using rpm. To uninstall a software, you must first know the name of the software package registered in the system. Type the command:
#rpm -q -a
You can query all the software packages installed in the current system.
2. Once the name of the software to be uninstalled has been determined, the actual uninstallation of the software can begin. Type the command:
#rpm -e [package name]
to uninstall the software. The function of parameter e is to make rpm enter unload mode. Uninstall the package named [package name]. Because there are dependencies among the various software packages in the system. If it cannot be uninstalled due to dependencies, rpm will prompt and stop the uninstallation. You can ignore dependencies and start uninstalling directly with the following command:
#rpm -e [package name] -nodeps
Ignoring the uninstallation of dependencies may make some other software in the system unusable
If you want to know where the rpm package is installed?
Should use #rpm -ql [package name]
3. How to uninstall the software installed with the source code package?
It is best to look at README and INSTALL; in general, it is said, but most software does not provide an uninstall method for the source package; we can find the installation point of the software and delete it. Depends on where you installed it.
for example:
If you install the software, specify a directory. This problem is not difficult;
For example, using the source package to install gaim
#./configure --prefix=/opt/gaim
#make
#make install
If you install mlterm
#./configure --prefix=/opt/mlterm
#make
#make install
The software installed in the source package is specified to be installed in the /opt directory, so that you will know it;
If deleted, delete the corresponding software directory;
Some software needs to execute make uninstall in the decompressed installation directory, so that it is uninstalled.
Second, the yum installation of centos
Yum (full name Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and RedHat and CentOS. Based on RPM package management, it can automatically download and install RPM packages from a specified server, automatically handle dependencies, and install all dependent packages at one time, without having to download and install tediously again and again.
1. Show installed packages
yum list installed
2. Find Installable Packages
yum list tomcat
3. Install the software package (take tomcat as an example)
yum install tomcat
4. Uninstall the package (take tomcat as an example)
yum remove tomcat
5. List dependencies of packages
yum deplist tomcat
6.-y auto answer yes
yum -y install tomcat -- in one go without interruption
7.info Displays the description and summary information of the package
yum info tomcat
8. Upgrade packages
upgrade all packages -- yum update
To upgrade a software package, take upgrading tomcat as an example -- yum update tomcat
Check for updatable programs --yum check-update
9.yum can be installed with a visual graphical interface Yumex
yumex installation -- yum install yumex