Linux Package Management: RPM, yum

Source: Internet
Author: User
Tags gpg yum repolist

components of a package: binaries, libraries, configuration files, Help files
Binary process

Order:/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin

Application:/usr/local/nginx

Library:/lib,/usr/lib,/lib64,/usr/lib64,/usr/local/lib,/usr/local/lib64

Application:/usr/local/nginx

Define the location of the library file:/etc/ld.so.conf,/etc/ld.so.conf.d/*.conf

Configuration file:/etc/

Help files: Man file, info file, Readme,install,changelog

Use of the man file:

1,man–m/usr/local/nginx/man httpd

2,vim/etc/man.config

Manpath/usr/local/nginx/man

LDD Command

To view the shared libraries on which the application depends

# ldd ' which ifconfig '

Linux-vdso.so.1 = (0x00007fffd4dff000)
Libselinux.so.1 =/lib64/libselinux.so.1 (0x0000003cf4400000)
libc.so.6 =/lib64/libc.so.6 (0x0000003cf2800000)
libdl.so.2 =/lib64/libdl.so.2 (0x0000003cf3000000)
/lib64/ld-linux-x86-64.so.2 (0x0000003cf2400000)

Package Manager uses
Basic functionality of Package Manager:

Package, install, query, upgrade, uninstall, verify, database management

CentOS two Application Manager: RPM, yum

RPM Package Use: Installation: Rpm–ivh rpm_package

#rpm –IVH zsh-4.3.10-5.el6.x86_64.rpm

Preparing ... ########################################### [100%]
1:zsh ########################################### [100%]

-I: Installation

-V: Show more information

-H: Displays the installation progress in #, a # represents 2% progress

Reinstall: rpm–ivh–replacepkgs Rpm_package

#rpm-IVH--replacepkgs zsh-4.3.10-5.el6.x86_64.rpm

Uninstall: Rpm–e package_name

#rpm –e zsh

#rpm –e–nodeps MySQL

Ignore dependency Relationship Offload

Enquiry: Rpm–q

Querying a single installation package: Rpm–q zsh

To query all installed packages: RPM–QA

Query Package description information: Rpm–qi tcpdump

Name:tcpdump Relocations: (not relocatable)
version:4.0.0 Vendor:centos
Release:3.20090921gitdf3cb4.2.el6 Build Date:mon-08:56:48 PM CST
Install date:tue 01:40:32 PM CST Build Host:c6b6.bsys.dev.centos.org
Group:applications/internet Source rpm:tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6.src.rpm
size:832443 License:bsd with advertising
SIGNATURE:RSA/SHA1, Mon-09:32:34 PM CST, Key ID 0946fca2c105b9de
Packager:centos Buildsystem url:http://www.tcpdump.org
SUMMARY:A Network Traffic Monitoring tool
Description:
Tcpdump is a command-line tool for monitoring network traffic.
Tcpdump can capture and display the packet headers on a particular
Network interface or on all interfaces. Tcpdump can display all of
The packet headers, or just the ones that match particular criteria.

Install tcpdump If need a program to monitor network traffic.

List of files generated by the query installation package on the current system: RPM–QL tcpdump

/usr/sbin/tcpdump
/usr/sbin/tcpslice
/usr/share/doc/tcpdump-4.0.0
/usr/share/doc/tcpdump-4.0.0/changes
/usr/share/doc/tcpdump-4.0.0/credits
/usr/share/doc/tcpdump-4.0.0/license
/usr/share/doc/tcpdump-4.0.0/readme
/usr/share/man/man8/tcpdump.8.gz
/usr/share/man/man8/tcpslice.8.gz

Query which package installation generated the file: Rpm-qf ' which ifconfig '

Net-tools-1.60-110.el6_2.x86_64

Help documents generated after the query package installation: RPM–QD tcpdump

/usr/share/doc/tcpdump-4.0.0/changes
/usr/share/doc/tcpdump-4.0.0/credits
/usr/share/doc/tcpdump-4.0.0/license
/usr/share/doc/tcpdump-4.0.0/readme
/usr/share/man/man8/tcpdump.8.gz
/usr/share/man/man8/tcpslice.8.gz

Configuration files generated after query package installation: RPM–QC bash

/etc/skel/.bash_logout
/etc/skel/.bash_profile
/etc/skel/.bashrc

Script executed during query package installation: Rpm–q–scripts httpd

Preinstall Scriptlet (using/bin/sh):
# ADD the "Apache" user
Getent Group Apache >/dev/null | | Groupadd-g 48-r Apache
Getent passwd Apache >/dev/null | | \
Useradd-r-u 48-g apache-s/sbin/nologin \
-d/var/www-c "Apache" Apache
Exit 0
Postinstall scriptlet (using/bin/sh):
# Register The httpd service
/sbin/chkconfig--add httpd
/sbin/chkconfig--add Htcacheclean
Preuninstall scriptlet (using/bin/sh):
If [$ = 0]; Then
/sbin/service httpd stop >/dev/null 2>&1
/sbin/chkconfig--del httpd
/sbin/service Htcacheclean Stop >/dev/null 2>&1
/sbin/chkconfig--del Htcacheclean
Fi
Posttrans scriptlet (using/bin/sh):
Test-f/etc/sysconfig/httpd-disable-posttrans | | \
/sbin/service httpd condrestart >/dev/null 2>&1 | | :

Upgrade:

Rpm–u: Upgrade or install

Rpm–f: Upgrade

RPM–UVH package_rpm

RPM–FVH package_rpm

Check:

Rpm–v httpd

S.5 .... T. c/etc/httpd/conf/httpd.conf
....... T. c/etc/sysconfig/httpd

S File size differs change
M Mode differs (includes permissions and file type) file permissions and filename changes
5 Digest (formerly MD5 sum) differs MD5 check value change
D Device Major/minor number mismatch
L Readlink (2) path mismatch
U user ownership differs change of owner relationship
G group ownership differs user group relationship change
T MTime differs timestamp change
P capabilities differ

Import Publisher Public key:

RPM Package determines package integrity and source legitimacy by importing the publisher's public key

Rpm–import/path/to/gpg-key-file

#gpg-key-file at the root of the disc

#rpm –import rpm-gpg-key-centos-6

#rpm –K rpm-k zsh-4.3.10-5.el6.x86_64.rpm

Package Management database:

Database location:/var/lib/rpm

Rebuild the database:

#rpm –initdb: If there is no database, the rebuild

#rpm –REBUILDDB: Direct rebuild will overwrite the original library

Yum uses:

The dependency relationship cannot be resolved when the RPM package is installed, and Yum emerges. Yum can automatically resolve dependencies during the installation process. Yum is divided into server side and client.

Yum Server:

Equivalent to a file server for the RPM package, you can use HTTP,NFS,FTP, local file as the server.

Yum Client:

Configuration file:/etc/yum.repo.d/*.conf,/etc/yum.conf

Specify a connected Yum server repository

Cache metadata: Yum client obtains metadata from the Yum server repository and caches it to a local

Analyze metadata: Complete metadata analysis based on specific action requests, including checking dependency relationships, file lists, and other information

Perform installation software, query and other functions

Yum Server configuration:

A. Use a mounted disc as the Yum Source:

1. Mount Disc: Mount/dev/cdrom/media

2.vim/etc/yum.repo.d/

[Package]
Name=centos Packages
Baseurl=file:///media/packages
Enabled=1
Gpgcheck=0

3. Testing

Yum Repolist

Common commands for Yum clients:

Yum repolist [All | enabled | disabled]: Lists all available yum repo

Yum Clean [All | packages | meta | expire-cache | rpmdb | plugins]: Cleanup cache

Yum List [All | installed | avaliable]: Lists all available RPM packages

Yum Info httpd: Listing Package details

Yum grouplist: List all package groups

Yum Group Info "package_group_name": List package Group information

Three and development-related package groups:

Desktop Platform Development

Server Platform Development

Development Tools

Yum Install httpd: Installing the specified package

Yum Reinstall httpd: Reinstall the specified package

Yum check-update: Check for upgradeable packages

Yum Update httpd: Upgrade the specified package

Yum downgrade httpd: Class-specific packages

Yum Erase | Remove httpd: Deletes or uninstalls the specified package

Yum Whatprovides | PROVIDES/ETC/PASSWD: The query file is provided by which package

Yum Groupinstall "group_name": Install the specified group package

Yum Groupremove "group_name": Uninstalling the specified group package

Yum Install *.rpm: Installing a local Pack

Linux Package Management: RPM, yum

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.