Article directory
centos yum source configuration
Centos builds intranet yum source
Hello, the method to build a local intranet YUM warehouse on CentOS system is as follows:
- Install httpd and createrepo tools
yum install httpd createrepo -y
- Create a warehouse directory and switch to it
mkdir -p /var/www/html/centosrepo
cd /var/www/html/centosrepo
- Copy the local rpm package to this directory, for example:
cp /path/to/rpm/*.rpm /var/www/html/centosrepo/
- Create warehouse metadata
createrepo .
This will scan all rpm packages in the current directory and generate warehouse metadata.
- Start httpd service
systemctl start httpd
Yum software source configuration of intranet centos
The yum software source of centos7 on the intranet has been built. You can use the following command to use it on the centos7 operating system on the intranet:
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
wget -P /etc/yum.repos.d/ http://192.168.1.100:9090/centos/CentOS-Base.repo
chmod +r /etc/yum.repos.d/CentOS-Base.repo
yum clean all
yum makecache
CentOS7 native yum source modified to Alibaba yum source
Ali mirror source official website: http://mirrors.aliyun.com/repo/
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
Add epel source
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