Under Construction

Adding a Local Repository

If there is a repository in the local file system, it can be added by using “file://” in the baseurl.

As an example, we have created a small repository on the local system under /var/myrepo. To add this repository to YUM, the following lines must either be added to the /opt/freeware/etc/yum/yum.conf file, or in a separate file with the ending “.repo” in the directory /opt/freeware/etc/yum/repos.d:

[myrepo]
name=my private repository
baseurl=file:///var/myrepo

Myrepo is the ID of the repository, “my private repository” is the so-called human readable name and file:///var/myrepo is the baseurl that refers to the local repository. Please note that the slash “/” is used three times! The first two separate the URL type file from the following part, which must be the absolute path to the directory of the repository (and therefore start with a slash).

The repository can then be used immediately.

Alternatively, a file with the ending “.repo” (in the following example /tmp/myrepo.repo) with the above content can be created at any location:

aixnim # cat /tmp/myrepo.repo
[myrepo]
name=my private repository
baseurl=file:///var/myrepo
aixnim #

The repository can then be added using the yum-config-manager and the option “—add-repo“:

aixnim # yum-config-manager --add-repo /tmp/myrepo.repo
adding repo from: /tmp/myrepo.repo
grabbing file /tmp/myrepo.repo to /opt/freeware/etc/yum/repos.d/myrepo.repo
myrepo.repo                                                                      |   63 B  00:00:00    
repo saved to /opt/freeware/etc/yum/repos.d/myrepo.repo
aixnim #

The specified repo file is then automatically stored under /opt/freeware/etc/yum/repos.d.