Linux Package management rpm Yum DNF

Source: Internet
Author: User
Tags gpg asymmetric encryption

Linux Package Management:

    • Package Manager Features: Packaging, package management (install, upgrade, uninstall, query, checksum)

    • Currently, there are two common tools that are commonly used in Linux.

      • Deb:debian Linux uses include Ubuntu

      • Rpm:redhat package Manager, CentOS, etc. in use

    • The composition of the package:

      • Binaries:/bin,/sbin,/usr/bin,/usr/sbin

      • Library files:/lib64,/USR/64

      • Configuration file:/etc

      • Help files: Manual, Info

    • Package Manager:

      • Packaging: A source file, a single archive file

      • Install: Release files to the appropriate path

      • Uninstall: Collect all related file deletions

      • Upgrade: Update Related files

      • Query: Query Package related information

      • Checksum: The source legitimacy and completeness of the package


RPM Package:

    • RPM Packaging: The package Rpmbuild tool is packaged according to various rules based on the specs file.

    • Subcontracting mechanism: A program contains a variety of functions, which may have only a few functions commonly used, several functions are occasionally used, several functions are rarely used, the program functions are packaged separately, divided into core packages and support packages.

      • Core Pack: Software-version

      • Support Package: Software-devel-version

    • RPM Package naming mechanism:

      • name-version-release.arch.rpm

        5 fields

        Name: Package Name

        Version: Release information

Major.minor major version number. minor version number

Release: Number of Releases

ARCH: The right hardware platform i386, i586, i686, x86_64

Between package and package: There may be dependencies such as installing a B prior to installing a, installing C before installing B, and so on. RPM Database:/var/lib/rpm

Record package names, install generated files, verify information, dependencies, and so on.

How to get RPM packages

    • Packages provided in the release version, typically in the packages directory on the disc

    • Fedora-epel, organization revenue RPM package, formal, authoritative, security

    • Official site of the project, such as the official site of TOMCAT,SVN

    • Search Engine: Third-party delivery, attention to security issues

Http://rpmfind.net

Http://rpm.pbone.net

http://pkgs.org


RPM Command Implementation Package management

  • Installation

    • RPM {-i|--install} [install-options] package_file ...

      -i:install

      -V: View detailed installation information;-VV,-VVV more detailed installation information

      -H: Show installation progress

    • install-options [--allfiles] [--badreloc] [--excludepath OldPath] [--excludedocs] [--force] [-H,--Hash] [--ignoresiz   E] [--ignorearch] [--ignoreos] [--includedocs] [--JUSTDB] [--nocollections] [--nodeps] [--nodigest] [--nosignature] [--noorder] [--noscripts]   [--notriggers] [--oldpackage] [--percent]   [--prefix NewPath]   [--relocate Oldpath=newpath] [--replacefiles]   [--replacepkgs] [--test]

--nodeps: Ignore dependencies, Force installation

--replacefiles: When a program is already installed, use this command to override the installation directly

--replacepkgs: Reinstall a software

--test: Test whether the software can be installed in the system

Example:


Upgrade:

    • RPM {-u|--upgrade} [install-options] package_file ...
      RPM {-f|--freshen} [install-options] package_file ...

      -UVH: If an older version of the package is installed, it is updated to the new version and, if not, installed directly

      -FVH: If an older version of the package is installed, it is updated to the new version;

      Here you select [Install-options] with the option to install

      --oldpackage: Downgrade the program to install

Inquire

    • RPM {-q|--query} [select-options] [query-options]

-QA: Query all software installed on this machine

-Q: Query only if the specified software is installed

-qi: Query specific software details, developer, version, etc.

-QL: A list of all files generated by the query software installation

-QC: query Specifies the configuration file that the package installation generates

-Q--scripts: Query package related Footsteps

Preinstall: Pre-installation script

Postinstal: Post-installation script

Preuninstall: Pre-uninstall script

Postuninstall: Post-uninstallation script

-QP[ICDL]: Query For information that does not have software installed, with the same parameters as above

Example:


Unloading

    • RPM {-e|--erase} [--allmatches] [--nodeps] [--noscripts]
      [--notriggers] [--test] Package_name ...

Check

    • RPM {-v|--verify} [select-options] [verify-options

      -V: followed by the software name, if the file is modified in the software, it will be listed

      -va: List all files that have been changed on the system

      -VF: If a file has been altered

      S file size differs files are modified
      M Mode differs permissions and file types are modified
      5 Digest (formerly MD5 sum) differs MD5 content changed
      D device Major/minor number mismatch the master/Sub Code of the appliance has changed
      L Readlink (2) path mismatch link paths changed
      U User ownership differs file owner modified
      G group ownership differs file genus modified
      T MTime differs file creation time is modified
      P capabilities differ dependent relationship changes

      Example:

    • Package Check

Source legitimacy Check: Asymmetric encryption (public key)

Integrity verification: one-way encryption

#该路径下存放了密钥 public key file [[email protected] packages]# ls/etc/pki/rpm-gpg/rpm-gpg-key-centos-7 rpm-gpg-key-centos-debug-7 Rpm-gpg-key-centos-testing-7

Import Key command:

RPM--import/path/to/key_file

Manual Check:

Rpm-k/path/to/rpm_file











Linux Package Management rpm Yum DNF

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.