发布时间: 2018-02-25 23:26:53
YUM是在Fedora和RedHat以及SUSE中基于rpm的软件包管理器,它可以使系统管理人员交互和自动化地更细与管理RPM软件包,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。
RHEL7中的RedHat的YUM需要注册付费才能使用,本文简单介绍一下使用iso镜像文件建立本地YUM源;
Step1:上传RHEL7的镜像文件到/iso目录;
[root@rhel7-01 ~]# cd /iso
[root@rhel7-01 iso]# ls -l
total 3948548
-rw-r--r--. 1 root root 4043309056 Feb 25 20:46 rhel-server-7.2-x86_64-dvd.iso
[root@rhel7-01 iso]#
Step2:mount这个iso文件到/mnt/iso目录;
[root@rhel7-01 ~]# mount /iso/rhel-server-7.2-x86_64-dvd.iso /mnt/iso
mount: /dev/loop0 is write-protected, mounting read-only
[root@rhel7-01 ~]#
Step3:新建repo文件;
[root@rhel7-01 ~]# cd /etc
[root@rhel7-01 etc]# cd yum.repos.d/
[root@rhel7-01 yum.repos.d]# vim rhel7_local.repo
Step4:编辑repo文件,指定YUM路径;
[rhel7_local]
name = rhel7_local
baseurl = file:///mnt/iso
enable = 1
gpgcheck = 0
Step5:建立YUM缓存数据库,加快后续软件安装速度;
[root@rhel7-01 ~]# yum makecache
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7_local | 4.1 kB 00:00:00
(1/4): rhel7_local/group_gz | 136 kB 00:00:00
(2/4): rhel7_local/filelists_db | 3.2 MB 00:00:00
(3/4): rhel7_local/primary_db | 3.6 MB 00:00:00
(4/4): rhel7_local/other_db | 1.4 MB 00:00:00
Metadata Cache Created
Step6:编辑fstab,实现开机自动mount;
[root@rhel7-01 ~]# cd /etc
[root@rhel7-01 etc]# vim fstab
Step7:添加最后一行内容,开机自动mount,需要指明iso9660文件类型;
/iso/rhel-server-7.2-x86_64-dvd.iso /mnt/iso iso9660 defaults 0 0
Step8:确认fstab有效性和正确性;
[root@rhel7-01 ~]# mount -a
[root@rhel7-01 ~]# mount | grep iso
/iso/rhel-server-7.2-x86_64-dvd.iso on /mnt/iso type iso9660 (ro,relatime)
Step9:本地YUM源生效后,就能直接使用yum install 实现软件的快速安装部署;
[root@rhel7-01 ~]# yum install vsftpd* -y
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Installing:
vsftpd x86_64 3.0.2-10.el7 rhel7_local 167 k
Transaction Summary
========================================================================================================
Install 1 Package
Total download size: 167 k
Installed size: 347 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : vsftpd-3.0.2-10.el7.x86_64 1/1
Verifying : vsftpd-3.0.2-10.el7.x86_64 1/1
Installed:
vsftpd.x86_64 0:3.0.2-10.el7
Complete!
王亦军 老师 上海腾科
2018.02.25 提交上传
上一篇: {思科 CCNA-SEC }由生成树引发的端口五种状态
下一篇: {红帽 RHCA}Docker生态系统