Yum is a software repository to store and maintain software packages and from this central location users are able to query for information about available packages, fetch packages from repositories, install and uninstall them, and update an entire system to the latest available version. Yum holds RPM package file for
These software repository (repo) are on internet servers so wider public users can access it freely. However, you can create your local repository in your local LAN server. We can create yum repository to store RPM package locally or FTP or HTTPS server.
In this tutorial, we set up a FTP yum repository on your local network.
So here we have a few steps to do:
1. Install vsftpd server
2. Create repository with createrepo
3. Configure repository
4. Configure clients
1) Install Ftp server
Lets first install a FTP server and we will use vsftpd. You can mount CentOS or RHEL installation DVD.
# mkdir ~/Desktop/rhel_cd # mount /dev/cdrom ~/Desktop/rhel_cd # cd ~/Desktop/rhel_cd/Server # rpm –ivh vsftpd*
2) Create repository with createrepo
Let's create the repo using below command
# rpm –ivh createrepo*
3) Configure repository
Now we can configure the repository
# cd /var/ftp/pub/Server/repodata # cp comps-rhel5-server-core.xml /var/ftp/pub/Server/ # cd /var/ftp/pub/Server # createrepo -vg comps-rhel5-server-core.xml /var/ftp/pub/Server/ # service vsftpd start
4) Configure client
Now configure client machine to use ftp as local repo.
# vi /etc/yum.repos.d/yum_server.repo Add: [Server] name=MY_SERVER baseurl=ftp://192.168.2.100/pub/Server gpgcheck=0
# vi /etc/vsftpd/vsftpd.conf Set the following parameter (if not already set) anonymous_enable = yes
# service vsftpd restart
Note: Yum provides secure package management by enabling GPG (Gnu Privacy Guard; also known as GnuPG) signature verification on GPG-signed packages to be turned on for all package repositories (i.e. package sources), or for individual repositories. When signature verification is enabled, Yum will refuse to install any packages not GPG-signed with the correct key for that repository. This means that you can trust that the RPM packages you download and install on your system are from a trusted source, such as Red Hat, and were not modified during the transfer.