linux配置本地yum源

[root@node130 rh]# pwd
/opt/rh
[root@node130 rh]# ls
rhel-server-6.4-x86_64-dvd.iso


[root@node130 rh]#mkdir /mnt/cdrom


[root@node130 dev]# mount -v -t iso9660 -o loop  /opt/rh/rhel-server-6.4-x86_64-dvd.iso /mnt/cdrom/
mount: going to use the loop device /dev/loop0
/opt/rh/rhel-server-6.4-x86_64-dvd.iso on /mnt/cdrom type iso9660 (rw,loop=/dev/loop0)

[root@node130 yum.repos.d]# vim rhel-source.repo

[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0

#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


清除原有缓存

[root@node130 cdrom]# yum clean all

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Cleaning repos: rhel-source

Cleaning up Everything

 

获取yum列表

验证yum配置是否成功

[root@node130 cdrom]# yum makecache

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

rhel-source                                                                                                                           | 3.9 kB     00:00 ...

rhel-source/group_gz                                                                                                                  | 204 kB     00:00 ...

rhel-source/filelists_db                                                                                                              | 3.7 MB     00:00 ...

rhel-source/primary_db                                                                                                                | 3.1 MB     00:00 ...

rhel-source/other_db                                                                                                                  | 1.5 MB     00:00 ...

Metadata Cache Create

验证yum配置是否成功
[root@node130 cdrom]# yum grouplist | grep Server

Network Infrastructure Server

Print Server

Web Server

Backup Server

Directory Server

Identity Management Server

Network Storage Server

Server Platform

Server Platform Development

Systems Management Messaging Server support

 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值