Package Management--yum

Source: Internet
Author: User
Tags yum repolist

Yum Repository:yum Warehouse
A file (placed in the Repodata directory) server that stores many RPM packages and the relevant metadata for the package

File Services:
/ http
ftp://
nfs://
file:///

Yum Client:
Configuration files: points to the location of the warehouse and various configuration information, each Yum customer can have more than one available Yum warehouse;

There are two components:
master configuration file: /etc/yum.conf
/etc/yum.repos.d/*.repo

Warehouse Definition:
[repo_id]: Warehouse ID
Name=repo Description: Descriptor
baseurl=ftp://172.16.0.1/pub/centos6/Warehouse Specific location path
Enabled={1|0}: Indicates whether the current warehouse is being used, default is 1 enabled

GPGCHECK={1|0}: Whether to validate data integrity in GPG format, if 1 o'clock, you must specify Pgkey=file

The specific path

Gpgkey=ftp://172.16.0.1/pub/centos6/gpg-key: Indicates the specific path specified by GPG, which can be

On FTP, on the web, or on a local path, specify a clear

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

command is one of:
* Install Package1 [Package2] [...]
* Update [PACKAGE1] [Package2] [...]
* Update-to [Package1] [Package2] [...]
* Check-update
* upgrade [Package1] [Package2] [...]
* Upgrade-to [Package1] [Package2] [...]
* Distribution-synchronization [Package1] [Package2] [...]
* Remove | Erase Package1 [Package2] [...]
* List [...]
* Info [...]
* provides | Whatprovides Feature1 [Feature2] [...]
* Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
* Makecache
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
* Search string1 [string2] [...]
* Shell [filename]
* RESOLVEDEP DEP1 [DEP2] [...]
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
* Reinstall Package1 [Package2] [...]
* Downgrade Package1 [Package2] [...]
* Deplist Package1 [Package2] [...]
* Repolist [all|enabled|disabled]
* Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo]
* History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
* Load-transaction [Txfile]
* Check


Yum Warehouse-related commands:
List all available warehouses:
# yum Repolist


List all packages:
# Yum list {all|installed|available}


Note: globbing wildcard characters are supported: *

List all package groups:
# yum Grouplist



Cache Management:
# yum Clean {all|packages}
# yum Makecache


Installation:
yum install package_name ...

If you want to install the specified version of the program:
Yum Install package-version

Reload The specified package
yum Reinstall Package_name ...

Upgrade
Yum Update package_name

If more than one version of the upgrade package is available and is only expected to be upgraded to the specified version:
Yum Update package-version

downgrade:Yum downgrade package_name

Check for available upgrades:
Yum Check-update

Uninstall:
Yum Erase|remove package_name

Other packages that depend on the specified package will be uninstalled;

Enquiry:
Yum List
Yum Info package_name
Yum Search KEYWORD: Contains the relevant column for this KEYWORD based on the keyword Fuzzy query package name or package sumary information

Table

Yum Provides|whatprovides/path/to/somefile

Package Group Management:
Show All package groups:Yum grouplist
To display information about a package group:
Yum groupinfo "Group_name"
Install package Group:
yum groupinstall "group_name"

Yum Install @GROUP_NAME
To unload a package group:
yum groupremove "Group_name"
Yum Remove @ "group_name"

Upgrade Package Group:
yum groupupdate "group_name"

The Yum command can also be used to install local RPM package files:
Yum Localinstall/path/to/rpm_package_file ...

CentOS 7:yum install/path/to/rpm_package_file.
..

Options:
--enablerepo=
--disablerepo=
Note: Precedence is higher than the attribute defined in the/etc/yum.repos.d/*.repo configuration file;
-Y: Auto Answer Yes
--nogpgcheck


How to build a yum repository:
Createrepo

advanced usage of yum Client configuration:

1, in the Yum customer definition warehouse can use cost to define the use of the warehouse, the default is 1000;
2. Variables can be used when specifying paths in BaseURL
$releasever: Major version number of the current OS release
$arch: Platform
$basearch: The basic platform, such as the I686,I586,I486,I386 series of basic platforms are i386;
$YUM 0-$YUM 9

Example: http://mirrors.sohu.com/centos/$releasever/os/$basearch
3. You can replace BaseURL with the mirrorlist directive:
Point to a URL, which is a text file that holds a large list of mirror servers, gets this list file when users use the Yum repository, and then uses the Fastestmirror plugin to determine which mirror is the fastest-to-access server and as the BaseURL for this visit ;

Compile and install packages:

Project Management:
Source Code organization format:
Multiple files: There may be dependencies between the code snippets in the file and across files;

Source code for C/D + + development: Make
Java:maven

Source Code Program Distribution:
Self-built site: apache.org, (ASF) mariadb.org

Code hosting: sourceforge,github.com, code.google.com

C language development of the source program:
Project Builder: Make (GCC), which calls GCC to perform the compilation process depends on the configuration file makefile

Autoconf: Generate a script file configure, this script can check the current system on whether the compilation environment to meet the current program's compilation needs, but also to determine the subsequent compilation work expected to compile into the program of the characteristics;
This second function is done by combining makefile.in files to generate makefile files;
Automake: Generate makefile.in

steps to compile the C source program:
1,./configure: Check the compilation environment, and according to the specified options to determine the characteristics of the compilation, installation path, etc.;
2, make: Call the required compiler to perform the compilation process according to the makefile configuration file definition;
3, make install: installation program;

Prerequisites for compiling and installing the source program:
Providing a development environment: development tools and development libraries
Package groups: Development tools, Server Platform Development, Desktop Platform development, Debug Tools

The./configure script gets Help:
Use the--HELP option to

Common options:
--prefix=: Specify the installation path; Most programs have a default installation path;
--sysconfidr=: Specifies the configuration file installation path;

--with-
--without-

--enable-
--disable-


To compile the installation source program method:
1, expand the source code, look for the install, README, no such files, find the official documents of the project;
2, according to the installation instructions to perform the installation operation;

When the program is installed in a dedicated directory, the post-installation configuration:
1. Export the path of the binaries to the PATH environment
# Export Path=/usr/local/nginx/sbin: $PATH

ways to achieve permanent effectiveness:/etc/profile.d/*.sh

2. Export the library file to the OS
Os Find library File method: Search based on the path specified by the/etc/ld.so.conf configuration file, or search for/lib,/lib64,/usr/lib,/usr/lib64, save all the library file paths found and their name mappings to a cache file/etc/ Ld.so.cache;

The/etc/ld.so.conf configuration file has other components:/etc/ld.so.conf.d/*.conf

Assuming Nginx is installed in/usr/local/nginx, this directory has its library file subdirectory Lib, which exports the library files in this directory:
(1) Create a new file/etc/ld.so.conf.d/nginx.conf, add the following line to the file:
/usr/local/nginx/lib
(2) Run the command:
Ldconfig
-V
-P: Displays the mapping of all the library file names and the paths to which the current OS has been loaded;


3. Help file Export
The man command searches for a specific path to find the manual page file, which is defined in the path specified by the Manpath parameter in/etc/man.config;

What's new : Edit the/etc/man.config file and add a Manpath parameter with the value of the man manual for the new installer

The directory in which it resides;
/USR/LOCAL/NGINX/SHARE/MAN/{MAN1,MAN8}

Man-m/path/to/man KEYWORD

4. Export of header files
Some programs that are installed will generate a header file for the calling interface to own the library file
The path to the system lookup header file is/usr/include

To export the header file method for a standalone installation application: Create a link to/usr/include;

Example:/usr/local/nginx/include
# ln-sv/usr/local/nginx/include/*/usr/include/
# Ln-sv/usr/local/nginx/include/usr/include/nginx

Compilation and installation of Perl source programs:
(1) Perl makefile.in
(2) Make
(3) Make install



This article is from the "Obsession" blog, please be sure to keep this source http://1912822851.blog.51cto.com/9609219/1586783

Package Management--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.