RHEL8 配置光盘源和yum源
生活随笔
收集整理的這篇文章主要介紹了
RHEL8 配置光盘源和yum源
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
一.配置光盤源的方式
1.切換至root賬戶
[zhy@localhost ~]$ su - Password: [root@localhost ~]#2.創(chuàng)建并掛載RHEL光盤到指定目錄
[root@localhost ~]# mkdir /system_source [root@localhost ~]# mount /dev/sr0 /system_source3.編輯redhat.repo文件
[root@localhost ~]# vi /etc/yum.repos.d/redhat.repo內(nèi)容如下:
[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二.配置網(wǎng)絡(luò)yum源的方式
1.切換至yum源配置目錄:
[root@localhost ~]# cd /etc/yum.repos.d/2.創(chuàng)建RHEL-Appstream.repo文件:
[root@localhost yum.repos.d]# vi RHEL-Appstream.repo內(nèi)容如下:
[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.創(chuàng)建RHEL-Base.repo文件:
[root@localhost yum.repos.d]# vi RHEL-Base.repo內(nèi)容如下:
[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.創(chuàng)建RHEL-Epel.repo文件:
[root@localhost yum.repos.d]# vi RHEL-Epel.repo內(nèi)容如下:
[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重啟網(wǎng)絡(luò):
[root@localhost ~]# systemctl restart network 《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的RHEL8 配置光盘源和yum源的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Redhat、CentOS进单用户模式进
- 下一篇: RHEL7切换Firewall为ipta