Dec 07

On Creating a Yum Server on Redhat/CentOS Linux

Mount Installer ISO

mkdir /mnt/dvd1

mount /dev/sr0 /mnt/dvd1

Check if FTP server is installed

systemctl status vsftpd

systemctl start vsftpd

Install ftp Server. Using rpm as yum is not available yet [default yum needs the internet, kindof]

cd /mnt/dvd1/Packages/

rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm

systemctl start vsftpd

systemctl enable vsftpd

Copy rpm installer packages to the FTP server under Packages folder

cp -rv /mnt/dvd1/Packages /var/ftp/pub/

Also, copy the key file for Yum. Key file is to verify the integrity of the packages

cp -rv /mnt/dvd1/RPM-GPG-KEY-CentOS-7 /var/ftp/pub/

mv /var/ftp/pub/RPM-GPG-KEY-CentOS-7 /var/ftp/pub/key

Install Createrepo using rpm -ivh; create repo will help to create package rep database based on the packages on the FTP server

rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm

Create the repp config file on yum server

cd /etc/yum.repos.d/

mkdir old

mv *.repo old/

vim ftp.repo

ftp.repo  file content







one line for pointing to the GPG key file - if you want to configure for key based verification


Allow ftp over firewall

firewall-cmd --add-service=ftp --perm

systemctl reload firewalld
systemctl restart firewalld

Again Checking if yum works locally on the server

yum repolist all
yum repolist
yum repolist enabled
yum -y install tree
yum clean
yum clean cache
yum -y install tree
yum repolist enabled
yum repolist

Create Installer Repository Data

cd /var/ftp/pub/Packages/

createrepo .

Configure name for the server

hostnamectl set-hostname yumserver

vim /etc/hosts yumserver yumclient

ip addr

ip addr ens33

use nmtui command or ifconfig to set the IP of the server [when required]

you might want to restart the interface

ifdown ens33; ifup ens33

ping yumserver

ping yumclient

before pinging you might want to see if the ping package is installed and if it is blocked or not

Check if yum server works or not

yum install tree

yum -y install lynx

Configure a Client to use your FTP based yum server

Copy the ftp.repo

scp /etc/yum.repos.d/ftp.repo root@yumclient:/etc/yum.repos.d/

For Windows:

tscp /etc/yum.repos.d/ftp.repo root@yumclient:/etc/yum.repos.d/

Check if the client can access your yum server

yum install tree

yum -y install lynx

Skip to toolbar