一,配置本地yum
1,挂载光盘
mount /dev/cdrom/mnt/media
2,新建本地yun源的配置文件
vi /etc/yum.repos.d/local.repo
加入以下信息:
[Local]
name=Local
baseurl=file:///mnt/media
enable=1
gpgcheck=0
二,配置第三方yum
1.删除redhat 原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下载yum 安装文件
Wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
3.安装yum 软件包
(1)rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
(2)rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
(3) 两个一起安装先后顺序不要乱(中间50%正常)
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
4、更改yum源 #我们使用网易的CentOS镜像源
(1)清空yum仓库
# cd /etc/yum.repos.d/
#rm -rf *
(2)设置源
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vi CentOS6-Base-163.repo
编辑文件,把文件里面所有的$releasever全部替换为你得版本号,即6.4 最后保存!或者直接把下面的内存拷贝到CentOS6-Base-163.repo文件中即可(已经修改好)
#################################################################
# CentOS-Base.repo
#
# The mirrorsystem uses the connecting IP address of the client and the
# update status ofeach mirror to pick mirrors that are updated to and
# geographicallyclose to the client. You should use thisfor CentOS updates
# unless you aremanually picking other mirrors.
#
# If the mirrorlist=does not work for you, as a fall back you can try the
# remarked outbaseurl= line instead.
#
#
[base]
name=CentOS-6.4 -Base - 163.com
baseurl=http://mirrors.163.com/centos/6.4/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6.4 -Updates - 163.com
baseurl=http://mirrors.163.com/centos/6.4/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that may be useful
[extras]
name=CentOS-6.4 -Extras - 163.com
baseurl=http://mirrors.163.com/centos/6.4/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that extend functionality of existing packages
[centosplus]
name=CentOS-6.4 -Plus - 163.com
baseurl=http://mirrors.163.com/centos/6.4/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&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-6.4 -Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6.4/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#####################################################################
5、清理yum缓存
# yum clean all
# yum makecache #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度
# yum installvim* #测试域名是否可用
至此,Redhat6可以使用CentOS的yum源在线安装软件了!
6.使用 # yum update
或 # yum upgrade 升级系统
注:两个命令区别:
# yum update
升级所有包,改变软件设置和系统设置,系统版本内核都升级
# yum -y upgrade
升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变
linux yum源配置方法
精选 转载下一篇:Linux中最危险的10个命令
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Centos7.9 清华yum源配置
清华YUM源配置
CentOS centos -
Linux配置本地yum源配置方法
http://www.weichun.vip/?id=28转载出处
centos 服务器 linux服务器 yum安装 yum源 -
linux yum源配置
本文介绍了本地yum配置和通过ftp和http创建yum源
配置 yum yum -
配置本地YUM源方法
本地YUM源的配置方法
CentOS yum源 vim -
linux本地yum源配置
检查镜像是否挂载 创建挂载点 将镜像挂载到/mnt/yum 目录下,查看是否挂载成功 将镜像永久挂载: 编辑配置文件 清除缓存,列出yum源 安装软件测试 以上为RedHad7本地源配置
linux target style blank border -
配置linux的yum源
Linux配置yum客户端到163中
yum 163 -
Linux 的yum源配置
一、Linux更改yum源为阿里云源 一、原yum源备份
yum仓库 centos yum源 缓存 -
Linux下yum源配置
redhat linux 配置yum详解 修改浏览权限 | 删除 首 先,rhel5系统安装的时候其实已经有yum了,只是因为如果用官方的网站更新的
运维 操作系统 centos linux 配置文件