Linux software installation and uninstallation

Guided reading Linux is a conventional software installation method. In addition to software distribution in binary form, there are also software packages in source code form. The following are the installation and uninstallation methods of the two types of software.
Installation and uninstallation of binary distribution packages

Binary distribution of Linux software refers to the distribution of software packages that have been compiled in binary form in advance. The advantage is that it is easy to install and use, but the disadvantage is that it lacks flexibility. Then it will not execute correctly on another platform or environment.

1. Binary package in the form of *.rpm

Description: RPM (RedHat Package Manager) is a package manager produced by RedHat. It can be used to easily install, upgrade, uninstall, verify, query and other software packages in the form of rpm. The files installed in multiple directories can be deleted cleanly. *.rpm is the file name of the software package (*.rpm here refers specifically to files with the suffix of rpm other than *.src.rpm);

Common parameters of rpm:
-ivh: install show installation progress [install--verbose-hash]
-Uvh: upgrade package [Update];
-qpl: List the file information in the RPM package [Query Package list];
-qpi: List the description information of the RPM package [Query Package install package(s)];
-qf: Find which RPM package the specified file belongs to [Query File];
-Va: Check all RPM packages and find missing files [View Lost];
-e: delete package
2. Binary packages in the form of *.tar.gz/*.tgz and *.bz2

Note: Binary software packages in the form of *.tar.gz/*.bz2 are packaged with the tar tool, compressed with gzip/bzip2, and can be directly unpacked during installation. For software that has only a single directory after decompression, use the command "rm -rf software directory name" when uninstalling; if the files are scattered in the directory after decompression, they must be manually deleted one by one. The list can be obtained with the command "tar -ztvf *.tar.gz"/"tar -jtvf *.bz2". The parameter z of tar is to call gzip to decompress, x is to unpack, v is to check, f is to display the result, j is to call bzip2 to decompress, and t is to list the file list of the package.

Installation: tar -zxvf *.tar.gz or tar -jxvf *.bz2
Uninstall: Manually remove
Packages that provide installers

This type of software package has provided an installation script or binary installation wizard program (setup, install, install.sh, etc.), just run it to complete the installation of the software; and uninstall the corresponding anti-installation script or program. Moreover, it provides the function of uninstalling after the software is installed. At present, there are relatively few software packages of this type.

Installation and uninstallation of source distribution packages

The source code distribution of Linux software provides the release form of all program source codes of the software, which requires users to compile and install executable binary code, and compile and install according to different application environments. The configuration is flexible, some functions/modules can be removed or retained at will, and it is difficult to adapt to a variety of hardware/operating system platforms and compilation environments.

1. Source code package in the form of *.src.rpm
Install: rpm -rebuild *.src.rpm
      cd /usr/src/dist/RPMS
      rpm -ivh *.rpm
Uninstall: rpm -e packgename

Description: The rpm --rebuild *.src.rpm command compiles the source code and generates a binary rpm package under /usr/src/dist/RPMS, and then installs the binary package. packgename As mentioned before, the two methods are as follows:

Method 1:
rpm -i your-package.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bp your-package.specs #A specs file with the same name as your package
cd /usr/src/redhat/BUILD/your-package/ # A directory with the same name as your package
./configure #This step is the same as compiling ordinary source software, you can add parameters
make
make instal
Method 2:
rpm -i you-package.src.rpm cd /usr/src/redhat/SPECS #The first two steps are the same as method one
rpmbuild -bb your-package.specs # a specs file with the same name as your package
At this time, in /usr/src/redhat/RPM/i386/ (according to the specific package, it may be i686, noarch, etc.) In this directory, there is a new rpm package, which is the compiled binary file.
rpm -i new-package.rpm to complete the installation.
2. Source code packages in the form of *.tar.gz/*.tgz and *.bz2
Installation: tar -zxvf *.tar.gz or tar -jxvf *.bz2 First decompress and then enter the decompressed directory:
configure: ./configure  
Compile: make
Install: make install  

Note: It is recommended to read the documentation first after decompression, to understand the requirements for installation, and to change the compilation configuration if necessary. The source code of some software packages can be uninstalled with the make uninstall command after compiling and installing. If this function is not provided, the uninstallation of the software must be manually deleted. Since the software may install files scattered in multiple directories of the system, it is often difficult to delete it cleanly, then you should configure it before compiling, specifying that the software will be installed to the target path: ./configure --prefix=directory name , so you can use the "rm -rf software_dir_name" command for a clean and complete uninstall. Compared with other installation methods, it is the most difficult for users to compile and install by themselves.

Unzip the source package:
[root @ Mylinux ~] # tar -zxvf zip-2.3-27.tar.gz (或者 tar -jzxf zip-2.3-27.tar.bz2
Enter the decompressed source package directory and install it:
[root@Mylinux ~]# cd zip-2.3-27
[root@Mylinux zip-2.3-27]# ./configure --prefix=....    &&   make   && make install
Uninstall the source package:
[root@Mylinux zip]# make uninstall

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326611358&siteId=291194637