Redhat 6.2 Linux修改yum源免费使用CentOS源

简介:

      在没有光盘的情况,需要安装软件包,就要用到共网的yum源来安装了。

      Redhat linux 默认是安装了yum软件的,但是由于激活认证的原因让redhat无法直接进行yum安装一些软件,如果我们需要在redhat下直接yum安装软件,我们只用把yum的源修改成centos的就好了,然后把源里面的变量全部修改成实际的值,这样就能使用yum直接安装我们需要的软件了。(文章还有一部分,未写完的。)

使用说明

1、到http://mirrors.163.com的 centos帮助文档 中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d中

Centos 5     wget  http://mirrors.163.com/.help/CentOS5-Base-163.repo

Centos 6     wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

操作如下:

235743835.png

2、首先备份/etc/yum.repos.d/CentOS-Base.repo

000041359.png

 

3、编辑CentOS6-Base-163.repo文件,将其中的$releasever更改为centos的版本号,如果是RedHat 6.2 X86_64为例“baseurl=http://mirrors.163.com/centos/6.2/os/x86_64/”本文档是以RedHat 6.2 32位为例所写!

[base]

name=CentOS-$releasever - Base - 163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates 

[updates]

name=CentOS-$releasever - Updates - 163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras - 163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever- Plus - 163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib - 163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

编辑完后保存,运行:

yum clean all              清除原有缓存 

yum makecache        获取yum列表

 





      本文转自ling118 51CTO博客,原文链接:http://blog.51cto.com/meiling/1248839,如需转载请自行联系原作者



相关文章
|
16天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
37 0
|
16天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
54 0
|
24天前
|
Linux
Linux中centos桌面消失网络图标
Linux中centos桌面消失网络图标
13 0
|
18天前
|
Ubuntu Linux 编译器
【Linux】4. 开发工具的使用(yum/vim)
【Linux】4. 开发工具的使用(yum/vim)
44 2
|
1月前
|
安全 Linux 网络安全
如何在 VM 虚拟机中安装 Red Hat Enterprise Linux 9.3 操作系统保姆级教程(附链接)
如何在 VM 虚拟机中安装 Red Hat Enterprise Linux 9.3 操作系统保姆级教程(附链接)
92 0
|
16天前
|
Linux 网络安全
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
25 1
|
16天前
|
关系型数据库 MySQL Linux
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
19 0
|
2天前
|
人工智能 数据可视化 Linux
【linux基础(五)】Linux中的开发工具(上)---yum和vim
【linux基础(五)】Linux中的开发工具(上)---yum和vim
|
2天前
|
Linux
centos 6.5安装yum
centos 6.5安装yum
17 0
|
16天前
|
缓存 Linux
linux centos7 挂载本地iso yum源
linux centos7 挂载本地iso yum源
73 0