Centos yum 修改为阿里源以及常用的命令
1、备份
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
或者
curl -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
或者
curl -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
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存
4、查看 linux 系统版本
[root@ca8a2d15ee41 yum.repos.d]# cat /etc/redhat-release CentOS Linux release 7.4. (Core)
5、yum 相关的命令
1)、安装命令
yum install -y package-name (-y 表示安装过程中的选项都选择 y,就是yes)
2)、查找提供安装包的名字
yum provides packagename
[root@ca8a2d15ee41 yum.repos.d]# yum provides ifconfig
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo : base
Matched from:
Filename : /sbin/ifconfig net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo : @base
Matched from:
Filename : /sbin/ifconfig net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo : @base
Matched from:
Filename : /usr/sbin/ifconfig
然后选择一个安装即可,比如 yum install -y net-tools-2.0-0.22.20131004git.el7.x86_64
Centos yum 修改为阿里源以及常用的命令的更多相关文章
- yum 找不到程序,yum更换国内阿里源
使用百度云服务器,发现百度yum源非常不稳定,果断采用阿里源,操作步骤如下: 一.备份 $ cd /etc/yum.repos.d/ $ mv baidu-bcm.repo baidu-bcm.rep ...
- ubuntu/centos/mac/windows 使用阿里源加速docker镜像下载
官方下载docker比较慢,阿里提供云容器hub, 1.打开阿里容器hub https://dev.aliyun.com/search.html 该页面右上方有一个管理中心,点击进去 2.选择镜像加速 ...
- centos下修改文件后如何保存退出
centos下修改文件后如何保存退出 保存命令 按ESC键 跳到命令模式,然后: :w 保存文件但不退出vi :w file 将修改另外保存到file中,不退出vi :w! 强制保存,不推出vi :w ...
- Centos 7 修改yum源为阿里源
因为官方的yum源在国内访问效果不佳, 需要改为国内比较好的阿里云或者网易的yum源, 具体修改步骤如下: cd /etc/yum.repos.d # 备份旧的配置文件 mv CentOS-Base. ...
- 将centos的yum源修改为阿里云的yum源
CentOS系统更换软件安装源 第一步:备份你的原镜像文件,以免出错后可以恢复. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentO ...
- 在centos中修改yum源为阿里源
cd /etc/yum.repos.d 备份旧的配置文件:mv CentOS-Base.repo CentOS-Base.repo.bak 下载阿里源的文件: wget -O CentOS-Base. ...
- centos yum换阿里云源
阿里云Linux安装软件镜像源 阿里云是最近新出的一个镜像源.得益与阿里云的高速发展,这么大的需求,肯定会推出自己的镜像源. 阿里云Linux安装镜像源地址:http://mirrors.aliyun ...
- [转]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 ...
随机推荐
- mybatis xml中返回map 参看aiwanpai
<!-- 指定日期活动被创建次数查询结果数据集--> <resultMap id="countPlayTimesMap" type="HashMap&q ...
- java编程思想(2)--一切都是对象
1创建对象 String s ;创建引用,并未初始化,即引用未关联任何东西 String s2="asda"; 初始化 System.out.println(s2); System ...
- Node.js 程序应用
在打开cmd 控制台 输入 node 然后在cmd中 输入您想要的代码 加减乘除 算法.
- web和app的简单测试区别和工具介绍
首先说一下我对Web自动化测试与CS自动化测试的认识.从宏观对比都是通过脚本自动化完成功能的验证,区别不大.Web测试更为显著的浏览器兼容性.安全,以及与Web技术相关的表单测试.链接测试等,其实都是 ...
- mybatis sql参考
参考mybatis sql: <select id="xxx" resultType="com.xxxx.xxx.vo.xx.xx" parameterT ...
- 学习日 day1
今天第一天开始写博客,希望以后能坚持,每天写,一是记录自己学习的历程,更重要的是复习每天学过的东西. 今天学习的内容:time模块的相关语法 导入方式 首行输入import time即可 time.t ...
- 如何编写Window服务程序(C# )
虚拟需求:编写一个Window服务,并注册到操作系统的服务里.让他隔30秒运行一下(写当前日期到一个文本里) 步骤: 创建一个Window 窗体应用程序项目(Greatwall.Mes.Windows ...
- python 安装包制作
1. __init__.py 2.模块1 模块2 3.setup.py from distutils.core import setup setup(name='modules_name',versi ...
- python note 03 切片及对字符串操作
1.计算 1 - 2 + 3 ... + 99 中除了88以外的数之和 i = 1 sum = 0 while i < 100 : if i == 88 : i = i + 1 continue ...
- node.js中express的Router路由的使用
express中的Router作用就是为了方便我们更好的根据路由去分模块.避免将所有路由都写在入口文件中. 一.简单的使用Router const express = require('express ...