RPM package Management and Yum repository

Source: Internet
Author: User
Tags asymmetric encryption

Package Management:

Kernel Features: Process management, memory management, network protocol stack, driver 、...
Application:

Package Manager Features: Package, package management (install, upgrade, uninstall, query and verify)
Deb:debian
Rpm:redhat Package Manager
RPM is the package Manager

Components of the package:
Binaries:/bin,/sbin,//usr/bin,/usr/sbin,
Library files:/lib64,/usr/lib64
Configuration file:/etc
Help files: Manual, Info,

Package Manager:
Package: In a single archive file;
Installation:
Unloading:
Upgrade:
Inquire:
Check:

The legitimacy and completeness of the source;

RPM Package:
Rpmbuild:specs file

10:5, 3, 2

Subcontracting mechanism:
Testapp-version.tar.gz

Core Pack: Testapp-version
Support Package: Testapp-devel-version

VERSION:major.minor.release
Base-4.2.4.tar.gz

The naming mechanism for RPM packages:
name-version-release.arch.rpm
bash-4.2.4-1.el7.x86_64.rpm
bash-devel-4.2.4-1.el7.x86_64.rpm

RELEASE:RPM Release

Between packages and packages: There may be dependencies:
X--Y

RPM Database:/var/lib/rpm/

How to get the RPM package:
1, the release version of the package provided;
2, Fedora-epel
3, the official site of the project
4. Search Engine
http://rpmfind.net
http://rpm.pbone.net
http://pkgs.org

Equipment files for the CentOS identification disc:/dev/cdrom,

Implement package management based on RPM command:
Installation:
RPM {-i|--install} [install-options] package_file ...
-I.:
-V: Show detailed procedure,-VV,-VVV
-H:

Each RPM package is provided with one or more capabilities

--nodeps: Ignore dependency installation
--REPLACEPKGS: Reload Package

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

-UVH: If there is an older version of the package, upgrade it, or if not, install it;
-FVH: If there is an older version of the package, upgrade it, if not, do not install;

--nodeps
--oldpackage: Downgrade;
--force:

Unloading:
RPM {-e|--erase} [--nodeps] [--noscripts] [--notriggers] [--test] package_name ...

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

Query options:
-QA: Query All packages that have been installed on this machine;
-qf/path/to/somefile: Query the file here is generated by which package installation;

-QC: query Specifies the configuration file that the package installation generates
-QD: Query the specified package to install the generated document
-qi: Query the information about the specified package;
-QL: A list of all files generated by the query package installation;
-Q--scripts: Query package-related scripts:
Preinstall: Pre-installation script
Postinstall: Post-installation script
Preuninstall: Pre-uninstall script
Postuninstall: Post-uninstallation script

-P: Query against the package files that are not installed;

         Checksum:
         rpm {-v|--verify} [select-options] [verify-options]
       S file Size differs
         M Mode Differs (includes permissions and file type)
         5 Digest (formerly MD5 SUM) differs
         D Device major/minor number mismatch
          L readlink (2) path mismatch
          U User ownership differs
         G Group ownership differs
         T mTime differs
          P capabilities differ

Package Check:
Source Legitimacy Verification: asymmetric encryption
Integrity verification: one-way encryption

Import Key: RPM--import/path/to/key_file
Check: Rpm-k/path/to/rpm_file

Yum:yellowdog Updater Modified

Yum repositories:
File server:
Ftp://hostname/PATH/TO/REPO
Http://hostname/PATH/TO/REPO
File:///PATH/TO/REPO

Configuration files for the Yum program:
/etc/yum.conf
Define global configuration: configurations that are applicable to all warehouses
/etc/yum.repos.d/*.repo
A file is typically used for a warehouse or a group of similar or related functions

Define a warehouse to point to:
[REPO_ID]
Name=
Baseurl=
# Mirrorlist=scheme://hostname/path/to/mirror_list_file
Enabled={1|0}
Gpgcheck={1|0}
gpgkey=
cost=

Define the warehouse to point to the available variables:
$releasever: Reference the major version number of the current system;
$basearch: The basic architecture of the current system;
i386, i486, i586, i686:i386

http://mirrors.magedu.com/CentOS/$releasever/os/$basearch


Yum command:
Yum [options] [command] [package ...]

Command:
Installation: Install
Uninstall: Remove
Upgrade: Update
Inquire:
Info
Search KEYWORD
List all|installed|availiable
Provides/path/to/somefile: Query for which package the specified file is installed to build
Reinstall: Reinstall
Downgrade: Downgrade
Cleanup cache: Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
Vivid Build Cache: Makecache

Package Group:
Grouplist
GroupInfo "Grp_name"
Groupinstall "Grp_name"
Groupremove "Grp_name"

Warehouse:
Repolist [all|enabled|disabled]
Repoinfo [all|enabled|disabled]

How to use a CD as a local repository:
Mount a disc to a directory
Define the warehouse and use file:/// to indicate its access path;

To create a local warehouse:
Yum Install Createrepo

createrepo/path/to/rpmfiles/

RPM package Management and Yum repository

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.