查看yum 存放位置

[root@web01 yum.repos.d]# ll /etc/yum.repos.d/
total
-rw-r--r--. root root Jun CentOS-Base.repo  网络源
-rw-r--r--. root root Mar CentOS-Debuginfo.repo
-rw-r--r--. root root Mar CentOS-fasttrack.repo
-rw-r--r--. root root Mar CentOS-Media.repo 本地源
-rw-r--r--. root root Mar CentOS-Vault.repo
-rw-r--r--. root root May epel.repo

查看网络源详细的配置源信息

[root@web01 yum.repos.d]# cat 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 - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=
enabled=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=
enabled=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
[root@web01 yum.repos.d]#

只要修改baseurl gpgkey 为相应源地址即可。

查看本地源的详细信息

[root@web01 ~]# cat /etc/yum.repos.d/CentOS-Media.repo
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command] [c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

修改为本地源地址

以上配置结束之后,要清空yum 缓存,并重建yum缓存,执行以下命令:

yum clean all && yum clean metadata && yum clean dbcache && yum makecache && yum update
 

Linux升级命令有两个分别是yum upgrade和yum update, 这个两个命令是有区别的:

yum -y update

升级所有包同时也升级软件和系统内核

yum -y upgrade

只升级所有包,不升级软件和系统内核

实验分别测试 yum -y upgrade和yum -y update

升级前

系统版本: centos5.5 
内核版本: 2.6.18-194.el5 
升级前做过简单配置文件修改

yum -y upgrade 升级后

系统版本: centos5.7 
内核版本: 2.6.18-194.el5 
yum -y update 升级后

系统版本: centos5.7 
内核版本: 2.6.18-238.el5

更改和配置本地yum源的更多相关文章

  1. CentOS 8配置本地yum源及DNF简介

    CentOS 8更改了软件包的安装程序,取消了 yum 的配置方法,改而使用了dnf 作为安装程序.虽然改变了软件包的安装方式,但是 dnf 还是能兼容使用 yum 的配置文件和命令的使用方法. 小提 ...

  2. redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO,愿网上少一点垃圾教程误人子弟

    都知道redhat不收费,但是其yum服务是要收费的,不想出钱那就自己配置yum源就好了. 首先,博主之前也没用过redhat,第一次用yum装包的时候提示什么没注册之类的,balaba一大堆,然后就 ...

  3. RedHat Linux RHEL6配置本地YUM源

    YUM是Yellow dog Updater Modified的简称,起初是由yellow dog这一发行版的开发者Terra Soft研发,用python写成,那时还叫做yup(yellow dog ...

  4. CentOS配置本地yum源(使用镜像iso文件)

    本人在使用yum安装软件的时候,感觉最不爽的是网络不佳时,安装的速度特别慢.所以,个人就上网search了一下如何使用Linux的安装文件作为其yum源.经过几次尝试,已经可以成功的配置了.下面是详细 ...

  5. 为CentOS 6 配置本地YUM源

    在网上找了很多为CentOS 6配置本地YUM源的方法,其中有很多是与网络相关的,我只想配个自己用的,结果就发现这个方法比较简单实用,就转过来了. 环境:CentOS 6.0 默认的yum是以网络来安 ...

  6. 配置本地yum源

    配置本地yum源 一.  远程挂载ISO文件 mount /dev/sr0 /mnt/cdrom (本地挂载mount -t iso9660 -o loop xx.iso /media) 二.  配置 ...

  7. Linux虚拟机配置本地yum源

    刚开始使用Linux,自己构建了一个Linux虚拟机之后,在使用yum install的时候,经常是出错,提示连接不上. 一直以为是自己构建的虚拟机的问题,后来在网上查找了一些资料,才发现:需要配置本 ...

  8. 配置本地yum源的方法

    配置本地yum源的方法 1. 挂载光驱 如果是上传iso镜像到服务器上,则直接挂载iso镜像即可: #mount -o loop -t iso9660 /xxxx.iso /挂载目录 开机自动加载#v ...

  9. 红帽系列linux自行配置本地yum源

    yum是红帽系列的一种包管理工具,能方便的自动解决安装包的依赖关系.以前用rpm包管理安装gcc时,rpm -ivh gcc.rpm ,一般会提示要安装gcc需要安装某某lib库,等你找到那个库的rp ...

随机推荐

  1. Python第一阶段04

    1.文件操作: # 指明编码 f = open("sisi", encoding="utf-8") # 读 data = f.read() print(data ...

  2. Swift4.0复习扩展

    1.扩展计算式属性: 2.对方法进行扩展: /// 定义枚举类型Light, /// 它指定了基本类型String enum Light: String { case red = "red& ...

  3. Swift4.0复习循环

    1.for-in循环: 2.while循环: 3.repeat-while循环: repeat { // 循环体中的一条或多条执行语句 } while condition 4.标签语句: if_lab ...

  4. Ubuntu18.04下LAMP环境搭建

    可以安装安装Xampp,Xampp是一个集成的LAMP开发环境. 但是这只是对于一个刚安装好的系统来说的,但是很有可能我的电脑上面已经安装过Apache,或者安装过MySQL,或者安装过PHP了,或者 ...

  5. JS扩展Array.prototype引发的问题及解决方法

    遇到的问题 一上班收到个bug,写的表单联动插件在ie里面会出现js源码,当时有点意外,从没出现过这问题. 问题的原由 为什么会出现一个function呢?其它调用的插件的页面为什么没有这问题? 控制 ...

  6. TortoiseSVN安装和使用(转)

    http://blog.csdn.net/Zhihua_W/article/details/64904692?locationNum=2&fps=1 https://www.cnblogs.c ...

  7. ASP.net发布项目引用了C++DLL后页面提示找不到指定模块的异常

    1.在引用C++dll的DllImport位置指定dll位置 [DllImport(@"C:\Windows\System32\DDyn_Method.dll", EntryPoi ...

  8. Kubernetes环境部署

    简介 Kubernetes 是一个开源系统,用于容器化应用的自动部署.扩缩和管理.它将构成应用的容器按逻辑单位进行分组以便于管理和发现.   配置镜像源 Debian / Ubuntu apt-get ...

  9. WXS-----学会使用WXS

    学会使用WXS require函数用于引入其他WXS模块 不要重复引入两个wxs模块,不然后者会覆盖前者

  10. RedHat Linux下普通用户无法使用sudo命令的解决方法

    Ref:http://blog.sina.com.cn/s/blog_4aa35ca101012qb6.html 装完linux系统,发现普通用户无法使用sudo 命令, 提示:User1(普通用户) ...