使用Yum管理软件包

问题
1)利用yum repolist列出可用Yum仓库信息
2)利用Yum安装bind
3)利用Yum卸载bind
4)利用yum search查询与httpd相关的包
5)利用yum info查询firefox包描述信息
方案
Yum在使用方面,几乎rpm能够做到的事情,Yum也能够做到。此外Yum还具备自动解决依赖关系的功能。
常用的Yum操作:
yum install 软件名:安装一个软件包
yum remove 软件名:卸载一个软件包
步骤
实现此案例需要按照如下步骤进行。
步骤一:利用yum repolist列出可用Yum仓库信息
命令操作如下所示:
[root@localhost /]# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
rhel-6 Red Hat Enterprise Linux 6 3,690
repolist: 3,690
[root@localhost /]#
步骤二:利用Yum安装bind
命令操作如下所示:

[root@localhost /]# yum -y remove bind
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved
……
[root@localhost /]# yum -y install bind
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package          Arch               Version                                  Repository          Size
=======================================================================================================
Installing:
 bind             x86_64             32:9.8.2-0.17.rc1.el6_4.6                rhel-6             4.0 M
……

步骤三:利用Yum卸载bind
命令操作如下所示:
[root@localhost /]# yum -y remove bind
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Remove Process
Resolving Dependencies
–> Running transaction check
—> Package bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6 will be erased
–> Finished Dependency Resolution

Dependencies Resolved
……
[root@localhost ~]#
步骤四:利用yum search查询与httpd相关的包
命令操作如下所示:
[root@localhost /]# yum search httpd
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
========================================= N/S Matched: httpd ==========================================
httpd.x86_64 : Apache HTTP Server
httpd-devel.i686 : Development interfaces for the Apache HTTP server
httpd-devel.x86_64 : Development interfaces for the Apache HTTP server
httpd-manual.noarch : Documentation for the Apache HTTP server
httpd-tools.x86_64 : Tools for use with the Apache HTTP Server
mod_dav_svn.x86_64 : Apache httpd module for Subversion server
mod_dnssd.x86_64 : An Apache HTTPD module which adds Zeroconf support

Name and summary matches only, use “search all” for everything.
[root@localhost /]#
步骤四:利用yum info查询firefox包描述信息
命令操作如下所示:
root@localhost /]# yum info firefox
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Installed Packages
Name : firefox
Arch : x86_64
Version : 17.0.10
Release : 1.el6_4
Size : 29 M
Repo : installed
From repo : anaconda-RedHatEnterpriseLinux-201311111358.x86_64
Summary : Mozilla Firefox Web browser
URL : http://www.mozilla.org/projects/firefox/
License : MPLv1.1 or GPLv2+ or LGPLv2+
Description : Mozilla Firefox is an open-source web browser, designed for standards
: compliance, performance and portability.

Available Packages
Name : firefox
Arch : i686
Version : 17.0.10
Release : 1.el6_4
Size : 25 M
Repo : rhel-6
Summary : Mozilla Firefox Web browser
URL : http://www.mozilla.org/projects/firefox/
License : MPLv1.1 or GPLv2+ or LGPLv2+
Description : Mozilla Firefox is an open-source web browser, designed for standards
: compliance, performance and portability.

[root@localhost /]#

你可能感兴趣的:(学习)