更改和配置本地yum源
查看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缓存,执行以下命令:
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源的更多相关文章
- CentOS 8配置本地yum源及DNF简介
CentOS 8更改了软件包的安装程序,取消了 yum 的配置方法,改而使用了dnf 作为安装程序.虽然改变了软件包的安装方式,但是 dnf 还是能兼容使用 yum 的配置文件和命令的使用方法. 小提 ...
- redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO,愿网上少一点垃圾教程误人子弟
都知道redhat不收费,但是其yum服务是要收费的,不想出钱那就自己配置yum源就好了. 首先,博主之前也没用过redhat,第一次用yum装包的时候提示什么没注册之类的,balaba一大堆,然后就 ...
- RedHat Linux RHEL6配置本地YUM源
YUM是Yellow dog Updater Modified的简称,起初是由yellow dog这一发行版的开发者Terra Soft研发,用python写成,那时还叫做yup(yellow dog ...
- CentOS配置本地yum源(使用镜像iso文件)
本人在使用yum安装软件的时候,感觉最不爽的是网络不佳时,安装的速度特别慢.所以,个人就上网search了一下如何使用Linux的安装文件作为其yum源.经过几次尝试,已经可以成功的配置了.下面是详细 ...
- 为CentOS 6 配置本地YUM源
在网上找了很多为CentOS 6配置本地YUM源的方法,其中有很多是与网络相关的,我只想配个自己用的,结果就发现这个方法比较简单实用,就转过来了. 环境:CentOS 6.0 默认的yum是以网络来安 ...
- 配置本地yum源
配置本地yum源 一. 远程挂载ISO文件 mount /dev/sr0 /mnt/cdrom (本地挂载mount -t iso9660 -o loop xx.iso /media) 二. 配置 ...
- Linux虚拟机配置本地yum源
刚开始使用Linux,自己构建了一个Linux虚拟机之后,在使用yum install的时候,经常是出错,提示连接不上. 一直以为是自己构建的虚拟机的问题,后来在网上查找了一些资料,才发现:需要配置本 ...
- 配置本地yum源的方法
配置本地yum源的方法 1. 挂载光驱 如果是上传iso镜像到服务器上,则直接挂载iso镜像即可: #mount -o loop -t iso9660 /xxxx.iso /挂载目录 开机自动加载#v ...
- 红帽系列linux自行配置本地yum源
yum是红帽系列的一种包管理工具,能方便的自动解决安装包的依赖关系.以前用rpm包管理安装gcc时,rpm -ivh gcc.rpm ,一般会提示要安装gcc需要安装某某lib库,等你找到那个库的rp ...
随机推荐
- typescript那些事儿
本篇文章介绍typescript那些. ts-loader会调用typescript去编译.ts,typescript会读取tsconfig.json配置来决定如何编译. 在tsx文件中使用样式,需要 ...
- 【Leetcode_easy】872. Leaf-Similar Trees
problem 872. Leaf-Similar Trees 参考 1. Leetcode_easy_872. Leaf-Similar Trees; 完
- echarts移动端demo
说明:建议移动端使用的时候自己定制需要的东西,详情看官网 ECharts 效果图: 代码: <!DOCTYPE html> <html style="height: 1 ...
- U-Boot NFS RCE漏洞(CVE-2019-14192)
U-Boot NFS RCE漏洞(CVE-2019-14192) 原文:https://blog.semmle.com/uboot-rce-nfs-vulnerability/ 翻译:看雪翻译小组 - ...
- swift 修改 Navigationbar Tabbar 字体颜色背景等属性
1.navigationBar的设置 let navColor = UIColor(red: 41/255, green: 160/255, blue: 230/255, alpha: 1) func ...
- Appium移动自动化测试-----(十一)appium API 之键盘操作
模拟键盘输入也是非常重要的操作.这一小节来介绍那些关于键盘的操作. 1.sendKeys()方法 方法: sendKeys() 用法: driver.findElements(By.name(&quo ...
- 最详细的maven教程
转载 https://blog.csdn.net/wymrdjm/article/details/78695956 所有用Maven管理的真实的项目都应该是分模块的,每个模块都对应着一个pom.x ...
- [.NET Core] - 使用 EF Core 的 Scaffold-DbContext 脚手架命令创建 DbContext
Scaffold-DbContext 命令 参数 Scaffold-DbContext [-Connection] <String> [-Provider] <String> ...
- 剑指offer55:链表中环的入口结点
1 题目描述 给一个链表,若其中包含环,请找出该链表的环的入口结点,否则,输出null. 2 思路和方法 这是一个典型的链表中查找环的问题,基本思路是,首先设置两个快慢指针slow和fast,并且快指 ...
- Python开发【第一章】:简介和入门
Python简介 Python的创始人为Guido van Rossum.1989年圣诞节期间,在阿姆斯特丹,Guido为了打发圣诞节的无趣,决心开发一个新的脚本解释程序,做为ABC 语言的一种继承. ...