CENTOS YUM更新源
网络yum源和制作本地光盘yum源
配置CENTOS YUM更新源
yum安装rpm包安装后本地不清除的方法
sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf

rpm -aq 包名 检查是否安装包
yum --exclude 命令参数的使用
使用该参数,跳过某些软件包后升级,参见文章《yum 命令跳过特定(指定)软件包升级方法》如下:
# yum --exclude=package* update# yum --exclude=php* update# yum --exclude=kernel* update# yum -x 'kernel*' -x 'php*' update
1.下载repo文件
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo (centos6)- wget http://mirrors.163.com/.help/CentOS7-Base-163.repo (centos7)
2.备份并替换系统的repo文件
[root@localhost ~]# cd /etc/yum.repos.d/[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak[root@localhost ~]# mv CentOS6-Base-163.repo CentOS-Base.repo
3.执行yum源更新
[root@localhost ~]# yum clean all[root@localhost ~]# yum makecache[root@localhost ~]# yum update
CentOS使用yum update更新时不升级内核
cp /etc/yum.conf /etc/yum.confbak
方法一、修改yum的配置文件
vi /etc/yum.conf 在[main]的最后添加 exclude=kernel*
方法二、直接在yum的命令后面加上如下的参数:
yum --exclude=kernel* update
查看系统版本 cat /etc/issue
查看内核版本 uname -a
众所周知,Centos 有个很方便的软件安装工具 yum,但是默认安装完centos,系统里使用的是国外的centos更新源,这就造成了我们使用默认更新源安装或者更新软件时速度很慢的问题。
为了使用yum工具能快速的安装更新软件,我们需要将默认的yum更新源配置为国内的更新源。yum更新源配置文件位于centos目录 /etc/yum.repos.d/ 下。
首先提供几个国内快速的更新源:
教育网资源:
1 上海交大: http://ftp.sjtu.edu.cn/centos/
服务器位于北京,中国教育网网络中心,下载速度高达十M。
北方用户与教育网用户推荐,速度飞快。
需要手动创建 CentOS-Base.repo文件。
2 中国科技大学:http://centos.ustc.edu.cn
服务器位于合肥。 南方用户推荐。 同样的,CenOS版本非常丰富,适合长期使用。
非教育网资源:
1 sohu的开源镜像服务器:http://mirrors.sohu.com/
服务器位于山东省联通
2 网易的开源服务器镜像: http://mirrors.163.com/centos
速度也不错,全国用户推荐
3 度娘? 怎么没有度娘的开源镜像。度娘每年坑骗这么多血汗钱,难道连个开源也供不起么? 百分鄙视!
总之,大家在使用前可以 ping 一下一上更新源,看哪个快就用哪个。
测试
[zzx@ZZXOS ~]$ vim /etc/yum.repos.d/CentOS-Base.repo
[zzx@ZZXOS ~]$ cat !$
cat /etc/yum.repos.d/CentOS-Base.repo
# 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-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
以上配置结束之后,要清空yum 缓存,并重建yum缓存,执行以下命令:
yum clean all && yum clean metadata && yum clean dbcache && yum makecache && yum update
CENTOS YUM更新源的更多相关文章
- 配置CENTOS YUM更新源
众所周知,Centos 有个很方便的软件安装工具 yum,但是默认安装完centos,系统里使用的是国外的centos更新源,这就造成了我们使用默认更新源安装或者更新软件时速度很慢的问题. 为了使用 ...
- RedHat 5 配置CentOS yum 更新源
YUM是Redhat Linux在线安装更新及软件的工具,但是这是RHEL5的收费功能,如果没有购买Redhat的服务时不能使用RHEL5的更新源的,会提示注册. 由于CentOS是从Redhat演化 ...
- 几个国内速度最快的centos yum(更新源)
转自:http://blog.itpub.net/15711267/viewspace-1068862/ 中国科技大学源 cd /etc/yum.repos.d mv CentOS-Base.repo ...
- RHEL5 yum更新源
1.检查yum是否安装 rpm -qa |grep yum 2.利用CentOS的yum更新源来实现RHEL5的YUM功能 vi /etc/yum.repos.d/CentOS-Base.repo [ ...
- CentOS 7 更新源 – 使用国内 163 yum 源
突然想起试试 Docker,在一台计算机上安装了 CentOS 7,准备开工,突然想起还需要做一件事情,更改源,不然安装肯定会很慢,网上搜索了一下,文章很多,但是会出一些问题,所以将自己的成功的日志写 ...
- CentOS修改yum更新源
1. 在修改前先备份该文件 cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2. 修改更新源配置文 ...
- 阿里云Centos等更新源设置成阿里源方法。
https://help.aliyun.com/knowledge_detail/5974184.html ---------------------------------------------- ...
- CentOS yum换源
1.备份系统自带yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.进入yum源配 ...
- CENTOS YUM软件源
CentOS 7.0 使用 YUM 安装 MySQL 报错 问题现象 CentOS 7.0 使用 YUM 安装 MySQL 时出现类似如下错误信息: File contains no section ...
随机推荐
- R 读取excel的方法
1.加载 readxl 包,利用 reade_excel() 函数 install.packages("readxl") library(readxl) data = read_e ...
- 公司网络能ping通ip,不能ping域名
第一天去公司,就因为网络问题弄了大半天.只能ping通ip,不能ping域名.网上查了各种方式都不行,刷新dns缓存.说是什么域名解析问题.dns的问题.公司里好几个人都看了看不能解决.领导让重装系统 ...
- Ubuntu跨版本安装软件
更新到Ubuntu 19.10之后,源里的Goldendict就会不时的崩溃,让我十分心累.过了这么长时间也一直没有更新,估计在20.04之前是不会更新了.这段时间因为疫情不能出门,正好看看这个问题, ...
- 吴裕雄--天生自然C++语言学习笔记:C++ 数组
C++ 支持数组数据结构,它可以存储一个固定大小的相同类型元素的顺序集合.数组是用来存储一系列数据,但它往往被认为是一系列相同类型的变量. 数组的声明并不是声明一个个单独的变量,比如 number0. ...
- es6的...
es6的... (1):函数rest参数和扩展 sum1(...sum){//传多个参数 let total=0; for( ...
- Mongodb集群形式探究-一主一从一仲裁。
主节点(primary)与从节点(secondary)和仲裁节点(arbiter)具有存储数据的两个成员的三个成员副本集具有: ●一个主节点. ●一个从节点. 从节点可以在选举中成为主节点. ...
- 【LeetCode 】N皇后II
[问题]n 皇后问题研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击. 上图为 8 皇后问题的一种解法.给定一个整数 n,返回 n 皇后不同的解决方案的数量. 示例: ...
- 【LeetCode】电话号码的字母组合
[问题]给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合. 给出数字到字母的映射如下(与电话按键相同).注意 1 不对应任何字母. 示例: 输入:" 输出:["ad ...
- ROS常用命令或经常碰到的问题
本篇博客会随时更新. 一.常用命令 1.添加环境变量 gedit ~/.bashrc 2.ubuntu系统监视器 gnome-system-monitor 二.问题 1.sudo apt-get up ...
- struts2模型驱动传值问题
控制台错误提示: 2020-01-08 18:34:40,292 [http-nio-8080-exec-3] [org.apache.struts2.dispatcher.Dispatcher]-[ ...