码迷,mamicode.com
首页 > 其他好文 > 详细

6.27 7.6-7.9

时间:2018-06-29 11:06:17      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:disable   data   upload   subscript   HERE   pen   .repo   anaconda   remove   

7.6 yum更换国内源

 

默认.repo文件中的源为国外的网址,下载速度较慢,可以更换国内源

步骤:

1 删除原来的.repo文件

2 下载国内源的.repo文件到yum.repos.d目录下

[root@hyc-01-01 ~]# curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100  1572  100  1572    0     0   9860      0 --:--:-- --:--:-- --:--:--  9886

[root@hyc-01-01 ~]# ls

anaconda-ks.cfg  CentOS7-Base-163.repo

[root@hyc-01-01 ~]# cp CentOS7-Base-163.repo /etc/yum.repos.d

[root@hyc-01-01 ~]# cd  !$

cd  /etc/yum.repos.d

[root@hyc-01-01 yum.repos.d]# ls

CentOS7-Base-163.repo  CentOS-fasttrack.repo  CentOS-Vault.repo

CentOS-CR.repo         CentOS-Media.repo

CentOS-Debuginfo.repo  CentOS-Sources.repo

[root@hyc-01-01 yum.repos.d]# mv CentOS7-Base-163.repo CentOS7-Base-163.repo.123

修改.repo文件名导致系统无法识别

[root@hyc-01-01 yum.repos.d]# yum install zsh zsh无法正常安装

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

There are no enabled repos.

 Run "yum repolist all" to see the repos you have.

 To enable Red Hat Subscription Management repositories:

     subscription-manager repos --enable <repo>

 To enable custom repositories:

     yum-config-manager --enable <repo>

[root@hyc-01-01 yum.repos.d]# yum repolist all 此时查看仓库发现所有仓库处于禁用状态

[root@hyc-01-01 yum.repos.d]# mv CentOS7-Base-163.repo.123 CentOS7-Base-163.repo 改回原来正确的文件名

[root@hyc-01-01 yum.repos.d]# yum clean all 清理yum缓存

已加载插件:fastestmirror

Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast

正在清理软件源: 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@hyc-01-01 yum.repos.d]# yum install zsh 此时zsh可以正常安装,由于先前清空了缓存,此时会重新生成缓存

[root@hyc-01-01 yum.repos.d]# yum repolist all 此时与163.com有关的源为启用状态

[root@hyc-01-01 yum.repos.d]# yum list 查看发现出现了base仓库中的包

 

7.7 yum下载rpm

 

 

 

7.8 源码包安装

 

 

 

7.9 源码包安装


6.27 7.6-7.9

标签:disable   data   upload   subscript   HERE   pen   .repo   anaconda   remove   

原文地址:http://blog.51cto.com/12216458/2133950

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!