# 8.1 Repositories In large companies, the use of online software repositories is discouraged. This makes it a lot harder to install and update software. The solution for this problem is that a company will have and maintain its own repositories. So knowing how to add repositories manually is a necessity. We can manually add repositories by adding a file to the folder ```/etc/yum.repos.d/```. The file **must** end with ```.repo```. Below an example: ```bash /etc/yum.repos.d/example.repo ``` The content of the file must have the following: |Parameter|Input|Use| |:-|:-|:-| |[repository]|none|Repository ID| |name=|repository_name|Where repository_name is a string describing the repository| |baseurl=|repository_url|The location by IP or Name of the repo| |gpgcheck=|0|A binairy wether to use a GPG Key Check| |enabled=|1|A Binairy wether the repo is enabled or not| Where repository_url is an URL to the repository with the repository data: - If the repository is available over HTTP, use: http://path/to/repo - If the repository is available over FTP, use: ftp://path/to/repo - If the repository is local to the machine, use: file:///path/to/local/repo **Heads up:** don't forget the extra / at the file repository. There are indeed 3 forward slash signs necessary. ### Configuring a Repository During the exam you might have to configure your own repositories. We have set up the following repository server for your use. Repository provided at: - http://192.168.60.8/repos8/BaseOS - http://repo.greateracademy.local/repos8/BaseOS We will need to create a new repo file at: ```/etc/yum.repos.d/``` Let's make the following file ```errata.repo```: ```bash vim /etc/yum.repos.d/ ``` And add one of the following examples:
```bash [Appstream] name=appstream baseurl=http://ftp.scientificlinux.org/linux/redhat/rhel/rhel-9-beta/appstream/x86_64/ enabled=1 gpgcheck=0 ``` Now let's attempt to update the kernel ```bash [root@rhcsa ~]# dnf update kernel -y ```