Yum 命令

Yum 的全称是 "Yellowdog Updater Modified".

wikipedia链接

yum install安装软件包

如果想安装某个软件, 只需要这样做:

yum install packagename

下面的例子安装了postgresql:

# yum install postgresql.x86_64
Resolving Dependencies
Install 2 Package(s)
Is this ok [y/N]: y
Running Transaction
Installing : postgresql-libs-9.0.4-5.fc15.x86_64 1/2
Installing : postgresql-9.0.4-5.fc15.x86_64 2/2

默认情况下, yum会向你确认要安装的包, 如不想显示这个确认, 可以加一个-y的参数:

# yum -y install postgresql.x86_64

yum remove卸载软件包

卸载软件包也很简单:

# yum remove
postgresql.x86_64
Package postgresql.x86_64 0:9.0.4-5.fc15 will be erased
Is this ok [y/N]: y
Running Transaction
Erasing : postgresql-9.0.4-5.fc15.x86_64 1/1

这个例子是卸载postgresql的.

yum update升级某个软件包

# yum update postgresql.x86_64

这个例子升级了postgresql.

yum search搜索某个软件包

如果你不确定具体要安装的软件包的名字, 可以用yum search来搜索.

下面的例子搜索了那些名字中带有firefox的包:

# yum search firefox
Loaded plugins: langpacks, presto, refresh-packagekit
============== N/S Matched: firefox ======================
firefox.x86_64 : Mozilla Firefox Web browser
gnome-do-plugins-firefox.x86_64
mozilla-firetray-firefox.x86_64
mozilla-adblockplus.noarch : Mozilla Firefox extension
mozilla-noscript.noarch : Mozilla Firefox extension

如果想显示全部的信息, 可以用yum search all.

yum info来显示包的所有信息

当你通过yum search搜索到某个包时, 可以用yum info来查看包的信息:

# yum info samba-common.i686
Loaded plugins: langpacks, presto, refresh-packagekit Available Packages
Name        : samba-common
Arch        : i686
Epoch       : 1
Version     : 3.5.11
Release     : 71.fc15.1
Size        : 9.9 M
Repo        : updates
Summary     : Files used by both Samba servers and clients
URL         : http://www.samba.org/
License     : GPLv3+ and LGPLv3+
Description : Samba-common provides files necessary for both the server and client

上面的例子查看了samba-common的包信息.

扩展阅读

15 Linux Yum Command Examples

results matching ""

    No results matching ""