Linux software installation and uninstallation Basic tutorial

  

Under Linux is a regular software installation method in addition to binary form of software distribution, as well as source code form of the software package, the following two types of software installation and uninstallation.


Installation and uninstallation of binary distribution packages

The binary distribution of Linux software refers to the distribution form of software packages that have been compiled in binary form beforehand. Easy to use, the disadvantage is the lack of flexibility, if the package is compiled for a specific hardware / operating system
platform, then it can not be executed correctly on another platform or environment.

1, *.rpm binary package

Description: RPM (RedHat Packge Manager) is a package manager from RedHat, which can be easily used in rpm format. The software package is installed, upgraded, uninstalled, verified, and queried. The installation is simple. When uninstalling, the files installed in multiple directories can be deleted. *.rpm is the file name of the package (here *.rpm refers to files with rpm suffix other than *.src.rpm);
rpm common parameters: -ivh: installation shows installation progress [install-- Verbose—hash]-Uvh: upgrade package [Update]; -qpl: list file information in RPM package [Query Package list]; -qpi: list description information of RPM package [Query Package install package(s )];-qf: Find which RPM package the specified file belongs to [Query File]; -Va: Verify all RPM packages, find missing files [View Lost]; -e: Delete package

2, * .tar.gz/*.tgz, *.bz2 binary package

Description: *.tar.gz/*.bz2 binary package is packaged with tar tool, with gzip/bzip2 Compressed, can be unpacked directly during installation. For software that has only a single directory after decompression, use the command “Unlock” rm -rf software directory name”; if the files are scattered in the directory after decompression, you must manually delete them one by one, and you want to know which ones are installed in the system during decompression. For the file, you can get the list with the command <; tar -ztvf *.tar.gz”/“tar -jtvf *.bz2” The parameter z of tar is called gzip decompression, x is unpacking, v is verification, f is the display result, j is the decompression of bzip2, and t is the list of files listing the package.
Installation: tar -zxvf *.tar.gz or tar -jxvf *.bz2 Uninstall: Manually remove

packages that provide installer

This package already provides installation scripts or binaries The installation wizard (setup, install, install.sh, etc.), you only need to run it to complete the installation of the software; and when uninstalling, the anti-installation script or program is provided accordingly. Moreover, the anti-installation function is provided after the software is installed, and currently there are relatively few such types of software packages.

Installation and uninstallation of source code distribution package

The source code distribution of Linux software provides the release form of all program source code of the software, which requires the user to compile the executable binary code and perform it. Installation, compile and install according to the application environment. The configuration is flexible, and it is difficult to remove or retain certain functions/modules at will, and adapt to various hardware/operating system platforms and compilation environments.

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

Description: 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 earlier, the two methods are as follows:

Method 1: rpm -i your-package.src.rpmcd /usr/src/redhat/SPECSrpmbuild -bp your-package.specs #一和你的The package name specs file 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 the parameter makemake instal Method 2: rpm -i you-package.src.rpm cd /usr/src/redhat/SPECS # The first two steps and the same method as rpmbuild -bb your-package.specs #a specs file with the same name as your package In /usr/src/redhat/RPM/i386/(depending on the specific package, it may be i686, noarch, etc.) In this directory, there is a new rpm package, this is a compiled binary file. Rpm -i new-package.rpm can be installed.

2, *.tar.gz/*.tgz, *.bz2 source code package

Description: It is recommended to read the documentation after decompression, you can understand the installation requirements, If necessary, you need to change the compilation configuration. The source code of some packages can be uninstalled with the make uninstall command after compiling and installing. If this function is not provided, the software uninstallation must be manually deleted. Since the software may install the files in multiple directories in the system, it is often difficult to remove them. You should configure them before compilation, and specify the software to be installed to the target path: ./configure --prefix=directory name This way, you can use the “rm -rf software directory name” command to cleanly and completely uninstall. Compared with other installation methods, it is the most difficult to compile and install the user.

Unpack the source package: [root@Mylinux ~]# tar -zxvf zip-2.3-27.tar.gz (or tar -jzxf zip-2.3-27.tar.bz2) into the decompressed source package Directory, install: [root@Mylinux ~]# cd zip-2.3-27[root@Mylinux zip-2.3-27]# ./configure --prefix=.... && make && make Install uninstall source package: [root@Mylinux zip]# make uninstall

Copyright © Windows knowledge All Rights Reserved