CentOS7配置阿里云yum源和EPEL源
配置阿里云yum源(参考:http://mirrors.aliyun.com/help/centos)
1、备份
[root@bogon ~]# cd /etc/yum.repos.d/
[root@bogon yum.repos.d]# mkdir repo_bak
[root@bogon yum.repos.d]# mv *.repo repo_bak/
[root@bogon yum.repos.d]# ls
repo_bak
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
[root@bogon yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
---- ::-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.14.2.234, 124.14.2.235, 124.14.2.217, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.14.2.234|:... connected.
HTTP request sent, awaiting response... OK
Length: (.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’ %[========================================================================================>] , --.-K/s in 0s -- :: ( MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [/] [root@bogon yum.repos.d]# ls
CentOS-Base.repo repo_bak
3、之后运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存
[root@bogon yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@bogon yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base | 3.6 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): base//x86_64/group_gz | kB ::
(/): extras//x86_64/filelists_db | kB ::
(/): extras//x86_64/primary_db | kB ::
安装EPEL(Extra Packages for Enterprise Linux )源
4、安装EPEL源
[root@bogon yum.repos.d]# yum list | grep epel-release
epel-release.noarch - extras
[root@bogon yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch :- will be installed
--> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================
Installing:
epel-release noarch - extras k Transaction Summary
==================================================================================================================================
Install Package Total download size: k
Installed size: k
Downloading packages:
epel-release--.noarch.rpm | kB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release--.noarch /
Verifying : epel-release--.noarch / Installed:
epel-release.noarch :- Complete!
[root@bogon yum.repos.d]# ls #多了epel.repo和epel-testing.repo
CentOS-Base.repo epel.repo epel-testing.repo repo_bak
5、再次运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存
6、查看启用的yum源和所有的yum源
[root@bogon yum.repos.d]# yum repolist enabled #查看启用的仓库
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base//x86_64 CentOS- - Base - mirrors.aliyun.com ,
epel/x86_64 Extra Packages for Enterprise Linux - x86_64 ,
extras//x86_64 CentOS- - Extras - mirrors.aliyun.com
updates//x86_64 CentOS- - Updates - mirrors.aliyun.com ,
repolist: ,
[root@bogon yum.repos.d]# yum repolist all #查看所有的仓库
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base//x86_64 CentOS- - Base - mirrors.aliyun.com enabled: ,
centosplus//x86_64 CentOS- - Plus - mirrors.aliyun.com disabled
contrib//x86_64 CentOS- - Contrib - mirrors.aliyun.com disabled
epel/x86_64 Extra Packages for Enterprise Linux - x86_64 enabled: ,
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux - x86_64 - Debug disabled
epel-source/x86_64 Extra Packages for Enterprise Linux - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 - Source disabled
extras//x86_64 CentOS- - Extras - mirrors.aliyun.com enabled:
updates//x86_64 CentOS- - Updates - mirrors.aliyun.com enabled: ,
repolist: ,
CentOS7配置阿里云yum源和EPEL源的更多相关文章
- CentOS7 配置阿里云yum源,vim编辑器,tab自动补全
1.进入yum的文件夹 命令:cd /etc/yum.repos.d/ 2.下载wget 命令:yum -y install wget 3.删除yum文件夹所有yum源 命令:rm -rf ...
- CentOS7 配置阿里云yum源,非常之简单
1.进入yum的文件夹 命令:cd /etc/yum.repos.d/ 2.下载wget 命令:yum -y install wget 命令:yum install bash-completion ...
- CentOS7 配置阿里云yum源
1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo 2)备份并替换系统的repo文件 cp Centos-7.repo /etc/ ...
- centos7配置阿里云yum源
1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo 2)备份并替换系统的repo文件 cp Centos-7.repo /etc/ ...
- 超简单CentOS7 配置阿里云yum源
1.打开centos的yum文件夹 输入命令cd /etc/yum.repos.d/ 2.用wget下载repo文件 输入命令wget http://mirrors.aliyun.com/repo ...
- Centos7一键配置阿里云yum源脚本
Centos7一键配置阿里云yum源脚本 工作中linux系统经常要配置网络yum,故写了一个简单的配置阿里云yum源的的脚本可以单独使用也可以在做自动化部署的时候调用. #!/bin/bash # ...
- Centos 7 配置阿里云 yum 源
Centos 7 配置阿里云 yum 源 一. 禁用 yum 插件 fastestmirror 修改插件的配置文件 cp /etc/yum/pluginconf.d/fastestmirror.con ...
- CentOS7——配置阿里云镜像源
CentOS7--配置阿里云镜像源 #下载CentOS 7的repo文件 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun ...
- CentOS换yum源和epel源为国内源
CentOS换源 YUM源 备份原来的repo文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bac ...
随机推荐
- Leader Election
Leader Election Zookeeper的基本操作 Zookeeper虽然是分布式系统,但它并不是为文件存储而设计的,Zookeeper里存储的一般是配置信息和源信息.实际上,Zookeep ...
- C#中的String.Format方法
定义String.Format是将指定的String类型的数据中的每个格式项替换为相应对象的值的文本等效项.(1)string p1="xiaomeng";string p2=&q ...
- BZOJ4690 Never Wait for Weights(并查集)
带权并查集按秩合并即可维护. #include<iostream> #include<cstdio> #include<cmath> #include<cst ...
- 【题解】SCOI2010幸运数字
最近在学习容斥相关,于是就看到了这个题.一开始以为是补集转化,但是观察一下马上发现不可行,好像直接做会比较容易一些.一个数满足要求的充要条件即为是一个幸运数字的倍数,那么容斥可以轻松搞定,只要枚举是一 ...
- Adore 解题报告
Adore 问题描述 小\(\text{w}\) 偶然间得到了\(1\)个 \(DAG\). 这个 \(DAG\) 有 \(m\) 层,第\(1\)层只有\(1\)个源点,最后\(1\)层只有\(1\ ...
- Codeforces Round #520 (Div. 2) D. Fun with Integers
D. Fun with Integers 题目链接:https://codeforc.es/contest/1062/problem/D 题意: 给定一个n,对于任意2<=|a|,|b|< ...
- 如何让spring源码正常的部署在idea中
我在这里把我从GitHub下载的源码成功编译之后的文件放在了我的百度网盘上大家可以直接下载,也可以按如下步骤自己编译部署到idea中, 下载的地址是:http://pan.baidu.com/s/1d ...
- python实现后台系统的JWT认证
介绍一种适用于restful+json的API认证方法,这个方法是基于jwt,并且加入了一些从oauth2.0借鉴的改良. 1. 常见的几种实现认证的方法 首先要明白,认证和鉴权是不同的.认证是判定用 ...
- js中Date()对象详解
var myDate = new Date(); myDate.getYear(); //获取当前年份(2位) myDate.getFullYear(); //获取完整的年份(4位,1970-???? ...
- C#与数据库的连接的三种方式
学习了.net的知识从C#一直到MVC,我一直觉得基础很重要,最近有复习一下数据库连接的三种方式 1 返回结果集的一张表 public static DataTable ExecuteDataTabl ...