Linux下程序包管理之YUM

实验环境:

CentOS release 6.6 (Final)  一台

IP地址:172.16.249.230

附带:CentOS release 6.6光盘镜像文件

CentOS-6.6-x86_64-bin-DVD1.iso

CentOS-6.6-x86_64-bin-DVD2.iso

YUM(Yellow dog Updater, Modified) 由Duke University团队,修改Yellow Dog Linux的Yellow Dog Updater开发而成,

是一个基于 RPM 包管理的字符前端软件包管理器。能够从指定的服务器自动下载 RPM 包并且安装,可以处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。被Yellow Dog Linux本身,以及Fedora、Red Hat Enterprise Linux、CentOS、SUSE采用。

一.YUM仓库和客户端简介

YUM repository:yum仓库

存储了众多rpm包,以及包的相关元数据的文件服务器

文件服务器:

HTTP:http://ip/centos/$releasever/os/$basearch/

FTP:ftp://ip/centos/$releasever/os/$basearch/

NFS:网络文件系统,nfs://ip/centos/$releasever/os/$basearch/

FILE:本地,file:///centos/$releasever/os/$basearch/

YUM Client :客户端

配置文件:指向仓库的位置以及各种配置信息,每个yum客户端可以有多个仓库。

缓存文件:/var/cache/yum/

二.YUM的配置文件详解

yum的配置一般有两种方式,一种是直接配置/etc目录下的yum.conf文件,另外一种是在/etc/yum.repos.d目录下增加.repo文件。

(一).关于yum.conf文件详解


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

#cat /etc/yum.conf

[main]

cachedir=/var/cache/yum/$basearch/$releasever 

#yum下载的RPM包的缓存目录

keepcache=0

#缓存是否保存,1保存,0不保存。

debuglevel=2

#调试级别(0-10),默认为2(具体调试级别的应用,我也不了解)。

logfile=/var/log/yum.log                      

#yum的日志文件所在的位置

exactarch=1

#在更新的时候,是否允许更新不同版本的RPM包,比如是否在i386上更新i686的RPM包。

obsoletes=1

#这是一个update的参数,具体请参阅yum(8),简单的说就是相当于upgrade,允许更新陈旧的RPM包。

gpgcheck=1

#是否检查GPG(GNU Private Guard),一种密钥方式签名。

plugins=1

#是否允许使用插件,默认是0不允许,但是我们一般会用yum-fastestmirror这个插件。

installonly_limit=5

#允许保留多少个内核包。

bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum

distroverpkg=centos-release

#  This is the defaultif you make this bigger yum won‘t see if the metadata

is newer on the remote and so you‘ll "gain" the bandwidth of not having to

# download the new metadata and "pay" for it by yum not having correct

# information.

#  It is esp. important, to have correct metadata, for distributions like

# Fedora which don‘t keep old packages around. If you don‘t like this checking

# interupting your command line usage, it‘s much better to have something

# manually check the metadata once an hour (yum-updatesd will do this).

# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo

in /etc/yum.repos.d

