rhel7本地仓库搭建
作者:互联网
- 挂在本地yum源
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 59G 0 part
├─rhel-root 253:0 0 37G 0 lvm /
├─rhel-swap 253:1 0 3.9G 0 lvm [SWAP]
└─rhel-home 253:2 0 18.1G 0 lvm /home
sr0 11:0 1 55.9M 0 rom /run/media/chen/VMware Tools
//先检查是否挂载本地yum源
[root@localhost chen]# mkdir /mnt/cdrom
[root@localhost chen]# mount /dev/sr0 /mnt/cdrom/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 59G 0 part
├─rhel-root 253:0 0 37G 0 lvm /
├─rhel-swap 253:1 0 3.9G 0 lvm [SWAP]
└─rhel-home 253:2 0 18.1G 0 lvm /home
sr0 11:0 1 55.9M 0 rom /mnt/cdrom
//已挂载
2、编辑本地仓库
[root@localhost chen]# > /etc/yum.repos.d/czj.repo
[root@localhost chen]# vi /etc/yum.repos.d/czj.repo
[czj]
name=czj
enabled=1
gpgcheck=0
baseurl=file:///mnt/cdrom/
[root@localhost chen]# yum repolist
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
czj | 4.3 kB 00:00
(1/2): czj/group_gz | 146 kB 00:00
(2/2): czj/primary_db | 4.2 MB 00:00
源标识 源名称 状态
czj czj 5,152
repolist: 5,152
标签:rhel7,00,仓库,czj,lvm,chen,root,localhost,搭建 来源: https://blog.csdn.net/qq_40167652/article/details/117390890