CentOS7系統配置國內yum源和epel源
1.首先進入/etc/yum.repos.d/
目錄下,新建一個repo_bak目錄,用於儲存系統中原來的repo檔案
[root@bogon ~]# cd /etc/yum.repos.d/
[root@bogon yum.repos.d]# mkdir repo_bak
[root@bogon yum.repos.d]# mv *.repo repo_bak/
2.在CentOS中配置使用網易和阿里的開源映象
到網易和阿里開源映象站點下載系統對應版本的repo檔案
[root@bogon yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo
[root@bogon yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@bogon yum.repos.d]# ls
Centos-7.repo CentOS-Base-163.repo repo.bak
或者手動下載repo檔案並上傳到/etc/yum.repos.d/
目錄
3.清除系統yum快取並生成新的yum快取
[root@bogon yum.repos.d]# ls # 列出/etc/yum.repos.d/目錄下的檔案
Centos-7.repo CentOS-Base-163.repo repo.bak
[root@bogon yum.repos.d]# yum clean all # 清除系統所有的yum快取
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@bogon yum.repos.d]# yum makecache # 生成yum快取
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/12): base/7/x86_64/filelists_db | 6.7 MB 00:00:02
(2/12): base/7/x86_64/group_gz | 156 kB 00:00:02
(3/12): base/7/x86_64/other_db | 2.5 MB 00:00:01
(4/12): base/7/x86_64/primary_db | 5.7 MB 00:00:02
(5/12): extras/7/x86_64/prestodelta | 51 kB 00:00:01
(6/12): extras/7/x86_64/filelists_db | 494 kB 00:00:02
(7/12): extras/7/x86_64/other_db | 86 kB 00:00:00
(8/12): extras/7/x86_64/primary_db | 130 kB 00:00:01
(9/12): updates/7/x86_64/prestodelta | 406 kB 00:00:01
(10/12): updates/7/x86_64/filelists_db | 2.1 MB 00:00:01
(11/12): updates/7/x86_64/other_db | 354 kB 00:00:00
(12/12): updates/7/x86_64/primary_db | 3.6 MB 00:00:01
Determining fastest mirrors
Metadata Cache Created
4.安裝epel源
[root@bogon yum.repos.d]# yum list | grep epel-release
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
epel-release.noarch 7-9 extras
[root@bogon yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================
Package Arch Version Repository Size
=============================================================================================================
Installing:
epel-release noarch 7-9 extras 14 k
Transaction Summary
=============================================================================================================
Install 1 Package
Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-9.noarch 1/1
Verifying : epel-release-7-9.noarch 1/1
Installed:
epel-release.noarch 0:7-9
Complete!
[root@bogon yum.repos.d]# ls # epel源安裝成功,比原來多了一個epel.repo和epel-testing.repo檔案
Centos-7.repo CentOS-Base-163.repo epel.repo epel-testing.repo repo.bak
5.使用阿里開源映象提供的epel源
[root@bogon yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo # 下載阿里開源映象的epel原始檔
--2018-03-08 20:22:14-- http://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 183.2.199.237, 113.96.109.95, 113.96.109.93, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|183.2.199.237|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1084 (1.1K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/epel-7.repo’
100%[=================================================================================================>] 1,084 --.-K/s in 0s
2018-03-08 20:22:14 (130 MB/s) - ‘/etc/yum.repos.d/epel-7.repo’ saved [1084/1084]
[root@bogon yum.repos.d]# ls
CentOS7-Base-163.repo Centos-7.repo epel-7.repo epel.repo epel-testing.repo repo_bak
6.再次清除系統yum快取,並重新生成新的yum快取
[root@bogon yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Cleaning repos: base epel extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@bogon yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/18): base/7/x86_64/group_gz | 156 kB 00:00:01
(2/18): base/7/x86_64/filelists_db | 6.7 MB 00:00:07
(3/18): base/7/x86_64/primary_db | 5.7 MB 00:00:06
(4/18): epel/x86_64/group_gz | 266 kB 00:00:01
(5/18): epel/x86_64/updateinfo | 899 kB 00:00:02
(6/18): epel/x86_64/prestodelta | 7.1 kB 00:00:00
(7/18): base/7/x86_64/other_db | 2.5 MB 00:00:05
(8/18): epel/x86_64/primary_db | 6.3 MB 00:00:04
(9/18): extras/7/x86_64/filelists_db | 636 kB 00:00:00
(10/18): extras/7/x86_64/primary_db | 166 kB 00:00:00
(11/18): extras/7/x86_64/other_db | 108 kB 00:00:00
(12/18): extras/7/x86_64/prestodelta | 102 kB 00:00:01
(13/18): epel/x86_64/other_db | 3.0 MB 00:00:01
(14/18): epel/x86_64/filelists_db | 10 MB 00:00:09
(15/18): updates/7/x86_64/filelists_db | 3.5 MB 00:00:02
(16/18): updates/7/x86_64/prestodelta | 771 kB 00:00:02
(17/18): updates/7/x86_64/other_db | 621 kB 00:00:00
(18/18): updates/7/x86_64/primary_db | 6.0 MB 00:00:03
Determining fastest mirrors
* epel: mirrors.aliyun.com
Metadata Cache Created
7.檢視系統可用的yum源和所有的yum源
[root@bogon yum.repos.d]# yum repolist enabled
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* epel: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - 163.com 9,591
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,382
extras/7/x86_64 CentOS-7 - Extras - 163.com 390
updates/7/x86_64 CentOS-7 - Updates - 163.com 1,941
repolist: 24,304
[root@bogon yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* epel: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - 163.com enabled: 9,591
centosplus/7/x86_64 CentOS-7 - Plus - 163.com disabled
contrib/7/x86_64 CentOS-7 - Contrib - mirrors.aliyun.com disabled
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 12,382
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled
epel-source Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source disabled
extras/7/x86_64 CentOS-7 - Extras - 163.com enabled: 390
updates/7/x86_64 CentOS-7 - Updates - 163.com enabled: 1,941
repolist: 24,304
相關文章
- Centos7配置阿里epel源|yum源CentOS阿里
- CentOS7 yum源修改為阿里,配置阿里epel源CentOS阿里
- CentOS7配置yum國內源CentOS
- centos系統配置yum的國內映象源CentOS
- Centos系統配置yum源CentOS
- CentOS7 配置 163 yum 源CentOS
- `centos7`系統構建本地yum源並配置共享CentOS
- Linux系統配置本地yum源Linux
- Centos-Stream 配置本地yum源和配置阿里雲yum源CentOS阿里
- centos7配置yum國內映象CentOS
- Vmware配置Centos7配置yum源(新手小白福音)CentOS
- Centos-7修改yum源為國內的yum源CentOS
- CentOS6.x使用163和epel yum源的選擇CentOS
- readhalt7.4 系統替換 CentOS7 yum 源CentOS
- 搭建企業內部yum倉庫(centos6+centos7+epel源)CentOS
- yum 配置源
- 配置yum源
- CentOS7 修改 yum 源CentOS
- yum本地源和外網源的配置方法
- CentOS 搭建內部Yum源同步阿里Yum源CentOS阿里
- CentOS 配置yum源CentOS
- yum源配置大全
- 阿里雲 CentOS 映象和 EPEL 源阿里CentOS
- Docker——配置國內源Docker
- debian國內源 配置
- 修改Centos7預設yum源為阿里雲源CentOS阿里
- Docker和containerd服務配置國內源DockerAI
- yum指定國內映象源並安裝pythonPython
- 【yum源】CentOS7安裝第三方源CentOS
- centos7 更換yum為阿里源或者別的源CentOS阿里
- CentOS6.9配置yum源CentOS
- oel 7 本地yum源配置
- Centos 7 常用yum源配置CentOS
- CentOS6.8配置yum源CentOS
- centos7.5配置yum源CentOS
- RHEL7 yum源配置
- CentOS7--配置yum源CentOS
- Linux yum源配置以及yum命令講解Linux
- python配置使用國內源Python