linux 配置本地yum
Posted simplelil
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 配置本地yum相关的知识,希望对你有一定的参考价值。
1.挂载光盘
#挂载光盘 mount /dev/cdrom /mnt/cdrom
2.修改yum.conf, 运行 vi /etc/yum.conf,文件替换成如下内容
[main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=0 plugins=1 installonly_limit=3
3.进入/etc/yum.repos.d 备份rhel-source.repo
cp rhel-source.repo rhel-source.repo.bak
4.修改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 [rhel-source-beta] name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
5.测试yum
yum list
以上是关于linux 配置本地yum的主要内容,如果未能解决你的问题,请参考以下文章