Centos配置软件源

Linux 刘宇帅 5年前 阅读量: 1262

Centos7修改软件源

这里以Centos7为例子,6同样的方法url里相应7修改为6即可

配置remi源

remi源依赖epel源,安装epel源

yum install epel-release

安装remi源

rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-remi

启用remi源 /etc/yum.repos.d/remi.repo,在[remi]下边的enabled=0改为enabled=1

同时也安装了各版本的php源,需要开启的同样修改相应的enabled即可。

ls /etc/yum.repos.d
CentOS.repo  epel.repo  EPEL.repo  epel-testing.repo remi-php54.repo  remi-php70.repo  remi-php71.repo  remi-php72.repo  remi.repo  remi-safe.repo

添加国内源

网易源 访问 http://mirrors.163.com/ 找到 CentOS 系统, 点击右边的 centos使用帮助 找到 CentOS 7 项, 复制链接地址

cd /etc/yum.repos.d
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum update

阿里源 访问 http://mirrors.aliyun.com/ 找到 CentOS 系统, 点击右边的 help 按提示下载 CentOS 7 项的 repo 文件, 注意不要直复制它的命令, 会覆盖官方源.

cd /etc/yum.repos.d
wget http://mirrors.aliyun.com/repo/Centos-7.repo
yum update

Nginx源

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

提示

功能待开通!


暂无评论~