
在浙江大学开源镜像网站中选择Linux的发行版和版本,网站会自动生成我们所需版本的yum源信息,然后修改yum源即可。
2、配置网易和阿里的yum源(浙大的似乎更新缓慢,需要更新版本的软件安装选择商业公司的为好)
以root用户身份进入 /etc/yum.repos.d 目录
wget http://mirrors.aliyun.com/repo/Centos-7.repo
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all (清除yum缓存)
yum makecache (重新生成yum缓存)
3、安装 epel源(在网易和阿里yum源下,直接yum安装即可;另一种方式是rpm安装)
yum list | grep epel-release
yum install -y epel-release
yum repolist enabled (查看系统可用的yum源)
yum repolist all (查看系统所有的yum源)
1、使用 Linux ISO 镜像中的 RPM 包安装
1)、将 ISO 文件 copy 到服务器上,并在文件夹: /var/www/html/ 下创建文件夹 CentOS
2)、将 ISO 文件挂载至文件夹 /var/www/html/CentoS, 执行:
mount -o loop /var/www/html/CentOS-7-x86_64-DVD-1708.iso /var/www/html/Centos/
3)、查看文件夹 /var/www/html/CentoS
可以看到 repodata 文件夹的存在,repodata 作为软件的仓库信息文件
ISO 镜像 yum 源搭建 OK
2、使用 yum 源
1)、编辑 repo 文件
在本机或其他机器上,进入文件夹:/etc/yum.repos.d/ 将其中的文件移除掉
新建文件:CentOS-Local.repo(可由 CentOS-Base.repo copy)
2)、更新 yum 源
yum clean 清除 yum 源缓存
yum repolist 列出可用 yum 源
1. 确认你的CentOS 的版本首先通过以下命令确认你的CentOS 版本
$ cat /etc/redhat-release CentOS release 6.4 (Final)
2. 下载EPEL 的rpm 安装包
现在从上面的地址下载CentOS 版本所对应的EPEL 的版本
$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
3. 安装EPEL
通过以下命令安装EPEL 软件包
$ sudo rpm -ivh epel-release-6-8.noarch.rpm
或
$ sudo rpm -ivh epel-release*
5. 检查EPEL 源
安装好EPEL 源后,用yum 命令来检查是否添加到源列表
# yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.vonline.vn * epel: buaya.klas.or.id * extras: centos-hn.viettelidc.com.vn * updates: mirrors.fibo.vn repo idrepo name status base CentOS-6 - Base 6,381 epel Extra Packages for Enterprise Linux 6 - x86_64 10,023 extras CentOS-6 - Extras 13 nginx nginx repo 47 updatesCentOS-6 - Updates 1,555 repolist: 18,019
EPEL已经在repo 后列出,并且显示提供了上万个软件包,所以EPEL 已经安装到你的CentOS了。
EPEL源的配置安装到了 /etc/yum.repos.d/epel.repo 文件。
现在来试一下从EPEL 获取软件包
$ sudo yum install htop
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)