yum 在 rhel 6.x 下的本地配置
2016-05-28 16:37
375 查看
yum 安装软件远比 rpm 使用方便,下面简单描述下 rhel 6.x 的yum 配置
# cd /mnt
# mkdir cdrom
# mount /dev/cdrom /mnt/cdrom
# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$
4000
basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
红色背景说明有两个方法配置yum源,第一种是在 /etc/yum.conf 末尾直接添加,
第二种是在 /etc/yum.repos.d/ 目录下创建 .repo 文件。
第一种方法:
# vi /etc/yum.conf
追加如下内容
[base]
name=base yum
baseurl=file:///mnt/cdrom
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[updates-released]
name= updates-released yum
baseurl=file:///mnt/cdrom
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
第二种方法:
# cd /etc/yum.repos.d/
# cp rhel-source.repo rhel-source.repo.bak
# vi rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
gpgkey=file:///etc/cdrom/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
# cd /mnt
# mkdir cdrom
# mount /dev/cdrom /mnt/cdrom
# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$
4000
basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
红色背景说明有两个方法配置yum源,第一种是在 /etc/yum.conf 末尾直接添加,
第二种是在 /etc/yum.repos.d/ 目录下创建 .repo 文件。
第一种方法:
# vi /etc/yum.conf
追加如下内容
[base]
name=base yum
baseurl=file:///mnt/cdrom
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[updates-released]
name= updates-released yum
baseurl=file:///mnt/cdrom
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
第二种方法:
# cd /etc/yum.repos.d/
# cp rhel-source.repo rhel-source.repo.bak
# vi rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
gpgkey=file:///etc/cdrom/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
相关文章推荐
- 广义表
- POJ1062-昂贵的聘礼
- Bug分支
- Android菜单详解(二)——创建并响应选项菜单
- javaScript 工作必知(三) String .的方法从何而来?
- Linux下,解决LVM分区中unknown device的bug
- 练习三 1007
- Codeforces 464E The Classic Problem (线段树+哈希)
- 最小生成树-----Prim算法与Kruskal算法(未完
- linux中There are unfinished transactions remaining
- 揭开RecyclerView的神秘面纱(三):操作数据及添加分割线
- 《C Premer Plus(第五版)中文版》部分读书笔记
- js实现CkeckBox全选与反选
- HibernateTemplate 查询
- 总是找不到R文件 转义字符详解
- 1043. 输出PATest(20)
- 自定义View利用手势检测实现图片放大缩小
- java heap 和 stack 初识
- 淘宝可伸缩高性能互联网架构HSF
- github初识1