Installation and uninstallation of Linux software packages

Source: Internet
Author: User
Tags bz2

Here are two scenarios: Binary package and source code package.

First, Linux BinaryInstallation and uninstallation of distribution packages

Binary distribution of Linux software refers to the release form of a pre-compiled binary form of the package, the advantage is that the installation is easy to use, the disadvantage is the lack of flexibility, if the package is compiled for a specific hardware/operating system platform, then he can not be in another platform or environment to execute correctly.

1, *.rpm form of binary package

Installation: Rpm-ivh *.rpm
Uninstall: Rpm-epackgename
Description

RPM (RedHat Packge Manager) is a software package manager from RedHat, which allows easy installation, upgrade, uninstallation, verification, query, and so on in the form of RPM packages, easy to install, It is also possible to remove clean documents that are installed in multiple directories while uninstalling, so it is recommended that beginners use the RPM-style packages as much as they can.

RPM parameters in the-I is installed,-V is the check,-H is a hash to display the installation progress, *.rpm is the document name of the package (here *.rpm refers to *.src.rpm other than the RPM-based document); The parameter-E is the delete package, Packgename is The package name , which is distinguished from the document name of the package, is often the string in the document name that precedes the version number, For example, apache-3.1.12-i386.rpm and apache-devel-3.1.12-i386.rpm are package document names, and their package names are Apache and Apache-devel, respectively. For more RPM parameters, refer to the man rpm page:

If you do not like to install or uninstall these packages under the character interface, you can use the package management program of the image interface under X-window, such as glint, xrpm, or KDE kpackge, to install, upgrade, uninstall, Verification and query can be done easily by clicking the mouse.

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

Installation: Tar-zxvf*.tar.gz or tar-yxvf*.bz2
Uninstall: Delete manually
Note: Binary packages in *.tar.gz/*.bz2 form are packaged with the TAR tool, compressed with GZIP/BZIP2, and unpacked directly when installed. For only a single directory after decompression software, uninstall with the command "RM-RF software directory Name"; If the unpacked documents scattered in multiple directories, it must be one by one manual removal (slightly troublesome), you want to know what documents are installed to the system when extracting, can use the command "TAR-ZTVF *.tar.gz"/" TAR-YTVF *.bz2 "Get the list. The tar parameter z is called gzip decompression, X is unpacked, V is checksum, F is the display result, Y is called bzip2 decompression, and T is the list of documents listing the package. For more parameters Please refer to man tar.

If you prefer the operation of the image interface, you can use KDE's Ark compressed file management tool under X-window.

3. Software packages for installing programs

Such packages already provide installation scripts or binary Setup wizards (Setup, install, install.sh, etc.) that can be installed by running the software, and also provide an anti-installation script or program when uninstalled. For example, Sun's StarOffice Office software suite uses an installer called Setup, and provides anti-installation functionality after the software is installed, and now this type of package is less, because it is installed and uninstalled in the same way as Windows software, so there is no need to talk more.

Second, Linux Source CodeInstallation and uninstallation of distribution packages

The distribution of the source code of the Linux software refers to the release form of the software, which requires the user to compile the executable binary code and install it, which has the advantages of flexible configuration, the ability to remove or retain certain functions/modules, adapt to a variety of hardware/operating system platforms and the compilation environment, the disadvantage is difficult , generally not suitable for beginners to use.

1, *.src.rpm form of source code package

Installation: Rpm-rebuild *.src.rpm, then Cd/usr/src/dist/rpms, last 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 earlier.

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

Install: tar-zxvf*.tar.gz or tar-yxvf*.bz2 unzip first, then enter the extracted directory to execute the following command:
$./configure//configuration generate makefile and other files
$ make//compile
$ make Install/install
Uninstall: Makeuninstall or manually delete
Note: It is recommended to read the documentation before extracting, to understand the requirements of the installation and, if necessary, to change the compilation configuration. The source code of some packages can be uninstalled with the make uninstall command after compilation and installation, and if this feature is not provided, the uninstallation of the software must be removed manually. Since the software may be distributed across multiple directories in the system, it is often difficult to remove it cleanly, you should configure it before compiling, specifying that the software will be installed to the target path:./configure-prefix= Directory Name , which allows for a clean and complete uninstallation using the "RM-RF Software directory Name" command. Compared with other installation methods, it is most difficult for users to compile and install themselves, which is suitable for people who have some experience with Linux, and generally do not recommend beginners.

Attached 1: How do I know if a tar.gz/bz2 package is a binary document package or a source code package?

If you use the compression tool will understand that the compression package is not necessarily software, it may be the backup of many pictures, may be packaged together with the general information, to distinguish what is the best way is to look at the document list in the package.

Use the command TAR-ZTVF*.TAR.GZ/TAR-YTVF *.bz2 to extract or use the image of the Ark Compressed file management tool under X-window can be viewed. The document in the source package often contains various source code documents, header document *.H, C code source document *.C, C code source document *.CC/*.CPP, etc., while the documents in the binary package will have executable documents (often the main executable document with the same name as the software). The flag is where the path contains a directory named Bin (with only a few exceptions).

Installation method of the Deb package with 2:ubuntu

Deb is the Debian Linux installation format, very similar to Red Hat rpm, the most basic installation command is: Dpkg-i file.deb

Dpkg is a shorthand for the Debian package, a suite management system specifically developed for Debian, which facilitates the installation, updating and removal of software. All Linux distributions originating from Debian use dpkg, such as Ubuntu, Knoppix, and so on.

Here are some common ways to use Dpkg:

1, dpkg-i<package.deb>
Install a Debian package, such as files you have manually downloaded.

2. Dpkg-c <package.deb>
List the contents of <package.deb>.

3, dpkg-i<package.deb>
Extract package information from <package.deb>.

4, Dpkg-r<package>
Remove a package that has already been installed.

5, Dpkg-p<package>
Completely clears an installed package. Unlike remove, remove just deletes the data and executable files, and purge also removes all the configuration files.

6, Dpkg-l<package>
List all files that are <package> installed. Also see Dpkg-c to check the contents of a. deb file.

7, Dpkg-s<package>
Displays information about the packages that have been installed. Also see Apt-cache displays the package information in the Debian archive, as well as dpkg-i to display the package information extracted from a. deb file.

8, Dpkg-reconfigure<package>
Reconfigure an already installed package if it is using debconf (debconf provides a unified configuration interface for package installation).

Installation and uninstallation of Linux software packages

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.