(二).关于/etc/yum.repos.d/*.repo文件详解

什么是repo文件?

repo文件是CentOS中yum源(软件仓库)的配置文件,通常一个repo文件定义了一个或者多个软件仓库的细节内容,例如我们将从哪里下载需要安装或者升级的软件包,repo文件中的设置内容将被yum读取和应用!

我们以一份系统自带的repo文件做为实例来探讨(#号后面是我加的注释):


1

2

3

4

5

[base]

name=CentOS-$releasever - Base

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

[base]                             

#方括号里面的是软件源的名称,将被yum取得并识别

name=CentOS-$releasever - Base      

#这里也定义了软件 仓库的名称,通常是为了方便阅读配置文件,一般没什么作用,

$releasever变量定义了发行版本,通常是567等数字,

这个变量根据当前系统的版本架构不同而有不同的取值,

这可以方便yum升级的时候选择 适合当前系统的软件包,以下同……

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/     

#上面的一行baseurl第一个字符是‘#‘表示该行已经被注释,将不会被读取,

$basearch变量定义了系统的架构,可以是i386、x86_64、ppc等值

这一行的意思是指定一个baseurl(源的镜像服务器地址)

enabled=1

#这个选项表示这个repo中定义的源是启用的,0为禁用

gpgcheck=1            #

这个选项表示这个repo中下载的rpm将进行gpg的校验,已确定rpm包的来源是有效和安全的

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6   

#定义用于校验的gpg密钥

三.构建YUM仓库

简要步骤说明

(一).确认文件共享方式

(二).把rpm包放置于能够被各yum客户端访问到位置

(三).创建yum仓库的元数据

createrepo命令


1

#yum -y install createrepo

为yum仓库创建元数据文件


1

#createrepo 软件包文件目录

实验案例:

在本文中我创建一个本地光盘yum来构建一个本地YUM仓库。

(一)、挂载本地光盘


1

#mkdir /mnt/cdrom

#新建挂载目录


1

#mount -t iso9660 /dev/cdrom /mnt/cdrom

#挂载光盘到/mnt/cdrom 目录


1

#ls /mnt/cdrom

#查看/mnt/cdrom 目录内容


1

2

3

4

5

6

7

8

9

[[email protected] yum.repos.d]# mkdir /mnt/cdrom

[[email protected] yum.repos.d]# mount -t iso9660 /dev/cdrom /mnt/cdrom  

mount: block device /dev/sr0 is write-protected, mounting read-only

[[email protected] yum.repos.d]# ls /mnt/cdrom

CentOS_BuildTag  isolinux                  RPM-GPG-KEY-CentOS-Debug-6

EFI              Packages                  RPM-GPG-KEY-CentOS-Security-6

EULA             RELEASE-NOTES-en-US.html  RPM-GPG-KEY-CentOS-Testing-6

GPL              repodata                  TRANS.TBL

images           RPM-GPG-KEY-CentOS-6

(二)、配置本地YUM源


1

#cd /etc/yum.repos.d/

#进入/etc/yum.repos.d 目录


1

#ls

#查看目录内容


1

2

#mv CentOS-Base.repo CentOS-Base.repo.bak

#mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak

#重命名上面2个文件


1

#vi CentOS-Media.repo

#对CentOS-Media.repo 进行编辑

(三)、修改CentOS-Media.repo内容

[c6-media]

name=CentOS-$releaserver - Media

#自定义Yum源名称

baseurl=file:///mnt/cdrom/

#本地光盘挂载路径

gpgcheck=1

#检查GPG-KEY

enabled=1

#启用Yum源

gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-6

#GPG-KEY路径


1

2

3

4

5

6

7

[[email protected] yum.repos.d]# cat CentOS-Media.repo

[C6-Media]

name=CentOS-$releaserver-Media

baseurl=file:///mnt/cdrom

gpcheck=1

enabled=1

gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-6

检查列出可用yum仓库元数据


1

2

3

4

5

6

[[email protected] yum.repos.d]# yum repolist

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

repo id                         repo name                                         status

C6-Media                        CentOS-$releaserver-Media                         6,518

repolist: 6,518

至此,本地YUM源配置完成,我们就可以使用yum命令来安装管理程序包了。

四.YUM命令的使用

语法: yum [options] [command] [package ...]

其中的[options]是可选的,选项包括-h(帮助),-y(当安装过程提示选择全部为"yes"),-q(不显示安装的过程)等等。[command]为所要进行的操作,[package ...]是操作的对象

1 程序包管理:安装,更新,卸载,查看信息


1

2

直接安装包(可指定版本号)

yum install  packages -y

列出所有程序包(本地已安装和仓库中的程序包)


1

yum list

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

[[email protected] yum.repos.d]# yum list |more

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

Installed Packages

ConsoleKit.x86_64                        0.4.1-3.el6                    @anaconda-Cen

tOS-201410241409.x86_64/6.6

ConsoleKit-libs.x86_64                   0.4.1-3.el6                    @anaconda-Cen

tOS-201410241409.x86_64/6.6

ConsoleKit-x11.x86_64                    0.4.1-3.el6                    @anaconda-Cen

tOS-201410241409.x86_64/6.6

DeviceKit-power.x86_64                   014-3.el6                      @anaconda-Cen

tOS-201410241409.x86_64/6.6

GConf2.x86_64                            2.28.0-6.el6                   @anaconda-Cen

tOS-201410241409.x86_64/6.6

列出可用yum仓库元数据


1

yum repolist

实例:


1

2

3

4

5

6

[[email protected] yum.repos.d]# yum repolist

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

repo id                         repo name                                         status

C6-Media                        CentOS-$releaserver-Media                         6,518

repolist: 6,518


1

2

3

--disablerepo=name  repolist禁用某个仓库,优先级高于配置文件定义的

--enablerepo=name repolist启用某个仓库,优先级高于配置文件定义的

yum list {all|installed|available}显示选项后可以使用globbing通配符

清除本地所有缓存


1

yum clean all

headers, packages, metadata, dbcache, plugins, expire-cache, rpmdb, all

清除缓存的选项

实例:


1

2

3

4

5

[[email protected] yum.repos.d]# yum clean all

Loaded plugins: fastestmirror, refresh-packagekit, security

Cleaning repos: C6-Media

Cleaning up Everything

Cleaning up list of fastest mirrors

手动生成yum缓存,有些慢就不帖了。


1

yum makecache

升级安装包(可指定版本号),没更新的包了!就不升级了!


1

yum update packages

降级安装包,


1

yum downgrade packages

我先升级zsh到zsh-4.3.10-8.el6_5.x86_64.rpm,然后执行降级。

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

[[email protected] dvd]# rpm -Uvh zsh-4.3.10-8.el6_5.x86_64.rpm 

Preparing...                ########################################### [100%]

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

[[email protected] dvd]# yum downgrade zsh

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Downgrade Process

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package zsh.x86_64 0:4.3.10-7.el6 will be a downgrade

---> Package zsh.x86_64 0:4.3.10-8.el6_5 will be erased

--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================

 Package         Arch               Version                  Repository            Size

========================================================================================

Downgrading:

 zsh             x86_64             4.3.10-7.el6             C6-Media             2.1 M

Transaction Summary

========================================================================================

Downgrade     1 Package(s)

Total download size: 2.1 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

  Installing : zsh-4.3.10-7.el6.x86_64                                              1/2

  Cleanup    : zsh-4.3.10-8.el6_5.x86_64                                            2/2

  Verifying  : zsh-4.3.10-7.el6.x86_64                                              1/2

  Verifying  : zsh-4.3.10-8.el6_5.x86_64                                            2/2

Removed:

  zsh.x86_64 0:4.3.10-8.el6_5                                                           

Installed:

  zsh.x86_64 0:4.3.10-7.el6                                                             

Complete!

[[email protected] dvd]# rpm -qa zsh

zsh-4.3.10-7.el6.x86_64

降级成功!

卸载程序包(会一并卸载依赖包)


1

yum remove|erease packages

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

[[email protected] dvd]# yum remove zsh

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Remove Process

Resolving Dependencies

--> Running transaction check

---> Package zsh.x86_64 0:4.3.10-7.el6 will be erased

--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================

 Package        Arch              Version                    Repository            Size

========================================================================================

Removing:

 zsh            x86_64            4.3.10-7.el6               @C6-Media            4.8 M

Transaction Summary

========================================================================================

Remove        1 Package(s)

Installed size: 4.8 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Erasing    : zsh-4.3.10-7.el6.x86_64                                              1/1

  Verifying  : zsh-4.3.10-7.el6.x86_64                                              1/1

Removed:

  zsh.x86_64 0:4.3.10-7.el6                                                             

Complete!

[[email protected] dvd]# rpm -qa zsh

显示已安装或者未安装的指定包的信息(没有rpm -qi详细)


1

yum info  packages

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

[[email protected] dvd]# yum info zsh

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

Available Packages

Name        : zsh

Arch        : x86_64

Version     : 4.3.10

Release     : 7.el6

Size        : 2.1 M

Repo        : C6-Media

Summary     : A powerful interactive shell

URL         : http://zsh.sunsite.dk/

License     : BSD

Description : The zsh shell is a command interpreter usable as an interactive login

            : shell and as a shell script command processor.  Zsh resembles the ksh

            : shell (the Korn shell), but includes many enhancements.  Zsh supports

            : command line editing, built-in spelling correction, programmable

            : command completion, shell functions (with autoloading), a history

            : mechanism, and more.

根据关键字模糊查询包名或包的summary信息包含此KEYWORD的相关列表


1

yum search KEYWORD

实例:


1

2

3

4

5

6

7

8

[[email protected] dvd]# yum search zsh

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

=================================== N/S Matched: zsh ===================================

python-twisted-core-zsh.x86_64 : Tab completion for Zsh and Twisted Core

zsh-html.x86_64 : Zsh shell manual in html format

zsh.x86_64 : A powerful interactive shell

  Name and summary matches only, use "search all" for everything.

查询文件谁提供了程序包安装的


1

yum provides|whatprovides  /path/file

实例:


1

2

3

4

5

6

7

8

9

10

11

[[email protected] dvd]# yum provides /usr/bin/yum

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

yum-3.2.29-60.el6.centos.noarch : RPM package installer/updater/manager

Repo        : C6-Media

Matched from:

Filename    : /usr/bin/yum

yum-3.2.29-60.el6.centos.noarch : RPM package installer/updater/manager

Repo        : installed

Matched from:

Other       : Provides-match: /usr/bin/yum

2.程序包组管理 group

列出所有包组


1

yum grouplist

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

[[email protected] dvd]# yum grouplist |more

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Group Process

Loading mirror speeds from cached hostfile

Installed Groups:

   Additional Development

   Base

   Console internet tools

   Desktop

   Development tools

   Dial-up Networking Support

   Directory Client

   E-mail server

   Fonts

   General Purpose Desktop

   Graphical Administration Tools

   Hardware monitoring utilities

   Input Methods

   Legacy UNIX compatibility

   Legacy X Window System compatibility

   NFS file server

   Network Infrastructure Server

   Network file system client

   Networking Tools

   Performance Tools

   Perl Support

   Security Tools

   System administration tools

   Web Server

   X Window System

Installed Language Groups:

--More--

显示某包组的信息(强制安装的包,默认安装包,可选包)


1

yum groupinfo “group_name"

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

[[email protected] dvd]# yum groupinfo "Development tools" |more

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Group Process

Loading mirror speeds from cached hostfile

Group: Development tools

 Description: A basic development environment.

 Mandatory Packages:

   autoconf

   automake

   binutils

   bison

   flex

   gcc

   gcc-c++

   gettext

   libtool

   make

   patch

   pkgconfig

   redhat-rpm-config

   rpm-build

 Default Packages:

   byacc

   cscope

   ctags

   cvs

   diffstat

   doxygen

   elfutils

   gcc-gfortran

--More--

信息太多省略

CentOS6/7都支持安装程序组的命令


1

2

yum groupinstall "group_name"

yum install @group_name

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

[[email protected] dvd]# yum groupinstall "Server Platform Development"

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Group Process

Loading mirror speeds from cached hostfile

Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version

Package glibc-devel-2.12-1.149.el6.x86_64 already installed and latest version

Package libstdc++-devel-4.4.7-11.el6.x86_64 already installed and latest version

Package ncurses-devel-5.7-3.20090208.el6.x86_64 already installed and latest version

Package 1:dbus-devel-1.2.24-7.el6_3.x86_64 already installed and latest version

Package db4-devel-4.7.25-18.el6_4.x86_64 already installed and latest version

Resolving Dependencies

--> Running transaction check

---> Package krb5-devel.x86_64 0:1.10.3-33.el6 will be installed

省略。。。。。。。

CentOS6/7都支持移除组的命令


1

2

yum groupremove  "group_name"

yum remove @group_name

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

[[email protected] dvd]# yum groupremove "Server Platform Development"

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Group Process

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package db4-devel.x86_64 0:4.7.25-18.el6_4 will be erased

--> Processing Dependency: db4-devel for package4:perl-devel-5.10.1-136.el6.x86_64

---> Package dbus-devel.x86_64 1:1.2.24-7.el6_3 will be erased

---> Package glibc-devel.x86_64 0:2.12-1.149.el6 will be erased

--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-11.el6.x86_64

---> Package libstdc++-devel.x86_64 0:4.4.7-11.el6 will be erased

--> Processing Dependency: libstdc++-devel = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.x86_64

省略。。。。。。

直接升级程序包组


1

yum groupupdate "group_name"

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

[[email protected] dvd]# yum groupupdate "Server Platform Development"

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Group Process

Loading mirror speeds from cached hostfile

Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version

Package glibc-devel-2.12-1.149.el6.x86_64 already installed and latest version

Package libstdc++-devel-4.4.7-11.el6.x86_64 already installed and latest version

Package ncurses-devel-5.7-3.20090208.el6.x86_64 already installed and latest version

Package 1:dbus-devel-1.2.24-7.el6_3.x86_64 already installed and latest version

Package db4-devel-4.7.25-18.el6_4.x86_64 already installed and latest version

Resolving Dependencies

--> Running transaction check

---> Package krb5-devel.x86_64 0:1.10.3-33.el6 will be installed

--> Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-33.el6.x86_64

省略

3.其他程序管理命令

安装本地的rpm包文件,自动通过仓库解决依赖关系,还会检查包来源合法性和完整性


1

yum localinstall  packages

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

[[email protected] dvd]# yum localinstall zsh-4.3.10-8.el6_5.x86_64.rpm 

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Local Package Process

Examining zsh-4.3.10-8.el6_5.x86_64.rpm: zsh-4.3.10-8.el6_5.x86_64

Marking zsh-4.3.10-8.el6_5.x86_64.rpm to be installed

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package zsh.x86_64 0:4.3.10-8.el6_5 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================

 Package    Arch          Version               Repository                         Size

========================================================================================

Installing:

 zsh        x86_64        4.3.10-8.el6_5        /zsh-4.3.10-8.el6_5.x86_64        4.8 M

Transaction Summary

========================================================================================

Install       1 Package(s)

Total size: 4.8 M

Installed size: 4.8 M

Is this ok [y/N]: 

省略信息。。。。。。

本地安装忽略合法性和完整性


1

yum localinstall  packages --nogpgcheck

检查可用升级


1

yum check-update

实例:


1

2

3

[[email protected] dvd]# yum check-update

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

重装程序包


1

yum reinstall packages

列出程序包依赖关系的信息


1

yum deplist packages

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

[[email protected] dvd]# yum deplist python

Loaded plugins: fastestmirror, refresh-packagekit, security

Finding dependencies: 

Loading mirror speeds from cached hostfile

package: python.x86_64 2.6.6-52.el6

  dependency: python-libs(x86-64) = 2.6.6-52.el6

   provider: python-libs.x86_64 2.6.6-52.el6

  dependency: libutil.so.1()(64bit)

   provider: glibc.x86_64 2.12-1.149.el6

  dependency: libdl.so.2()(64bit)

   provider: glibc.x86_64 2.12-1.149.el6

  dependency: rtld(GNU_HASH)

   provider: glibc.x86_64 2.12-1.149.el6

   provider: glibc.i686 2.12-1.149.el6

  dependency: libm.so.6()(64bit)

   provider: glibc.x86_64 2.12-1.149.el6

  dependency: libpython2.6.so.1.0()(64bit)

   provider: python-libs.x86_64 2.6.6-52.el6

  dependency: libpthread.so.0()(64bit)

   provider: glibc.x86_64 2.12-1.149.el6

  dependency: libc.so.6(GLIBC_2.2.5)(64bit)

   provider: glibc.x86_64 2.12-1.149.el6

yum此前执行的命令历史


1

yum history

实例:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

[[email protected] dvd]# yum history

Loaded plugins: fastestmirror, refresh-packagekit, security

ID     | Login user               | Date and time    | Action(s)      | Altered

-------------------------------------------------------------------------------

    19 | root <root>              | 2014-11-26 02:51 | Erase          |    1

    18 | root <root>              | 2014-11-26 02:49 | Downgrade      |    1  <

    17 | root <root>              | 2014-11-25 07:08 | Install        |    1 

    16 | root <root>              | 2014-11-25 06:46 | Install        |    3

    15 | root <root>              | 2014-11-25 04:02 | Install        |    1

    14 | root <root>              | 2014-11-24 13:35 | Install        |    3

    13 | root <root>              | 2014-11-24 13:14 | Install        |    1

    12 | root <root>              | 2014-11-24 12:13 | Install        |    1

    11 | root <root>              | 2014-11-24 12:12 | Install        |   10

    10 | root <root>              | 2014-11-24 12:10 | Install        |   34

     9 | root <root>              | 2014-11-24 11:43 | Install        |    1

     8 | root <root>              | 2014-11-24 11:12 | Install        |   15

     7 | root <root>              | 2014-11-24 11:11 | Install        |    1

     6 | root <root>              | 2014-11-24 08:58 | Install        |   33  <

     5 | root <root>              | 2014-11-21 13:14 | Install        |    1 

     4 | root <root>              | 2014-11-12 20:21 | Install        |    1

     3 | root <root>              | 2014-11-12 19:25 | Install        |    1

     2 | root <root>              | 2014-11-12 11:14 | Install        |    5

     1 | System <unset>           | 2014-11-12 09:42 | Install        |  988

history list

检查本地yum状态


1

yum check

实例:


1

2

3

[[email protected] dvd]# yum check

Loaded plugins: fastestmirror, refresh-packagekit, security

check all

检查需要很长时间。

至此程序包管理工具介绍完结!!!谢谢浏览!!!!

时间: 2024-10-10 13:58:58

Linux下程序包管理之YUM的相关文章

linux下程序包管理

我是一个老实人从来不说实话,我是一个好人从来不说真话,学习linux有段时间了,太高深的东西还不懂,就写一下最近学习的程序包管理吧. 大家都知道在我们学习linux主要是搞运维的,那么我们每天上班的时候就避免不了跟程序包打交道,你不信啊?反正我上班的时候领导总是在我不经意的抬头瞬间给我抛一个媚眼,我立马就领悟了领导的意思,有活要干了,最好不是服务器挂了老天保佑. 有时候我们需要在系统上安装某个软件或者服务(就是程序包),可能需要现在本地磁盘上查一下有没有这些程序包,有的话我们可以直接使用rpm

Linux下程序包管理工具RPM

实验环境: CentOS release 6.6 (Final)  一台 IP地址:172.16.249.230 RPM 是 Red Hat Package Manager 的缩写,本意是Red Hat 软件包管理,顾名思义是Red Hat 贡献出来的软件包管理:在CentOS .Redhat.Fedora .SuSE.YellowDog等主流发行版本,以及在这些版本基础上二次开发出来的发行版采用: 一.RPM程序包管理的用途: 1.可以安装.删除.升级和管理软件:当然也支持在线安装和升级软件:

Linux基础——程序包管理(yum)

yum和rpm的区别:    yum安装可以自动解决依赖关系,根据yum源中所提供的程序包,实现一键安装. yum命令详解格式:yum [OPTIONS] COMMAND PACKAGE_NAME COMMAND    安装:yum install PACKAGE1 [PACKAGE2] [……]    升级:yum update PACKAGE1 [PACKAGE2] [……]    卸载:yum remove | erase PACKAGE1 [PACKAGE2] [……]    查询:yu

2018-3-14Linux系统管理(12) Linux程序包管理(2)yum前端管理工具

我们在之前的章节中讲到了Linux的程序包管理的基础与实现,后面也讲述了RPM包的管理命令实现了管理包的功能,主要用的是rpm命令,那么rpm实现程序管理总结如下:    rpm命令实现程序管理:       安装:-ivh, --nodeps, --replacepkgs       卸载:-e, --nodeps, --replacepkgs       升级:-Uvh, -Fvh, --nodeps, --oldpackage       查询:-q, -qa, -qf, -qi, -qd

程序包管理之yum的用法

程序包管理之yum的用法: yum(全称为 Yellow dog Update Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器. 工作机制: 基于RPM包管理,能够从配置文件中指定服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次性安装所有依赖的程序包,无须繁琐地一次次下载.安装. 当yum接收到用户的安装指令后,yum将会通过读取配置文件中的信息并从指定的远程服务器上下载该程序包,并会分析该程序包的依赖关系并同时下载改程序包所依赖的

linux之程序包管理器(rpm)

linux下的程序包可支持多种工具编写的,如C.C++.PERL等. 但是这种高级语言编写出来的代码是我们人能看懂的,但是计算机是看不懂的,那么计算机怎么执行,怎么了解人要它做什么呢? 这就需要我们做一些转换了,把人能读懂的语言让机器也能识别,这个过程就是由编译器完成的,通常是吧代码语言转换成二进制语言. 过程:预处理.编译.汇编.链接 一个程序的运行大部分时间是离不开库的. 什么是库呢?库也是一种程序,只不过与其他程序不同,库没有执行入口,不能独立运行,只能被其他独立运行的程序调用的时候才能执

linux的程序包管理-rpm

我们知道,程序就是指令加上数据的集合或者称为算法加上数据结构的集合.应用程序以源代码和二进制的形式存在:源代码是包含了整个应用程序的编程语言的所有代码的文本文件:二进制则是将源代码经过一系列的转换操作之后得到的可以直接执行的文件.    使用源代码安装应用程序的步骤为:预处理(预处理器) --> 编译(编译器) --> 字节码 --> 汇编(汇编器) --> 链接(链接器) --> 可以直接执行的二进制程序文件.当我们使用源代码安装应用程序时,不同操作系统的相同操作安装出来的

谢烟客---------Linux之程序包管理yum使用和编译安装

yum命令及仓库创建与配置 YUM 原理 安装.卸载.查询.升级.检查,本地缓存.重装.降级.历史.获取帮助 仓库 变量.事务.URL.开销.镜像.元数据存储方式及组成 createrepo作用.命令.lftp命令 编译安装  目的 原理 开发工具及开发环境 编译后的处理 获取程序包源代码的途径 YUM Redhat二次发行版 Yellow Dog Linux,上使用的yum(Yellowdog Update Modifier),由yellow dog 研发 yum命令的工作原理 1.接收用户命

linux程序包管理 rpm yum 编译

rpm命令:rpm  [OPTIONS]  [PACKAGE_FILE] 安装:-i, --install 升级:-U, --update, -F, --freshen 卸载:-e, --erase 查询:-q, --query 校验:-V, --verify 数据库维护:--builddb, --initdb 安装:rpm {-i|--install} [install-options] PACKAGE_FILE ... rpm  -ivh  PACKAGE_FILE ... GENERAL