Working with YUM repos
YUM repositories are collections of RPM (RedHat Package Manager) packages. The repository can either contain the RPMs locally or remotely (accessed voa FTP, HTTP or HTTPS). YUM configuration files contain the information required so that a respository can be accessed and software installed from it.
Configuring a YUM Repository
1. Create YUM Repository configuration file in /etc/yum.repos.d . The file mist have a .repo extension, e.g.
cd /etc/yum.repos.d vi custom.repo
2. Add YUM Repository options, e.g.
[customrepo] name=A Custom Repository baseurl=http://justsomestuff.co.uk/CentOS/6/os/i386/ enabled=1 gpgcheck=1 gpgkey=http://justsomedtuff.co.uk/CentOS/6/os/i386/RPM-GPG-KEY-CentOS-6
The lines have the following meaning:
- Repository ID - One word unique repository ID (e.g. [customrepo])
- Name - A readable description
- Baseurl - URL to the location of the repodata directory. You can use file://path if repository is located locally or ftp://link, http://link, https://link if repository is located remotely
- Enabled - Enable repository when performing updates and installs, i.e. if you do a yum search or yum install, this repository will be checked for the package
- Gpgcheck - Enable/disable GPG signature checking
- Gpgkey - URL to the location of the GPG key
GPG keys are used to sign data so the recipient of a package can ensure that the contents haven't been tampered with since that data was signed. To make use of this, the recipient must have a copy of (or access to) the senders public GPG key. This is obviously a useful facility but in case, for some reason, you don't have the public GPG key, checking can be overridden by specifying the flag –nogpgcheck with the yum command.