文章目录
- centos yum源配置
- centos搭建内网yum源
- 内网centos的yum软件源配置
- CentOS7 原生 yum 源修改为阿里 yum 源
centos yum源配置
centos搭建内网yum源
您好,在CentOS系统上搭建本地内网YUM仓库的方法如下:
- 安装httpd和createrepo工具
yum install httpd createrepo -y
- 创建仓库目录并切换到该目录
mkdir -p /var/www/html/centosrepo
cd /var/www/html/centosrepo
- 将本地rpm包复制到该目录下,例如:
cp /path/to/rpm/*.rpm /var/www/html/centosrepo/
- 创建仓库元数据
createrepo .
这将扫描当前目录下的所有rpm包并生成仓库元数据。
- 启动httpd服务
systemctl start httpd
内网centos的yum软件源配置
内网centos7的yum软件源已搭建完成,使用下面命令即可在内网的centos7操作系统上使用:
mkdir /etc/yum.repos.d/backupmv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backupwget -P /etc/yum.repos.d/ http://192.168.1.100:9090/centos/CentOS-Base.repochmod +r /etc/yum.repos.d/CentOS-Base.repoyum clean allyum makecache
CentOS7 原生 yum 源修改为阿里 yum 源
阿里镜像源官网:http://mirrors.aliyun.com/repo/
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bakcurl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
添加 epel 源
rpm -qa |grep epel
rpm -e epel-release
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache