首页 > 系统相关 >CentOS7系统配置国内163和阿里云的yum源和epel源

CentOS7系统配置国内163和阿里云的yum源和epel源

时间:2024-12-16 17:02:12浏览次数:6  
标签:epel 00 x86 Repository CentOS7 yum 64 configuration

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

 

2024-12-16 16:44:52【出处】:https://www.cnblogs.com/renpingsheng/p/7845096.html

=======================================================================================

标签:epel,00,x86,Repository,CentOS7,yum,64,configuration
From: https://www.cnblogs.com/mq0036/p/18610547

相关文章

  • centos7配置IP地址
    1、修改存放网络信息文件2、修改网络配置文件 vi/etc/sysconfig/network-scripts/ifcfg-ens33配置静态IP地址(1)bootproto=static(2)onboot=yes(3)在最后加上几行,IP地址、子网掩码、网关、dns服务器ip网关dns根据实际情况修改一下。IPADDR=192.168.0.0NETMASK......
  • centos7单节点部署商城系统
    一、引言1.项目目标基于SpringBoot+Dubbo构建一个开源电商平台(gpmall)2.项目分析2.1规划节点IP地址主机名节点192.168.12.123mall单节点服务器2.2基础准备虚拟机要具备100GB拆分硬盘、8GB内存、NAT模式网络适配器、4个CPU内核,并包括CD/DVD、USB控制器、打印......
  • vmware设置centos7客户机和windows宿主机共享文件夹
    一、安装内核kernel-devel包yuminstallgcc--nogpgcheckyuminstallkernel-devel-$(uname-r)--nogpgcheck注意,如果自己修改过内核版本,需要确保uname-r显示的版本和实际使用的内核版本一致。二、安装 vmware-tools在vmware上点击菜单:虚拟机->安装wmware-tools。......
  • 大数据之信创MySQL替代_国产数据库_OceanBase数据库005_在centos7.9上_安装部署OceanB
    dk是简略的写法: 然后我们再来看一下如何使用dk来部署一下OceanBase官网也很详细.首先去systemctlstartdk 启动dk启动dk以后,然后去拉取镜像可以看到我们电脑中本来就有很多镜像,先全部关掉dk stop'dk ps-qa'......
  • centos 7 yum不能正常使用解决方案
    https://blog.csdn.net/weixin_43811294/article/details/141306029centos7镜像失效问题解决vmware安装linux-centos7配置docker镜像源vi/etc/docker/daemon.json按键盘上的i键,之后把下面的代码贴进去{"registry-mirrors":["https://docker.m.daocloud.io","h......
  • CentOS7 搭建 NFS 服务
    服务端配置配置环境关闭防火墙$systemctlstopfirewalld$systemctldisablefirewalld禁用SELinux$setenforce0$sed-i's/^SELINUX=enforcing$/SELINUX=disabled/'/etc/selinux/config安装服务$yuminstall-ynfs-utilsrpcbind创建存储目录#创建文......
  • CentOS7 磁盘挂载操作
    https://www.cnblogs.com/studyjobs/p/18168763https://blog.51cto.com/u_16099209/11549398我们在使用CentOS7时,一般最好把数据都存放在额外挂载的磁盘上,优点就是防止系统磁盘爆满,以及防止数据丢失。目前使用的Linux操作系统,也绝大部分与CentOS7的操作命令一样,包括一些......
  • centos7配置阿里云yum源
    1、确定自己服务器可以连接外网pingwww.baidu.com查看是否可以ping通2、我发现我的服务器丢包率高达43%可以尝试更换DNS服务器,我刚开始使用的是谷歌的DNS服务器编辑 /etc/resolv.conf 文件谷歌的 8.8.8.8 和 8.8.4.4,阿里的 223.5.5.5 和 223.6.6.6修改换完system......
  • linux/centOS7用户和权限管理笔记
    linux系列中可以:配置多个用户配置多个用户组用户可以加入多个用户中linux中关于权限的管理级别有2个级别,分别是:针对用户的权限控制针对用户组的权限控制一,root用户root用户拥有最大的系统操作权限,而普通用户在许多地方的权限是受限的二,用户组的管理(root用户执行)1.创建用......
  • linux/centOS7用户和权限管理笔记练习
    1.创建用户组bigdata2.创建用户dsj,指定基本组bigdata,附加组bigdata2,指定home目录为/home/dsj3.查看用户4.创建用户dsj2,指定基本组为bigdata2,附加组为bigdata,指定uid为24025.查看dsj2用户6.从root用户切换到dsj用户7.切回root用户 8.给dsj2用户添加密码 9.......