在Centos 5.6上修改yum 源

简介:

yum源设置路径 
/etc/yum.repos.d/ 
新建或复制一个文件  后缀名为repo再倒入key即可 
以中国科技大学源为例 
新建ustc.repo 
内容为 
#centos-ustc-edu-cn.repo 

# 中国科技大学,速度不错 
# rpm --import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 

# This file uses a new mirrorlist system developed by Lance Davis for CentOS. 
# The mirror system uses the connecting IP address of the client and the 
# update status of each mirror to pick mirrors that are updated to and 
# geographically close to the client. You should use this for CentOS updates 
# unless you are manually picking other mirrors. 

# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead. 


[base] 
name=CentOS-5 - Base 
repo=os 
baseurl=http://centos.ustc.edu.cn/centos/5.6/os/$basearch/ 
gpgcheck=1 
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
[update] 
name=CentOS-5 - Updates 
baseurl=http://centos.ustc.edu.cn/centos/5.6/updates/$basearch/ 
gpgcheck=1 
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
[addons] 
name=CentOS-5 - Addons 
baseurl=http://centos.ustc.edu.cn/centos/5.6/addons/$basearch/ 
gpgcheck=1 
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
[extras] 
name=CentOS-5 - Extras 
baseurl=http://centos.ustc.edu.cn/centos/5.6/extras/$basearch/ 
gpgcheck=1 
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
[centosplus] 
name=CentOS-5 - Plus 
baseurl=http://centos.ustc.edu.cn/centos/5.6/centosplus/$basearch/ 
gpgcheck=1 
enabled=0 
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
[contrib] 
name=CentOS-5 - Contrib 
baseurl=http://centos.ustc.edu.cn/centos/5.6/contrib/$basearch/ 
gpgcheck=1 
enabled=0 
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
导入key rpm --import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5 
源都添加完了之后,再装个插件,yum install yum-fastestmirror -y,这个会自动选择快的那个源。 
如果我在那个目录里放了很多源,怎么知道当前用的是那个呢?如果你没有改yum.conf,那么看/var/cache/yum/文件夹里的一个time开头的文件,就知道了 
如果在使用yum install安装找不到某些包的时候,可以使用下面办法试试 
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm 
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

我原来使用系统默认的yum源,能够使用,但感觉不太快,好些软件找不到,所以在网上搜索新的yum源,找到网友发布的:

 

都是使用这个时,出现了一个小问题,

我是直接在windows 下复制上面的源内容放在记事里保存的,保存时没有注意编码保存成gb2312的了,复制到centos里系统不认,出现好多的乱码,

最后用centos的记事一打开,另存为UTF-8的才认出来

这个yum可以使用,

另外出现这个问题,也是转换系统里常出来的

本文转自孤舟夜航之家博客51CTO博客,原文链接http://blog.51cto.com/cysky/559154如需转载请自行联系原作者


cysky

相关文章
|
2月前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
277 25
|
3月前
|
缓存 Linux
CentOS-6的iso下载地址镜像yum源
通过上述步骤,您可以成功下载CentOS 6的ISO镜像文件,并配置适用于CentOS 6的YUM源。尽管CentOS 6已经停止更新,但使用这些镜像和YUM源配置,可以继续在需要的环境中使用和维护CentOS 6系统。
1385 20
|
3月前
|
Linux
CentOs9 yum源出现404问题
CentOs9-stream yum源出现404问题
|
4月前
|
缓存 Linux
解决CentOS 7停止更新后yum源失效问题【图文教程】
以上步骤完成后,你的 CentOS 7 系统就会使用阿里云的 yum 源,更换yum以后就可以正常使用啦。
3882 2
|
6月前
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
8797 8
|
8月前
|
关系型数据库 MySQL Linux
在CentOS上使用yum安装与使用MySQL
在CentOS操作系统上使用yum包管理器安装和配置MySQL数据库的详细步骤,包括下载MySQL的yum源配置、安装MySQL服务、启动和停止服务、设置开机自启动、获取临时密码、修改root用户密码、授权用户以及处理相关问题。同时,文章还包含了一些操作的截图,帮助用户更直观地理解安装和配置过程。
2387 0
在CentOS上使用yum安装与使用MySQL
|
8月前
|
网络协议 Linux
CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org;"之解决办法(换源)
CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org; Name or service not known“之解决办法(换源)
|
7月前
|
Linux
centos使用阿里的yum源
centos使用阿里的yum源
|
8月前
|
缓存 Linux 网络安全
解决 CentOS 7 官方 yum 仓库无法使用的最佳实践
【8月更文挑战第18天】若 CentOS 7 的官方 YUM 仓库无法使用,可按以下步骤解决: 1. **检查网络连接**: - 确认服务器能正常上网,可通过访问外部网站或网络诊断测试。 - 检查防火墙设置,避免其阻挡 YUM 的网络访问。 2. **检查 YUM 配置**: - 核实 `/etc/yum.repos.d/` 下的 `CentOS-Base.repo` 文件中仓库地址正确无误。 - 确认配置文件内的 `enabled` 选项设为 `1` 以启用仓库。
3154 0
|
8月前
|
Linux Docker 容器
在CentOS操作系统上使用yum安装/使用/卸载Docker容器引擎
在CentOS操作系统上安装、配置、使用和卸载Docker容器引擎的详细步骤,包括配置Docker镜像加速的方法。
675 0

热门文章

最新文章

下一篇
oss创建bucket