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 ...
随机推荐
- 安卓初步:通讯技术介绍&&安卓介绍
通讯技术: 1G 模拟制式 只能进行语音通话. 2G GSM, CDMA 收发短信和邮件. 2.5G GPRS, EDGE 访问wap网络数据.(图片, 壁纸, 文 ...
- JS创建类和对象(好多方法哟!)
http://www.cnblogs.com/tiwlin/archive/2009/08/06/1540161.html 这是别人写的~~~我借来看看 JavaScript 创建类/对象的几种方式 ...
- 1.Perl基础系列之WHAT、WHY、HOW
What? Perl,一种功能丰富的计算机程序语言,运行在超过100种计算机平台上,适用广泛,从大型机到便携设备,从快速原型创建到大规模可扩展开发. Why? Perl追求简洁快速地解决问题,可很方便 ...
- tomcat 项目部署问题
我本地Tomcat版本:Apache Tomcat/8.0.3.0 服务器端:Apache Tomcat/6.0.37 JVM都是:1.7.0_40-b43 之前项目运行正常,在我更新了一些模块后,重 ...
- T-SQL 游标
游标是面向行的,它会使开发人员变懒,懒得去想用面向集合的查询方式实现某些功能. 在性能上,游标会迟更多的内存,减少可用的并发,占用带宽,锁定资源,当然还有更多的代码量. 用一个比喻来说明为什么游标会占 ...
- 解决问题之,wp项目中使用MatchCollection正则表达式匹配出错
在最近,出现了这么一个问题 本人使用正则表达式代码,解析响应output,意图获得周边的CMCC热点 代码如下: //output="<?xml version=\"1.0\ ...
- Longest Substring Without Repeating Characters 解答
Question Given a string, find the length of the longest substring without repeating characters. For ...
- tomcat配置访问日志,访问首页主目录
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" ...
- 二十七、Java图形化界面设计——容器(JFrame)
摘自http://blog.csdn.net/liujun13579/article/details/7756729 二十七.Java图形化界面设计--容器(JFrame) 程序是为了方便用户使用的, ...
- 微信iOS WKWebview 网页开发适配指南
微信iOS客户端将于2017年3月1日前逐步升级为WKWebview内核,需要网页开发者提前做好网站的兼容检查和适配. 背景 WKWebView 是苹果在iOS 8中引入的新组件,目的是提供一个现代的 ...