How to install and uninstall software in Linux RPM tar

Source: Internet
Author: User

To install and uninstall software in a Linux operating system, you only need to install the software. Program (Setup, install, etc.) or use ZIP or other decompressed software to unbind the software and run the anti-installation program (uninstall, unware, and "Uninstall, the graphic operation interface is as simple as clicking "Next" with the mouse. Linux seems to be different. Many Beginners complain that it is very difficult to install and uninstall software in Linux. It is not as intuitive as when using Windows. In fact, installing and uninstalling software in Linux is also very simple. There are also installation wizard or unzipping installation methods. The difference is that in addition to binary software distribution, there are many Source code The software packages distributed in the form are described in detail below:
I. Installation and uninstallation of binary distribution software packages

The binary distribution of Linux software refers to the release form of a compiled binary software package. Its advantage is that it is easy to install and use, and its disadvantage is that it lacks flexibility, if the software package is compiled for a specific hardware/operating system platform, it cannot be correctly executed on another platform or environment.

1. * binary software package in RPM format

Installation: rpm-IVH *. rpm

Uninstall: rpm-e packgename

Note: rpm (RedHat packge manager) is a software package manager provided by RedHat. It can be used to install, upgrade, uninstall, verify, and query software packages in RPM format, it is easy to install, and files installed in multiple directories can be deleted during uninstallation. Therefore, it is recommended that you use RPM software packages as much as possible for beginners. In RPM parameters,-I is the installation,-V is the verification, and-H is the use of hashes to display the installation progress ,*. rpm is the file name of the software package (here *. RPM refers *. SRC. files other than rpm with the suffix "rpm"); parameter-E is the software package to be deleted, and packgename is the software package name, which is different from the file name of the software package, it is often a string in the file name that is located before the version number, for example, the apache-3.1.12-i386.rpm and the apache-devel-3.1.12-i386.rpm are the package file names, whose packages are Apache and APACHE-devel, respectively. For more RPM parameters, see man rpm.

If you do not like to install or uninstall these software packages on the Character interface, you can use graphical software package management programs such as glint and xrpm in X-window, or the kpackge of KDE. You can easily install, upgrade, uninstall, verify, and query the software package by clicking the mouse.

2. Binary packages in the form of * .tar.gz/*. tgz and *. bz2

Installation: Tar zxvf * .tar.gz or tar yxvf *. bz2

Uninstall: manually delete

Note: The binary software package in the form of * .tar.gz/*. bz2 is packaged with the tar tool and compressed with gzip/Bzip2. You can unpack the package directly during installation. For software that only has a single directory after decompression, run the "RM-RF Software Directory Name" command during uninstallation. If the files are scattered in multiple directories, you must manually delete them one by one (a little effort). To know which files are installed in the system during decompression, run the "Tar ztvf * .tar.gz"/"Tar ytvf *. bz2 "to get the list. The tar Parameter Z is to call gzip for decompression, X is to unpack, V is to verify, F is to show the result, Y is to call Bzip2 for decompression, and T is to list the file list of the package. For more parameters, see man tar.

If you prefer graphic operations, you can use KDE's Ark compression file management tool in X-window.

3. provide software packages for the installation program

These software packages provide installation scripts or binary Installation Wizard programs (setup, install, install. sh, etc.), you only need to run it to complete the software installation; while the uninstallation also provides a script or program for reverse installation. For example, sun's StarOffice software suite uses the Setup installer and provides the reverse installation function after the software is installed. Currently, there are few such software packages, because the installation and uninstallation methods are the same as those for Windows software, you do not need to talk about them more.

Ii. SourceCodeInstallation and uninstallation of distribution software packages

The source code distribution of Linux software refers to the release form of the source code of all programs of the software. You need to compile and install the executable binary code on your own. The advantage is that the configuration is flexible, some functions/modules can be removed or retained at will to adapt to a variety of hardware/operating system platforms and compiling environments. The disadvantage is that it is difficult and is generally not suitable for beginners.

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

Note: The rpm -- rebuild *. SRC. RPM command compiles the source code and generates a binary RPM package under/usr/src/Dist/RPMs. then install the Binary Package. Packgename is described above.

2. Source Code packages in the form of * .tar.gz/*. tgz and *. bz2

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

Then go to the decompressed directory:

./Configure Configuration

Make Compilation

Make install Installation

Uninstall: Make uninstall or manually delete

Note: It is recommended that you decompress the package and read the instruction file to learn about the installation requirements and modify the compilation configuration when necessary. The source code of some software packages can be uninstalled by using the make install command after compilation and installation. If this function is not provided, the software must be manually deleted. Because the software may install files in multiple directories of the system, it is often difficult to delete the files, you should configure them before compilation, specify the path to which the software will be installed :. /configure -- prefix = directory name. In this way, you can run the "RM-RF Software Directory Name" command to thoroughly uninstall the directory. Compared with other installation methods, it is the most difficult to compile and install by yourself. It is suitable for users who already have some experience in Linux. It is generally not recommended for beginners.

The installation and uninstallation of Linux software have already been discussed in many cases, but may I still ask whether a tar.gz/bz2 package is a binary file package or a source code package? If you have used a compression tool, you will understand that a package may not be software, it may also be a lot of pictures backed up, or it may be a common package together, the best way to identify what it is to view the file list in the package and use the command tar ztvf * .tar.gz/tar ytvf *. bz2 or use graphical Ark compression file management tools in X-window. Files in the source code package often contain various source code files, header files *. h. c source code *. c, C ++ code source file *. CC /*. CPP and so on; while files in the binary package will have executable files (the same name as the software is usually the main execution file ), the flag is that its path contains a directory named bin (only a few exceptions ). It's so easy. You can't try it now!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.