Linux Package Management

Source: Internet
Author: User
Tags gpg pack

  • Software operating Environment

  • abi:application binary Interface Application binary interface

    Windows is incompatible with Linux

    ELF

    PE

    Api:application progrmming Interface should program programming interface

    Posix

    C Programming: Program source code---preprocessing----compile---link

    Static compilation:. A

    Dynamic compilation:. So

    Static and dynamic links

    The main function of the link is to handle the parts of each module referenced to each other, so that the modules can be properly connected, static links and dynamic links

    Static links

    Copy the dependent Library of the program to the package; libxxxx.a

    Embed packages, upgrade difficult, need to recompile, occupy more space, easy to migrate

    Dynamic links

    Only add dependency to a dynamic link; libxxx.so

    Point to a library file, run temporarily, use less space, upgrade is convenient

    Library files

    View the library files that the binaries depend on

    Ldd/path/to/binary_file

    Manage and view native-mounted library files

    Ldconfig Loading library files

    /sbin/ldconfig-p Show all library files that have been cached by this machine

    Configuration file:

    /etc/ld.so.conf

    /etc/ld.so.conf.d/*.conf

    Cache files:/etc/ld.so.cache

    Java program: Compile once, run everywhere. The reason for this feature is that the JVM is on top of the OS

    Development language

    System-Level development: c,c++

    Application-level development: Java,delphi,python,go,php,perl,ruby, etc.

      • Package Basics

    Package Manager

    Binary application components: binary files, library files, configuration files, Help files

    Package Manager

    Debian:deb file, dpkg Package Manager

    redhat:rpm file, RPM Package Manager

    Rpm:redhat Package Manager early: Red Hat Pack Manager

    RPM Package Manager RPM Pack Manager

    Package naming

    Source code: NAME-VERSION.TAR.GZ|BZ2|XZ

    VERSION:major.minor.release

    RPM Package naming method:

    name-version-release.arch.rpm

    Example: bash-4.2.46-19.el7.x86_64.rpm

    VERSION:major.minor.release

    Release:release. OS

    19: Packing times

    EL7: Used on RHEL7

    Common ARCH:CPU Architectures

    X86:i386, i486, i586, i686

    X86_64:x64, x86_64, AMD64

    Platform agnostic: Noarch

    Sorting and unpacking:

    There may be dependencies between packages, or even cyclic dependencies

    To resolve the dependency package management tool:

    Yum:yum Package Manager Front End Tool

    Apt-get:deb Package Manager Front End Tool

    RPM front-end management tools on Zypper:suse

    Dnf:fedora + RPM Package Manager front-end management tool

    Package Manager:

    Package the compiled application into one or several package files, so as to quickly and easily implement package installation, uninstallation, query, upgrade and validation management operations

    Package file composition

    The files in the RPM package

    RPM metadata such as name, version, dependency, description, etc.

    Some also have scripts that run when you install or uninstall

    Database:/var/lib/rpm

    Package Name and version

    Dependent relationships

    Function description

    File path and checksum information generated after package installation

    How to manage Packages:

    Using Package Manager: RPM

    Using the front end tool: Yum, DNF

    Ways to get Packages:

    (1) The system issued by the CD or the official server;

    CentOS Image:

    https://www.centos.org/download/

    Http://mirrors.aliyun.com

    Http://mirrors.sohu.com

    Http://mirrors.163.com

    (2) Official site of the project

    (3) Third party organizations:

    Fedora-epel:

    Extra Packages for Enterprise Linux

    Rpmforge:rhel recommended, the package is full

    Search engine:

    http://pkgs.org

    Http://rpmfind.net

    Http://rpm.pbone.net

    https://sourceforge.net/

    (4) Make your own

    Note: Third party packages are recommended to check their legality; source legitimacy, package integrity

      • RPM Package Management

    Install, uninstall, upgrade, query, check, database maintenance and other operations

    Installation

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

    -I: Installation

    -V: Show more information

    -H: Show Progress in #

    --test: Test installation, do not actually perform installation

    --nodeps: Ignoring dependencies

    --replacepkgs|replacefiles

    --nodigest: Package integrity is not checked

    --noscripts: Does not execute Package script

    RPM-IVH Package_file

    Upgrade

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

    Install an older version of the package, then "Upgrade"

    If there is no legacy package, the Install

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

    Install an older version of the package, then "Upgrade"

    If there is no legacy package, no action is taken

    RPM-UVH Package_file

    RPM-FVH Package_file

    --oldpackage: Downgrade

    --force: Forced installation

    Note

    1. Do not upgrade the kernel; Linux supports multi-core version coexistence; Therefore, install the new version kernel directly

    2. If the original package configuration file has been modified, upgrade, the same configuration file provided by the new version does not directly overwrite the old version of the configuration file, and the new version of the file is retained after renaming

    Enquiry

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

    -A: Querying all packages

    -L: View all files generated after the installation of the specified package

    -I: More information information

    -F: To see which package installs the specified file for build

    -P rpmfile: query operation for package files not yet installed

    -C: Querying the program's configuration file

    -D: Querying the program's documentation

    --provides: Lists the capability provided by the specified package

    -r: query Specifies the capability that the package depends on

    --whatprovides CAPABILITY: Query which package is supplied by the specified CAPABILITY

    --whatrequires CAPABILITY: query which package the specified CAPABILITY is dependent on

    --changelog: Query rpm Package for Changelog

    --scripts: Query the script that comes with the package

    Rpm2cpio Package File | CPIO-ITV Preview in-Package files

    Rpm2cpio Package File | Cpio-idv./somefile release in-Package files

    Unloading

    RPM {-e|--erase} [--allmatches] [--JUSTDB] [--nodeps] [--noscripts]

    [--notriggers] [--test] Package_name ...

    --allmatches: If more than one version is removed

    --nodeps: Ignoring dependencies

    --noscripts: Do not unload scripts

    --test: Uninstalling the test

    Check

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

    S,m,5,d,l,u,g,t,p

    -V: The properties of which files in the query package are changed

    Import the required public key:

    RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-7

    CentOS Distribution Disc available: RPM--import rpm-gpg-key-centos-7|6

    Rpm-k|checksig Rpmfile Check Package integrity and signature after importing public key

    Uninstalling the Public key:

    Rpm-qa "gpg-pubkey*"

    Rpm-e gpg-pubkey*

    Database Maintenance

    Database rebuild:/var/lib/rpm

    RPM {--INITDB|--REBUILDDB}

    Initdb: Initialize new If no database exists beforehand; otherwise, no action is taken

    REBUILDDB: Rebuilding the database index directory for an installed header

      • Yum Management



      • Compiling the installation



    Linux Package Management

    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.