Software installation package management for Linux

Source: Internet
Author: User
Tags gpg

1. Software Manager

The more commonly used software managers in Linux are rpm and dpkg, respectively. Dpkg was first developed by the Debian community, and through the dpkg mechanism, Debian provides software that can be installed quickly, while providing post-installation information. Other Linux versions that are derived from Debian can use this mechanism, such as ubuntu,b2d. RPM is developed by Red Hat, which uses the mechanism such as CentOS.

In order to solve the problem of software attribute dependency, the Linux version Publisher is handled by using the "online upgrade" mechanism. Specifically, the Publisher makes a list of dependent attributes, and when the actual software is installed, if a dependency occurs, any software provided by the Publisher can be installed on the basis of the Software installation list as long as the network is present. Red Hat's online upgrade command is Yum, and the Debian Publisher's online upgrade command is Apt-get.

2. Software Management program rpm

Basic work: Software installation, query, uninstall, upgrade, calibration, database reconstruction, verification of data packets and other work

RPM Command: RPM rpmbuild

Database:/var/lib/rpm

default installation path for RPM:/usr/bin: Some executable files

/usr/lib: Dynamic link Libraries used by some programs

/usr/share/doc: Some basic software manuals and help documentation

/usr/share/man: Some man page files

By the way, some of the contents of the file system:

The root directory contains the folders:

/usr/share/man

/bin/sbin/etc/lib: The system starts the required programs, these directories cannot mount additional partitions and must be in the root directory.

/usr/bin, /usr/sbin,/usr/lib: These directories hold the core functional area of the operating system and can be partitioned separately

/usr/local bin, Sbin, lib, etc, man: third-party software storage location

/opt

/proc,/sys kernel virtual directory, default is empty, cannot be partitioned separately

/dev: Device files, cannot be partitioned separately/udev

/root cannot be partitioned separately

/var: Store Some variables, temporary files, recommended separate partition

/boot: Kernel file initrd

3. Software Management Program RPM command

RPM Name:

Package components: Main Package bind-9.7.1-1.el5.i586.rpm

Sub-Package bind-libs-9.7.1-1.el5.i586.rpm
bind-utils-9.7.1-1.el5.i586.rpm

Package name format: name-version-release.arch.rpm (issue number, platform architecture)

Version name version information release version number of times appropriate for platform extensions

bind-major.minor.release-release.arch.rpm

Major version number: significant improvements

Sub-version number: A significant change in a child function

Issue number: Fixed some bugs and tweaked a bit of functionality.

1. Installation

RPM-IVH package_name

I:install;      V: View detailed information; H: Display installation information in the installation Information Bar

--nodeps: Ignoring dependencies;
--replacepkgs: Re-install, replace the original installation;
--force: Forced installation, can be re-installed or degraded;

2. Enquiry

rpm-q only query, the software name after the installation

Rpm-qa querying all packages that have been installed

Rpm-qi package_name: Query The description information for the specified package

RPM-QL package_name: Query the list of files generated after the installation of the specified package;

RPM-QC paceage_neme: Query the configuration file for the specified package installation;
RPM-QD package_name: Query the Help file for the specified package installation;

Rpm-qf/path/to/somefile: Queries the specified file is generated by which RPM package is installed;
If a RPM package has not been installed, we need to query its description information, installation will be generated after the file;
Rpm-qpi/path/to/package_file
Rpm-qpl

3. Upgrade
Rpm-uvh/path/to/new_package_file: If the old version is installed, upgrade;
Rpm-fvh/path/to/new_package_file: If the old version is installed, the upgrade; otherwise, exit;
--oldpackage: Downgrade

4. Uninstall

RPM-E package_name--nodeps

5. Check
Rpm-v package_name

6. Rebuilding the database
Rpm
--REBUILDDB: Rebuilding the database will be re-established;
--INITDB: Initialize the database, not only build, there is no need to establish;


7, check the source legality, and package integrity;
Encryption Type:
Symmetric: Encrypt and decrypt using the same key
Public key: A pair of keys, public key, private key, the public key is implied in the private key, can be extracted, and publicly out;
One way:

# ls/etc/pki/rpm-gpg/
Rpm-gpg-key-redhat-release
Rpm-k/papt/to/package_file
DSA, GPG: Verification of the legitimacy of the source, that is, the signature; You can use--nosignature to skip this
SHA1, MD5: Verifying package integrity; You can use--nodigest to skip this

RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-redhat-release: Import Key file

4.yum Online upgrade mechanism

based on the dependencies of each software to make a property-dependent solution, and then can automatically handle the software dependency property relationship, so as to solve the software installation and removal and upgrade issues.

1. Use Yum to query, install, upgrade and delete functions

Query function:

Yum [options] [Query Project working directory] [related parameters]

-Y: You can automatically provide yes when waiting for the user to enter Yes;--installroot=/some/path: Install to a different directory without using a special directory

Search: Searching for a software name or a description of important keywords

List: Lists all the software names and versions currently managed by Yum, similar to RPM-QA

Info: Similar to Rpm-qai

Provides: Search for software from a folder, similar to RPM-QF

upgrade/install Yum[install/update]

Remove Yum [Remove]

Software installation package management for Linux

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.