6.27 7.6-7.9
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了6.27 7.6-7.9相关的知识,希望对你有一定的参考价值。
7.6 yum更换国内源
默认.repo文件中的源为国外的网址,下载速度较慢,可以更换国内源
步骤:
1 删除原来的.repo文件
2 下载国内源的.repo文件到yum.repos.d目录下
[[email protected] ~]# 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
[[email protected] ~]# ls
anaconda-ks.cfg CentOS7-Base-163.repo
[[email protected] ~]# cp CentOS7-Base-163.repo /etc/yum.repos.d
[[email protected] ~]# cd !$
cd /etc/yum.repos.d
[[email protected] 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
[[email protected] yum.repos.d]# mv CentOS7-Base-163.repo CentOS7-Base-163.repo.123
修改.repo文件名导致系统无法识别
[[email protected] 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>
[[email protected] yum.repos.d]# yum repolist all 此时查看仓库发现所有仓库处于禁用状态
[[email protected] yum.repos.d]# mv CentOS7-Base-163.repo.123 CentOS7-Base-163.repo 改回原来正确的文件名
[[email protected] 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
[[email protected] yum.repos.d]# yum install zsh 此时zsh可以正常安装,由于先前清空了缓存,此时会重新生成缓存
[[email protected] yum.repos.d]# yum repolist all 此时与163.com有关的源为启用状态
[[email protected] yum.repos.d]# yum list 查看发现出现了base仓库中的包
7.7 yum下载rpm包
7.8 源码包安装 上
7.9 源码包安装 下
以上是关于6.27 7.6-7.9的主要内容,如果未能解决你的问题,请参考以下文章