修改yum源为阿里云的
将Centos的yum源更换为国内的阿里云源
author:headsen chen
date:2018-04-28 13:33:41
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5 (目前已经停用了,无效)
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
centos 8
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
3、之后运行yum makecache生成缓存
yum clean all
yum makecache
4、查询
yum repolist
5、自动修改yum源脚本
#!/bin/bash
mv /etc/yum.repos.d/* /mnt
a=`cat /etc/redhat-release |awk '{print $3}'|awk -F . '{print $1}'`
if [ $a == 6 ];then
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
else
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
fi
yum clean all
yum makecache
修改yum源为阿里云的的更多相关文章
- CentOS修改yum源为阿里云
yum的工具,自动去下载某个yum仓库的 rpm软件包,并且自动搜索软件下载软件依赖,如同pip3,npm等包管理工具 yum载linux中的 yum仓库是 /etc/yum.repos.d 并且在这 ...
- CentOS7 修改yum源为阿里云
1,登陆root帐号 2,cd /etc/yum.repo.d 3,mv CentOS-Base.repo CentOS-Base.repo.bak4,wget http://mirrors.aliy ...
- [转]centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv CentOS-Base.repo ...
- centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 安装base reop源 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv Cen ...
- CentOs Linux 对于 修改 yum源 为 阿里
修改yum源为阿里 备份本地yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak 2.获取阿里 ...
- Linux下配置yum源为阿里云或网易的详解
一.yum源概述 yum需要一个yum库,也就是yum源.默认情况下,CentOS就有一个yum源.在/etc/yum.repos.d/目录下有一些默认的配置文件(可以将这些文件移到/opt下,或者直 ...
- Centos 7 修改yum源为阿里源
因为官方的yum源在国内访问效果不佳, 需要改为国内比较好的阿里云或者网易的yum源, 具体修改步骤如下: cd /etc/yum.repos.d # 备份旧的配置文件 mv CentOS-Base. ...
- centos7修改yum源为阿里镜像
参考博客: https://blog.csdn.net/kxwinxp/article/details/78578492 https://blog.csdn.net/inslow/article/de ...
- Centos下替换yum源为阿里云源
阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/ 第一步:备份原镜像文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum ...
随机推荐
- 织梦dedecms dede plus文件作用介绍及安全设置
一.安装设置 1.默认的后台模块中心有很多模块. 这里除了"友情链接"模块其他都可以删掉.在后台可以先卸载再删除. 2.如果是一开始就不想要的话,安装版plus目录下进行如下操作. ...
- HTML-HTML5+CSS3权威指南阅读(五、设备像素和CSS像素的概念)
在这个迷你系列的文章里边我将会解释viewport,以及许多重要元素的宽度是如何工作的,比如<html>元素,也包括窗口和屏幕 这篇文章是关于桌面浏览器的,其唯一目的就是为移动浏览器中相似 ...
- ASP.NET 推荐书籍
ASP.NET 推荐书籍 1.首先推荐一本ASP.NET MVC的书籍 —— <Web开发新体验:ASP.NET 3.5 MVC架构与实战> [点评]:ASP.NET的MVC的书籍本来就不 ...
- 无法删除尚未附加的实体-linq中使用反射删除记录出现错误,应该如何解决。
db.airports.Attach(data); db.airports.DeleteOnSubmit(data); db.SubmitChanges();
- Linux系统编程之----》信号
"===信号========================================================================================= ...
- JAVA 并发编程-应用篇
提到java多线程不免有些人会头大.非常多概念都是非常理解可是真正到了实战的时候又是不知道怎样操作了.以下就结合实际项目来说说多线程的应用. 业务需求: 举例:批量插入10万条用户的相关活动优惠券 操 ...
- rabbitmq文章源
网易杭研后台技术中心的博客 rabbitmq topic简单demo http://blog.csdn.net/cugb1004101218/article/details/21243927?utm_ ...
- 点滴积累【other】---Windows 7 IIS (HTTP Error 500.21 - Internal Server Error)解决方案(转载)
此文来自:http://blog626.blog.163.com/blog/static/105610732201051591450870/ 搭建IIS时出现如下错误: HTTP Error 500. ...
- 文件上传之 commons-fileupload(一)
一 .简单介绍 使用最为广泛的Java文件上传组件,Struts本身采用这个包来处理文件上传.其基本原理: FileUpload组件将页面提交的所有元素(普通form表单域,如text和文 ...
- Linux编程之判断磁盘空间大小
一.引言 在开发过程中,经常会碰到这样的情况,在往指定目录下拷贝文件时,需要考虑到磁盘空间的大小是否足够来决定什么时候暂停自己的程序 二.用的函数 <sys/statfs.h> int s ...