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.再次清除系统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 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 base | 3.6 kB 00:00:00 epel/x86_64/metalink | 6.0 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/filelists_db | 6.7 MB 00:00:02 (2/18): base/7/x86_64/primary_db | 5.7 MB 00:00:01 (3/18): base/7/x86_64/other_db | 2.5 MB 00:00:00 (4/18): base/7/x86_64/group_gz | 156 kB 00:00:03 (5/18): epel/x86_64/group_gz | 261 kB 00:00:02 (6/18): epel/x86_64/updateinfo | 848 kB 00:00:05 (7/18): extras/7/x86_64/filelists_db | 494 kB 00:00:01 (8/18): extras/7/x86_64/prestodelta | 51 kB 00:00:00 (9/18): extras/7/x86_64/primary_db | 130 kB 00:00:00 (10/18): extras/7/x86_64/other_db | 86 kB 00:00:00 (11/18): updates/7/x86_64/filelists_db | 2.1 MB 00:00:01 (12/18): updates/7/x86_64/prestodelta | 406 kB 00:00:00 (13/18): updates/7/x86_64/primary_db | 3.6 MB 00:00:01 (14/18): updates/7/x86_64/other_db | 354 kB 00:00:00 (15/18): epel/x86_64/primary_db | 6.1 MB 00:00:11 (16/18): epel/x86_64/filelists_db | 9.8 MB 00:00:14 (17/18): epel/x86_64/prestodelta | 884 B 00:00:00 (18/18): epel/x86_64/other_db | 2.9 MB 00:01:15 Determining fastest mirrors * epel: mirrors.ustc.edu.cn Metadata Cache Created
6.查看系统可用的yum源和所有的yum源
[root@bogon yum.repos.d]# yum repolist enabled # 查看系统可用的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 Loading mirror speeds from cached hostfile * epel: mirrors.ustc.edu.cn 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,071 extras/7/x86_64 CentOS-7 - Extras - 163.com 282 updates/7/x86_64 CentOS-7 - Updates - 163.com 1,084 repolist: 23,028 [root@bogon yum.repos.d]# yum repolist 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 Loading mirror speeds from cached hostfile * epel: mirrors.ustc.edu.cn 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,071 epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled epel-source/x86_64 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 - Debu disabled epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Sour disabled extras/7/x86_64 CentOS-7 - Extras - 163.com enabled: 282 updates/7/x86_64 CentOS-7 - Updates - 163.com enabled: 1,084 repolist: 23,028

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
CentOS 中 配置 Nginx 支持 https
一、基础设置: 1、yum -y update 2、yum -y install openssl* 3、cd /usr/local/nginx/conf 4、mkdir ./ssl 5、cd ./ssl# 在ssl目录下用openssl创建 .key 私钥文件和 .crt 证书文件 6、openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout www.ushark.net.key -out www.ushark.net.crt 7、firewall-cmd --add-port=443/tcp --permanent --zone=public# 这是一个容易被忽略的过程,但是非常重要 二、配置nginx.conf文件,在原来的vhost中增加如下代码: server { listen 80;# 同时支持http、https listen 443 ssl; ssl_certificate /usr/local/nginx/conf/ssl/www.ushark.net.crt; # ....
- 下一篇
Centos7.1系统安装步骤图解
首先你进入安装界面,里面有三个选项,这里选择第一项,Tab键选中,Enter键确定 进入图形化安装界面,第一步选择系统语言 安装过程中使用的语言,这里为了方便阅读,我们选择简体中文 安装信息摘要,这里我们一项一项的设置,首先设置日期和时区 设置键盘布局,选择汉语 设置语言支持,简体中文 设置安装源,本地介质 软件选择,这里和6系列是不同的,选择GNOME桌面,这就相当于Centos6安装时的Desktop,你可以按照自己的需要进行配置 安装位置和系统分区,选择我要自己配置分区,点击Done,进入手动分区,根据自己的需要设置分区大小 设置Kdump的大小,手动可以更改大小,自动不能,想要更改大小,先选手动,改过之后在改到自动 网络设置,在Centos7中可以在这里就设置网络,等系统安装之后,就能实现联网 下面就开始我们的系统安装,点击右下角的开始安装 接着就会进入安装过程,在这个中你要设置Root密码和创建用户 进度条跑完之后,点击Reboot,之后系统会重启,重启之后,进入到下面的设置界面 选择输入源,这里选择汉语,完成之后点击前进按钮 这样就完成了安装,现在就可以开始你的Centos...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- SpringBoot2更换Tomcat为Jetty,小型站点的福音
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- CentOS7,8上快速安装Gitea,搭建Git服务器
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- Windows10,CentOS7,CentOS8安装Nodejs环境
- CentOS7设置SWAP分区,小内存服务器的救世主