linux更新yum源

摘要:
release=6&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additionalpackagesthatmaybeuseful[extras]名称=CentOS-6-extras-163.combaseurl=http://mirrors.163.com/centos/6/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch和repo=extrasgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additionalpackagesthatextendfunctionalityofexistingpackages[ccentosplus]name=CentOS-6-Plus-163.combaseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?

linux更新yum源

1. 获取yum源文件

网易163源: http://mirrors.163.com/.help/centos.html
选择对应的系统版本并下载

2. 做好备份

linux终端运行命令
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

3. 复制yum源文档

复制刚刚下载的yum源文档到/etc/yum.repos.d/CentOS-Base.repo (文件名不限,以.repo结尾即可)

4. 编辑yum源文档

替换文档中所有的$releasever为之前选择的系统版本,例如6

5. 导入yum源文件

终端运行命令
yum clean all
yum makecache
完成

以下是更改完成的文件(centos6)可以直接复制过去并进行第5步操作

# CentOS-Base.repo
#
# 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-6 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-6 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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-6 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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-6 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

免责声明:文章转载自《linux更新yum源》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇iOS 多线程LocalDate,LocalTime,LocalDateTime的基本使用下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Ubuntu 16.04LTS修改开机启动项

装上Ubuntu16.04后,每次开机都得手选开机项,挺麻烦 sudo vi /etc/default/grub GRUB_DEFAULT=0GRUB_HIDDEN_TIMEOUT=0GRUB_HIDDEN_TIMEOUT_QUIET=trueGRUB_TIMEOUT=10GRUB_DISTRIBUTOR=`lsb_release -i -s 2>...

Linux之telnet详解

telnet命令通常用来远程登录。telnet程序是基于TELNET协议的远程登录客户端程序。Telnet协议是TCP/IP协议族中的一员,是Internet远程登陆服务的标准协议和主要方式。它为用户提供了在本地计算机上完成远程主机工作的 能力。在终端使用者的电脑上使用telnet程序,用它连接到服务器。终端使用者可以在telnet程序中输入命令,这些命令...

青蛙学Linux—MySQL安装和初始化

1、安装MySQL 这里我们选择MySQL的源码包进行安装,MySQL版本5.7,安装路径为/usr/local/mysql,数据存储路径为/db/mysql,日志文件路径/usr/local/mysql/logs,运行MySQL的用户和组为mysql。 1.1、创建mysql用户 mysql用户用于运行MySQL,不能使用shell,为虚拟用户: [ro...

Windows访问Linux下的共享目录的配置方法

user安全级别 第一步:安装samba3(如果已经安装就跳过这一步) [root@rhce2 /]# yum groupinstall "CIFS file server" 第二步:修改配置文件 [root@rhce2 /]# vi /etc/samba/smb.conf 将security参数的值设为user(这是默认值) security =...

嵌入式linux GUI--DirectFB + GTK至尊秘笈

1 前言 数年前,曾经开发过一个嵌入式的产品,如今市场依然存在,但由于电子产品的升级换代很快,许多元器件都采购不到了,为了延续产品的生命周期,计划在linux平台上开发新的版本。而在linux上的GUI上成了大问题,最开始有用Minigui的打算,也同飞漫公司联系过,但费用我这里无法承受。(Minigui作为国产优秀的嵌入式GUI,如果不是费...

主流服务器虚拟化技术简单使用——KVM(二)

通过Linux工具管理KVM 主流服务器虚拟化技术简单使用——KVM(一)部署了一台KVM主机,提到KVM可以通过命令行工具(virt-install、virsh)和GUI工具(virt-manager)管理虚拟机。实际上virt-install、virsh、virt-manager只是管理工具,如果部署多台KVM,并不需要每一台都安装这些管理工具,因为它...