1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > RedHat7.4配置yum软件仓库(RHEL7.4)

RedHat7.4配置yum软件仓库(RHEL7.4)

时间:2018-07-28 04:43:09

相关推荐

RedHat7.4配置yum软件仓库(RHEL7.4)

yum软件仓

Yum仓库的作用是进一步简化RPM(redhat package manager) 管理软件的难度以及自动分析所需软件包及其依赖关系的技术

搭建并配置Yum软件仓库的大致步骤如下(RHEL7.4版本为例)

实验准备(以下实验都在VMware中进行)

1、一台rhel7.4主机(已经联网)

2、我这里选择图形化安装

注意:如果你是最小化安装的话,那么请把以下命令中出现的vim改为vi

因为小化安装的rhel是不能用vim编辑器的,只能用vi

只有等配好yum软件仓库以后 运行:yum install vim -y自己安装一个

1、挂载光盘镜像

打开虚拟机设置

挂载镜像(此镜像就是光盘镜像)

桌面会出现一个光盘

2、查看

[root@localhost ~]# lsblk NAMEMAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 20G 0 disk ├─sda18:1 0 1G 0 part /boot└─sda28:2 0 19G 0 part ├─rhel-root 253:0 0 17G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]sdb 8:16 0 10G 0 disk sr0 11:0 1 3.8G 0 rom /run/media/root/RHEL-7.4 Server.x86_64 ---这就是已经挂载商店光盘镜像

3、创建挂载点并写入配置文件

挂载点

[root@localhost ~]# mkdir /media/cdrom

写配置文件

[root@localhost ~]# vim /etc/fstab /dev/cdrom /media/cdrom iso9660 defaults 0 0 ---添加这一行

挂载

[root@localhost ~]# mount -amount: /dev/sr0 is write-protected, mounting read-only

4、写yum仓的配置文件

进入配置目录

[root@localhost ~]# cd /etc/yum.repos.d/

写配置文件

注意:文件名称可随意,但后缀必须为.repo,逐项写入下面的配置参数并保存退出(不要写后面的中文注释)

[root@localhost yum.repos.d]# vim rhel7.repo [rhel] ---Yum软件仓库唯一标识符,避免与其他仓库冲突name=rhel---Yum软件仓库的名称描述baseurl=file:///media/cdrom---提供的方式包括FTP(ftp://..)、HTTP(http://..)、本地(file:///..)enable=1 ---设置此源是否可用;1为可用,0为禁用。gpgcheck=0 ---设置此源是否校验文件;1为校验,0为不校验

保存退出

5、清除yum仓库缓存

[root@localhost yum.repos.d]# yum clean allLoaded plugins: langpacks, product-id, search-disabled-repos, subscription-: managerThis system is not registered with an entitlement server. You can use subscription-manager to register.Cleaning repos: rhelCleaning up everythingMaybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos

6、生成缓存

[root@localhost yum.repos.d]# yum makecache Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-: managerThis system is not registered with an entitlement server. You can use subscription-manager to register.rhel | 4.1 kB00:00(1/5): rhel/group_gz | 137 kB 00:00(2/5): rhel/filelists_db| 3.4 MB 00:00(3/5): rhel/primary_db | 4.0 MB 00:00(4/5): rhel/other_db | 1.5 MB 00:00(5/5): rhel/productid | 1.6 kB 00:00Metadata Cache Created

7、试验是否安装成功

随便安装一个软件

我这里选择安装 tree

[root@localhost ~]# yum install tree -yLoaded plugins: langpacks, product-id, search-disabled-repos, subscription-: managerThis system is not registered with an entitlement server. You can use subscription-manager to register.Resolving Dependencies--> Running transaction check---> Package tree.x86_64 0:1.6.0-10.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================Package Arch Version RepositorySize================================================================================Installing:tree x86_64 1.6.0-10.el7 rhel 46 kTransaction Summary================================================================================Install 1 PackageTotal download size: 46 kInstalled size: 87 kDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : tree-1.6.0-10.el7.x86_64 1/1 Verifying : tree-1.6.0-10.el7.x86_64 1/1 Installed:tree.x86_64 0:1.6.0-10.el7 Complete![root@localhost ~]#

以上就是redhat7.4配置yum软件仓库的办法

同样此方法可用于最小化安装的redhat

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。