YUM更换源--yum找不到安装包(转)
公司提供的CentOS VM中,/etc/yum.repos.d 下 只有一个build.repo,其中提供的yum 源只有公司内部的几个源,很多包在这些源中都找不到。于是要添加别的源,下面的帖子中介绍了如何在CentOS中添加中科大、搜狐和163的yum源:http://www.husw.net/blog/post/1386/。摘录如下:
本文章介绍的yum源支持的版本是CentOS 6系列,理论上支持RHEL6系列。
更新方法如下:
先进入yum源配置目录
备份系统自带的yum源
下载其他更快的yum源
中科大的yum源:
163的yum源:
sohu的yum源
更新完yum源后,建议更新一下,使操作立即生效
Loaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepository contrib is listed more than once in the configurationLoading mirror speeds from cached hostfile* addons: mirrors.163.com* base: mirror.metrocast.net* extras: mirror.beyondhosting.net* fasttrack: centos.vipernetworksystems.com* updates: centos.vipernetworksystems.comhttp://mirrors.163.com/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"Trying other mirror.http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"Trying other mirror.Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again
#[addons]#name=CentOS-$releasever - Addons - 163.com#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/#gpgcheck=1#pgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#[addons]#name=CentOS-$releasever - Addons - sohu.com#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons#baseurl=http://mirrors.sohu.com/centos/$releasever/addons/$basearch/#gpgcheck=1#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5CentOS-Base-sohu.repo
vim-X11.x86_64 : The VIM version of the vi editor for the X Window Systemvim-common.x86_64 : The common files needed by any version of the VIM editorvim-enhanced.x86_64 : A version of the VIM editor which includes recent enhancementsvim-minimal.x86_64 : A minimal version of the VIM editor
使用 yum 程序安装所需开发包(以下为标准的rpm包名称)
yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel
zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel
freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel mysql-devel net-snmp-devel
curl-devel perl-DBI
执行yum源更新
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum update
注意:
更新为163的源后,yum的时候报错:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5.
解决方案:vi /etc/yum.repos.d/CentOS-Base.repo
把文件里所有的RPM-GPG-KEY-CentOS-5更改为RPM-GPG-KEY-CentOS-6就可以了
vim 替换 :%s/RPM-GPG-KEY-CentOS-5/RPM-GPG-KEY-CentOS-6
YUM更换源--yum找不到安装包(转)的更多相关文章
- Linux系列教程(十三)——Linux软件包管理之源码包、脚本安装包
上篇博客我们讲解了网络yum源和光盘yum源的搭建步骤,然后详细介绍了相关的yum命令,yum 最重要是解决了软件包依赖性问题.在安装软件时,我们使用yum命令将会简单方便很多.我们知道yum命令只能 ...
- Linux软件包管理之源码包、脚本安装包
目录 1.源码包和RPM包的区别 RPM包和源码包默认安装位置: 由于安装位置不同带来的影响 2.源码包安装 ①.安装准备 ②.安装注意事项 ③.安装源码包 3.源码包卸载 4.脚本安装包 5.总结 ...
- YUM更换源(1)--yum找不到安装包
公司提供的CentOS VM中,/etc/yum.repos.d 下 只有一个build.repo,其中提供的yum 源只有公司内部的几个源,很多包在这些源中都找不到.于是要添加别的源,下面的帖子中介 ...
- yum更换源配置
今天安装mysql5.7的时候出现了点问题,最后更换yum源解决了,把这个记录一下 yum源配置(阿里云源) 1) 安装wget yum install -y wget 2) 备份/etc/yum.r ...
- Linux(CentOS7)yum安装卸载命令,离线下载安装包
一.Linux版本 二.yum安装 比如安装vim编辑器,y是自动应答,即默认一路确认,不用中途确认 yum install -y vim 三.yum卸载 比如卸载掉刚刚安装的vim yum eras ...
- centos7 下解决mysql-server找不到安装包问题
第一步:安装从网上下载文件的wget命令 [root@master ~]# yum -y install wget 第二步:下载mysql的repo源 [root@master ~]# wget ht ...
- linux 源码包之脚本安装包的安装
脚本安装包 脚本安装包并不是独立的软件包类型,常见的实际是源码包.是人为地把安装过程写成了自动安装脚本,只要执行脚本,定义简单的参数,就可以完成安装.非常类似于windows软件的安装方式.在linu ...
- 解决rhel相关系统下yum找不到安装包的解决方法
最近重新安装了Linux,用的版本是CentOS 5.1.但老是出现很多包找不到的情况. [root@toughhou /]# yum install rlwrap Loaded plugins: f ...
- 更换pip源,解决pip install安装包慢的问题
而pip是很强大的Python包安装工具,但是由于国外官方pypi经常被墙,导致不可用,所以最好是将使用的pip源更换一下,这样就能解决被墙导致的装不上库的问题.网上有很多可用的源,例如豆瓣:http ...
随机推荐
- 【solr专题之三】Solr常见异常
1.RemoteSolrException: Expected mime type application/octet-stream but got text/html 现象: SLF4J: Fail ...
- 使用JavaScript判断图片是否加载完成的三种实现方式
有时需要获取图片的尺寸,这需要在图片加载完成以后才可以.有三种方式实现,下面一一介绍. 一.load事件 <!DOCTYPE HTML> <html> <head> ...
- JS编码解码详解
今天在整理 js编码解码方法时,在网上搜资料,发现一篇文章讲的不错,讲解的非常简单明了,于是乎就想转载过来,却发现无法转载到博客园,最后只能卑鄙的摘抄过来.js编码解码就是将一些对URL和数据库敏感的 ...
- sessionStorage 、localStorage 和 cookie 之间的区别(转)
essionStorage .localStorage 和 cookie 之间的区别(转) 2012-05-08 14:29:19| 分类: HTML5CSS3WEBAPP|举报|字号 订阅 ...
- 如何不保存Word即可用Word打开想显示的内容!
今天遇到客户需要将数据用Word预览,原来做的时候是保存到本地然后打开,客户说这样不好,因为不一定预览了一定要保存,于是我翻箱倒柜的发现真没资料啊!!幸好经过我的大量实验(好吧,我是挨个方法试的!), ...
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
超时 Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: jav ...
- mosquitto在Linux环境下的部署/安装/使用/测试
mosquitto在Linux环境下的部署 看了有三四天的的源码,(当然没怎么好好看了),突然发现对mosquitto的源码有了一点点感觉,于是在第五天决定在Linux环境下部署mosquitto. ...
- Unix/Linux环境C编程入门教程(36) 初识shell
1.什么是Shell Shell是位为一组,依次代表文件拥有者.同组用户和其他用户的存取权限.通常文件共有3个权限,"r"表示只读:"w"表示可写:&qu ...
- 重大新闻:借贷宝不用绑卡了,借贷宝APP推出肖像识别新功能!
动动手指,20元人民币立即到手:http://www.cnblogs.com/mfryf/p/4754384.html 滴滴打车烧钱十几个亿,狂送打车券,很多人天天免费坐车! 去年年初百度钱包注册奖励 ...
- Machine Learning - Lecture 16
Reinforcement Learning (R.L.) ① MDPs (Markov Decision Processes) ② Value Functions ③ Value Iteration ...