System software package management under Linux (RPM, yum, source package installation)

Source: Internet
Author: User

1. RPM Tool
RPM is all called Redhat Package Manager, Red Hat software packages management tool, the design concept is open, not only on the Redhat platform, also can be used on SuSE.

RPM Package name composition consists of-and. Divided into parts, such as ABRT-CLI-2.0.8-15.EL6.CENTOS.I686.RPM,ABRT-CLI is the package name, 2.0.8-15 is the version number, el6 refers to Redhat Enterprise Edition 6,centos means that this is used on CentOS , i686 refers to the platform type. Some RPM packages do not write specific platforms but Noarch, which means that the RPM package does not have a hardware platform limit.

Install a package: rpm-ivh/mnt/packages/libjpeg-turbo-devel-1.2.1-1.el6.i686.rpm
-I means installation

-V Visualization

-H Displays installation progress
--force: Mandatory installation, even if overwriting files belonging to other packages is installed
--nodeps: Install this package when the RPM package to be installed depends on other packages, even if no other packages are installed

[Email protected] mnt]# RPM-IVH tree-1.5.3-2.el6.i686.rpm Preparing ... ################################## ######### [100%] 1:tree ########################################### [100%]


Upgrade: RPM-UVH filename.rpm
-U is the meaning of upgrade

RPM Uninstallation:
RPM-E filename//The filename here is queried via the RPM query function.
Rpm-qa |grep Libjpeg-turbo-devel
Rpm-e Libjpeg-turbo-devel

[[email protected] ~]# rpm-q treetree-1.5.3-2.el6.i686[[email protected] ~]# rpm-e tree[[email protected] ~]# echo $?0

echo $? View the previous command execution status, return 0 indicates successful execution, not 0 for unsuccessful;

Query whether a package is installed

RPM-Q Package Name (without platform information and suffix name)

[Email protected] ~]# Rpm-q treepackage tree is not installed


Query the current system for all installed RPM packages
Rpm-qa

find information about RPM packages:
RPM-QI Package Name

list the files that are installed by RPM :
RPM-QL Package Name

[Email protected] ~]# RPM-QL vim-enhanced/etc/profile.d/vim.csh/etc/profile.d/vim.sh/usr/bin/ex/usr/bin/rvim/usr/ bin/vim/usr/bin/vimdiff/usr/bin/vimtutor/usr/share/man/man1/rvim.1.gz/usr/share/man/man1/vimdiff.1.gz/usr/ Share/man/man1/vimtutor.1.gz

To see which rpm package a file belongs to:
RPM-QF filename

[Email protected] ~]# Rpm-qf/etc/passwdsetup-2.8.14-20.el6_4.1.noarch



2. Yum tool
Yum list lists all available RPM package Resources
search for a package: Yum search   ' Keywords ' or     yum list |grep ' keywords '
yum installation package : Yum Install-y  filename (package name)
yum Uninstall Package: Yum Remove  -y filename (package name)
yum upgrade package: Yum Update-y FileName (package name)

Yum Find package: Yum provides "*/vim"//Use a wildcard here to find out which package the command is installed from

Yum grouplist List of all packages
Yum Groupinstall Mounting Kit
Yum groupremove Uninstall Kit


creating a local Yum source
mount/dev/cdrom/mnt
cp-r/etc/yum.repos.d/etc/yum.repos.d.bak//Backup First
rm-f/etc/yum.repos.d/*
Vim/etc/yum.repos.d/dvd.repo #加入如下内容:
[DVD]
Name=install DVD
baseurl=file:///mnt
enabled=1
gpgcheck=0
Yum List//See if a DVD's logo appears


Install the Yum extension source Epel to install Nginx, Zabbix

RPM-IVH www.lishiming.net/data/attachmen ... e-6-8_32.noarch.rpm    

(Other address http://www.aminglinux.com/bbs/thread-6721-1-1.html)

[Email protected] ~]# RPM-IVH http://www.lishiming.net/data/attachment/forum/epel-release-6-8_32. Noarch.rpmretrieving http://www.lishiming.net/data/attachment/forum/epel-release-6-8_32.noarch.rpmwarning:/var/ Tmp/rpm-tmp. Ycvqw6:header V3 rsa/sha256 Signature, key ID 0608b895:nokeypreparing ... ################################ ########### [100%] 1:epel-release ########################################### [100%]

after the installation is complete yum list Right many Epel packages can be listed for later use;



Use yum to download RPM packages without installing, Method 1:

Yum has a plugin (plug-in) called Yum-downloadonly, which enables users to download only software packages;

First you need to install the plugin: Yum install-y yum-plugin-downloadonly

after the installation is complete: Yum Install package name-y--downloadonly

#这样就已经下载, CENTOS6 defaults to the /var/cache/yum/I386/6/base/packages I am here is a 32-bit display for the i386 directory;

Yum Install package name-y--downloadonly--downloaddir=/usr/local/src #指定一个下载目录, if it is already installed RPM package is not successful, you need to use Reinstall:yum Reinstall package Name-y--downloadonly--downloaddir=/usr/local/src
Reinstall re-installation;


Example:

[email protected] yum]# yum install-y yum-plugin-downloadonly[[email protected] packages]# pwd/var/cache/yum/i386/6/ Base/packages[[email protected] packages]# ls-l-rw-r--r--. 1 root root 36464 Jul 3 tree-1.5.3-2.el6.i686.rpm


Use yum to download RPM packages without installing, Method 2:

--yumdownloader through a dedicated package download tool. This tool is a subset of the Yum Toolkit, which contains a suite of help tools for managing yum packages.

Install with command: Yum install-y yum-utlis

After the installation is complete, download the RPM package, using the command: Yumdownloader package name

The downloaded package is saved to the current directory and you need to use root permissions because Yumdownloader will update the package index file during the download process. Unlike the Yum command, any dependent packages are not downloaded.



Set Yum to keep downloaded RPM packages

Yum by default, the downloaded RPM package is removed after the upgrade or installation.

Modify the/etc/yum.conf configuration file to keep the downloaded package;
[Main]
Cachedir=/home/soft/yumcache
Keepcache=1
debuglevel=2

Cachedir Store the address of the download package, you can modify the address for your own placement;

Keepcacahe is set to 1, which means to save the RPM package that has already been downloaded;



3. Source Package Installation
source package is an open source, self-changing package , most of which are developed in C language, cannot be used directly, and need to be compiled into binary executable files;
Compile the source package must have GCC support, If you do not need to install   yum install-y gcc


instance:

Install wget First, install the command: Yum install-y wget

#wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.29.tar.gz
2. Unzip tar zxvf httpd-2.2.29.tar.gz//view readme or install documentation
3. Specify compilation parameters./configure--help can view Help

#./configure--prefix=/usr/local/apache2 specifies a path;

Prompt checking for GCC when executing ... no need to install GCC compiler; Install command #yum install-y gcc
4, #echo $? Verify success
5, #make compiled into a binary file;
6, #make Install the installation of the compiled file;




This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://8802265.blog.51cto.com/8792265/1626892

System software package management under Linux (RPM, yum, source package installation)

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.