1+X云计算平台运维与开发认证 YUM源管理

时间:2025-02-18 15:47:02

YUM源管理

博主用的自己的镜像

1 当前有一个centos7.的镜像文件,使用这个文件配置yum源,要求将这个镜像文件挂载在/opt/cenos目录。还存在一个ftp源,IP地址为192.168.100.200,ftp共享的目录为/opt,/opt目录中存在一个iaas目录(该目录下存在一个repodata目录)请问如何配置自己的文件,使得可以使用这两个地方的软件包,安装文件。请将文件的内容以文本形式提交到答题框。

创建/opt/cenos目录

[root@localhost ~]# cd ../opt
[root@localhost opt]# mkdir centos
[root@localhost opt]# ls
centos  rh
  • 1
  • 2
  • 3
  • 4

关闭防火墙

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system//.
Removed symlink /etc/systemd/system/..
  • 1
  • 2
  • 3
  • 4
[root@localhost ~]# vim /etc/selinux/config
  • 1

注释:将SELINUX=enforcing改成SELINUX=Permissive

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
  • 1
  • 2
  • 3

挂载镜像 已成功挂载

[root@localhost ~]# mount -o loop CentOS-7-x86_64 /opt/centos
mount: /root/CentOS-7-x86_64 已经挂载
  • 1
  • 2

编辑文件

[root@localhost ~]# vim /etc//
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[iaas]
name=iaas
baseurl=ftp://192.168.100.200/iaas
enabled=1
gpgcheck=0

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

查看文件

[root@localhost ~]# cat /etc//
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[iaas]
name=iaas
baseurl=ftp://192.168.100.200/iaas
enabled=1
gpgcheck=0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11