Redhat ES 6.3 YUM
实验目标:把redhat6.3的光盘中的Packages RPM包当做yum本地安装源。RPM包放到/yum下。
[root@redhat1 cdrom]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 18G 2.3G 15G 14% /
tmpfs 516M 264K 516M 1% /dev/shm
/dev/sda1 291M 33M 244M 12% /boot
/dev/sr0 47M 47M 0 100% /media/CDROM
/dev/sr1 3.5G 3.5G 0 100% /media/RHEL_6.3 x86_64 Disc 1
2.如果想要挂载在指定的位置。可以用如下命令:
例:
[root@redhat1 cdrom]# mount -t iso9660 -o loop /dev/sr1 /mnt/cdrom
[root@redhat1 cdrom]# cd /mnt/cdrom
[root@redhat1 cdrom]# ls
EFI RELEASE-NOTES-es-ES.html RELEASE-NOTES-si-LK.html
EULA RELEASE-NOTES-fr-FR.html RELEASE-NOTES-ta-IN.html
GPL RELEASE-NOTES-gu-IN.html RELEASE-NOTES-te-IN.html
HighAvailability RELEASE-NOTES-hi-IN.html RELEASE-NOTES-zh-CN.html
images RELEASE-NOTES-it-IT.html RELEASE-NOTES-zh-TW.html
isolinux RELEASE-NOTES-ja-JP.html repodata
LoadBalancer RELEASE-NOTES-kn-IN.html ResilientStorage
media.repo RELEASE-NOTES-ko-KR.html RPM-GPG-KEY-redhat-beta
Packages RELEASE-NOTES-ml-IN.html RPM-GPG-KEY-redhat-release
README RELEASE-NOTES-mr-IN.html ScalableFileSystem
RELEASE-NOTES-as-IN.html RELEASE-NOTES-or-IN.html Server
RELEASE-NOTES-bn-IN.html RELEASE-NOTES-pa-IN.html TRANS.TBL
RELEASE-NOTES-de-DE.html RELEASE-NOTES-pt-BR.html
RELEASE-NOTES-en-US.html RELEASE-NOTES-ru-RU.html
[root@redhat1 cdrom]#
[root@redhat1 cdrom]# cp -rv Packages /yum
warning: createrepo-0.9.8-5.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@redhat1 Packages]
备注:此时可能会提示需要安装其他的基础组件,根据屏幕提示操作。这个部分操作没有做记录。
[root@redhat1 yum.repos.d]# cat rhel.repo
[rhel]
name=redhat6.3
baseurl=file:///yum/Packages
enabled=1
gpgcheck=0
gpgkey=file:///yum/RPM-GPG-KEY-redhat-release
[root@redhat1 yum]# yum search ruby
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rhel | 2.7 kB 00:00 ...
rhel/primary_db | 3.1 MB 00:00 ...
============================== N/S Matched: ruby ===============================
libselinux-ruby.x86_64 : SELinux ruby bindings for libselinux
ruby-devel.i686 : A Ruby development environment
ruby-devel.x86_64 : A Ruby development environment
ruby-irb.x86_64 : The Interactive Ruby
ruby-libs.i686 : Libraries necessary to run Ruby
ruby-libs.x86_64 : Libraries necessary to run Ruby
ruby-qpid.x86_64 : Ruby language client for AMQP
ruby-qpid-qmf.x86_64 : The QPID Management Framework bindings for ruby
ruby-rdoc.x86_64 : A tool to generate documentation from Ruby source files
ruby.x86_64 : An interpreter of object-oriented scripting language
saslwrapper.i686 : Ruby and Python wrappers for the cyrus sasl library.
saslwrapper.x86_64 : Ruby and Python wrappers for the cyrus sasl library.
Name and summary matches only, use "search all" for everything.
2.清除缓存
[root@redhat1 yum]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Cleaning repos: InstallMedia rhel
Cleaning up Everything
[root@redhat1 yum]# yum install bind
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rhel | 2.7 kB 00:00 ...
rhel/primary_db | 3.1 MB 00:00 ...
Setting up Install Process
Package 32:bind-9.8.2-0.10.rc1.el6.x86_64 already installed and latest version
Nothing to do
3.列出已安装的包
root@redhat1 yum]# yum list |grep ruby
Unable to read consumer identity
libselinux-ruby.x86_64 2.0.94-5.3.el6 rhel
ruby.x86_64 1.8.7.352-7.el6_2 rhel
ruby-devel.i686 1.8.7.352-7.el6_2 rhel
ruby-devel.x86_64 1.8.7.352-7.el6_2 rhel
ruby-irb.x86_64 1.8.7.352-7.el6_2 rhel
ruby-libs.i686 1.8.7.352-7.el6_2 rhel
ruby-libs.x86_64 1.8.7.352-7.el6_2 rhel
ruby-qpid.x86_64 0.7.946106-2.el6 rhel
ruby-qpid-qmf.x86_64 0.14-7.el6_2 rhel
ruby-rdoc.x86_64 1.8.7.352-7.el6_2 rhel
[root@redhat1 yum]#
4.安装包bind
[root@redhat1 yum]# yum install bind
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind.x86_64 32:9.8.2-0.10.rc1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
bind x86_64 32:9.8.2-0.10.rc1.el6 rhel 4.0 M
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 4.0 M
Installed size: 7.2 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 : 32:bind-9.8.2-0.10.rc1.el6.x86_64 1/1
Installed products updated.
Verifying : 32:bind-9.8.2-0.10.rc1.el6.x86_64 1/1
Installed:
bind.x86_64 32:9.8.2-0.10.rc1.el6
Complete!
[root@redhat1 yum]#
最后,yum安装完成!