安装了Red Hat Enterprise Linux 6.4 可运行系统,并且是成功验证系统。
挂载光盘,配置yum 源,并通过yum 安装更新软件。
你想要将你的系统连接到专用yum 库来安装和升级软件。
1、配置yun
2、尝试使用yum 的基本语法
3、使用yum 安装wireshark
[root@desktopX ~]# uname -a
Linux cz2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64GNU/Linux
[root@desktopX ~]# cat /etc/redhat-release
Red HatEnterprise Linux Server release 6.4 (Santiago)
以root 用户的身份登录系统。如果你使用的是图形化环境,点击[应用程序
(Applications)]->[附件(System Tools)]->[终端(Terminal)]来打开终端:
或者以putty,SecureCRT远程打开
[root@desktopX ~]# mount /dev/cdrom /media
mount:block device /dev/sr0 is write-protected, mounting read-only
#mount查看一下
/dev/sda2on / type ext4 (rw)
proc on/proc type proc (rw)
sysfs on/sys type sysfs (rw)
devpts on/dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on/dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1on /boot type ext4 (rw)
/dev/sda3on /home type ext4 (rw)
none on/proc/sys/fs/binfmt_misc type binfmt_misc (rw)
vmware-vmblockon /var/run/vmblock-fuse type fuse.vmware-vmblock(rw,nosuid,nodev,default_permissions,allow_other)
sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemonon /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sr0 on /media type iso9660 (ro) //挂载成功
[root@desktopX ~]# cd /etc/yum.repos.d/
[root@desktopX yum.repos.d]# ls
packagekit-media.repo rhel-source.repo
在源文件内容做如下创建一个新的*.repo文件
[root@desktopX yum.repos.d]#vi Server.repo
[root@desktopX yum.repos.d]# cat server.repo //查看编辑内容
[Server]
name=RHEL local Server
baseurl=file:///media/Server
enabled=1
gpgcheck=1 //gpgcheck的参数可以“0,1”如果是零就不扫描下面的文件
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
注意:如果需要检查软件签名,请设置gpgcheak=1。关于baseurl,如果yum 源在本
地,则使用file://本地地址;如果yum 源在远端,则应该使用http://或ftp://。
[root@desktopX ~]# cd /media/Packages/
[root@desktopX Packages]#rpm -vih createrepo*
warning:createrepo-0.9.9-17.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key IDfd431d51: NOKEY
error:Failed dependencies:
python-deltarpm is needed bycreaterepo-0.9.9-17.el6.noarch
注意:createrepo 是用来创建yum 数据库的软件包。
[root@desktopX ~]# cd /etc/yum.repo.d
[root@desktopX yum.repo.d]# yumclean all
Loadedplugins: rhnplugin, security
……
注意:每次修改yum 数据库的内容,就需要清除客户机缓存信息,否则会出现不可预
料的错误。
6、刷新yum 源列表:
[root@desktopX yum.repo.d]# yumlist
Loadedplugins: rhnplugin, security
Thissystem is not registered with RHM.
RHMsupport will be disabled.
……
7、使用基本的yum命令搜索软件wireshark:
[root@cz yum.repos.d]# yum search wireshark
Loadedplugins: product-id, refresh-packagekit, security, subscription-manager
Thissystem is not registered to Red Hat Subscription Management. You can usesubscription-manager to register.
============================N/S Matched: wireshark ============================
wireshark-gnome.x86_64: Gnome desktop integration for wireshark and
: wireshark-usermode
wireshark.i686: Network traffic analyzer
wireshark.x86_64: Network traffic analyzer
Name and summary matches only, use "searchall" for everything.
8、查看wireshark 的详细信息:
[root@ desktopX yum.repos.d]# yum info wireshark
Loadedplugins: product-id, refresh-packagekit, security, subscription-manager
Thissystem is not registered to Red Hat Subscription Management. You can usesubscription-manager to register.
AvailablePackages
Name : wireshark
Arch : i686
Version : 1.2.15
Release : 2.el6_2.1
Size : 9.9 M
Repo : Server
Summary : Network traffic analyzer
URL : http://www.wireshark.org/
License : GPL+
Description: Wireshark is a network traffic analyzer for Unix-ish operating
: systems.
:
: This package lays base forlibpcap, a packet capture and filtering
: library, contains command-lineutilities, contains plugins and
: documentation for wireshark. Agraphical user interface is
: packaged separately to GTK+package.
Name : wireshark
Arch : x86_64
Version :1.2.15
Release : 2.el6_2.1
Size : 11 M
Repo : Server
Summary : Network traffic analyzer
URL : http://www.wireshark.org/
License : GPL+
Description: Wireshark is a network traffic analyzer for Unix-ish operating
: systems.
:
: This package lays base forlibpcap, a packet capture and filtering
: library, contains command-lineutilities, contains plugins and
: documentation for wireshark. Agraphical user interface is
: packaged separately to GTK+package.
9、使用yum命令安装wireshark:
[root@cz yum.repos.d]# yum install wireshark
Loadedplugins: product-id, refresh-packagekit, security, subscription-manager
Thissystem is not registered to Red Hat Subscription Management. You can usesubscription-manager to register.
Settingup Install Process
ResolvingDependencies
-->Running transaction check
--->Package wireshark.x86_64 0:1.2.15-2.el6_2.1 will be installed
-->Processing Dependency: libsmi.so.2()(64bit) for package:wireshark-1.2.15-2.el6_2.1.x86_64
-->Running transaction check
--->Package libsmi.x86_64 0:0.4.8-4.el6 will be installed
yum 在安装过程中会自动处理依赖关系,遇到缺少的软件包会自动下载并安装。当屏幕出现Complete 时,表示安装完成。
yum 命令是快速安装软件的命令,他能解决RPM安装时出现的多重依赖包的关系,而却,yum的命令功能要比RPM安装命令的功能个强大。
本文出自 “陈州-菜鸟之路” 博客,请务必保留此出处http://chenzhou312.blog.51cto.com/8139578/1542449
原文地址:http://chenzhou312.blog.51cto.com/8139578/1542449