yum 软件仓库的搭建
[root@localhost ~]# df 1.查看系统资源挂载的目录 eg:/run/media/root/RHEL-8-0-0-BaseOS-x86_64
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 910528 0 910528 0% /dev
tmpfs 924700 0 924700 0% /dev/shm
tmpfs 924700 9884 914816 2% /run
tmpfs 924700 0 924700 0% /sys/fs/cgroup
/dev/nvme0n1p3 8181760 4005548 4176212 49% /
/dev/nvme0n1p1 199328 141296 58032 71% /boot
tmpfs 184940 16 184924 1% /run/user/42
tmpfs 184940 3488 181452 2% /run/user/0
/dev/sr0 6935944 6935944 0 100% /run/media/root/RHEL-8-0-0-BaseOS-x86_64
[root@localhost ~]# cd /etc/yum.repos.d/ 2.需在/etc/yum.repos.d/目录下编辑.repo配置文件
[root@localhost yum.repos.d]# vim westos.repo
[BaseOS]name=rhel8.0 BaseOS
baseurl=file:///run/media/root/RHEL-8-0-0-BaseOS-x86_64/BaseOS
gpgcheck=0
enabled=1
[AppStream] **仓库名称**
name=rhel8.0 AppStream **仓库描述**
baseurl=file:///run/media/root/RHEL-8-0-0-BaseOS-x86_64/AppStream **资源路径**
gpgcheck=0 **软件包授权检测开关**
enabled=1 **软件包授权码**
[root@localhost yum.repos.d]# yum repolist **在rhel8中 yum dnf 都可以用,自行尝试 dnf repolist**
**yum repolist 列出仓库信息,看搭建的yum软件仓库是否成功**
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'AppStream' is missing name in configuration, using id.
AppStream 83 MB/s | 5.3 MB 00:00
rhel8.0 BaseOS 85 MB/s | 2.2 MB 00:00
repo id repo name status
AppStream 4,672
BaseOS rhel8.0 BaseOS 1,658
**如上。yum软件仓库搭建成功**