RHEL8 配置光盘源和yum源
生活随笔
收集整理的这篇文章主要介绍了
RHEL8 配置光盘源和yum源
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
一.配置光盘源的方式
1.切换至root账户
[zhy@localhost ~]$ su - Password: [root@localhost ~]#2.创建并挂载RHEL光盘到指定目录
[root@localhost ~]# mkdir /system_source [root@localhost ~]# mount /dev/sr0 /system_source3.编辑redhat.repo文件
[root@localhost ~]# vi /etc/yum.repos.d/redhat.repo内容如下:
[iso-base] name=base_file baseurl=file:///system_source/BaseOS enabled=1 gpgcheck=0 gpgkey=file:///system_source/RPM-GPG_KEY-release [iso-app] name=appfile baseurl=file:///system_source/AppStream enabled=1 gpgcheck=0 gpgkey=file:///system_source/RPM-GPG_KEY-release4.清缓存:
[root@localhost ~]# yum clean all5.安装gcc包测试:
[root@localhost ~]# yum install gcc二.配置网络yum源的方式
1.切换至yum源配置目录:
[root@localhost ~]# cd /etc/yum.repos.d/2.创建RHEL-Appstream.repo文件:
[root@localhost yum.repos.d]# vi RHEL-Appstream.repo内容如下:
[AppStream] name=CentOS-$releasever - AppStream baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial3.创建RHEL-Base.repo文件:
[root@localhost yum.repos.d]# vi RHEL-Base.repo内容如下:
[BaseOS] name=CentOS-$releasever - Base baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial4.创建RHEL-Epel.repo文件:
[root@localhost yum.repos.d]# vi RHEL-Epel.repo内容如下:
[epel] name=CentOS-$releasever - Epel baseurl=http://mirrors.aliyun.com/epel/8/Everything/$basearch enabled=1 gpgcheck=0测试:
[root@localhost yum.repos.d]# yum install gcc三.配置ip
安装network-scripts:
[root@localhost ~]# yum install network-scripts编辑文件修改ip
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens160重启网络:
[root@localhost ~]# systemctl restart network 《新程序员》:云原生和全面数字化实践50位技术专家共同创作,文字、视频、音频交互阅读总结
以上是生活随笔为你收集整理的RHEL8 配置光盘源和yum源的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: Redhat、CentOS进单用户模式进
- 下一篇: RHEL7切换Firewall为ipta