Configure Local Yum repos: KodeKloud Engineer Task
Task:
The Nautilus production support team and security team had a meeting last month in which they decided to use local yum repositories for maintaing packages needed for their servers. For now they have decided to configure a local yum repo on Nautilus Backup Server. This is one of the pending items from last month, so please configure a local yum repository on Nautilus Backup Server as per details given below.
a. We have some packages already present at location /packages/downloaded_rpms/ on Nautilus Backup Server.
b. Create a yum repo named epel_local and make sure to set Repository ID to epel_local. Configure it to use package’s location /packages/downloaded_rpms/.
c. Install package wget from this newly created repo.
Solution:
Step 1: At first login to backup server as “root” with command: ssh clint@stbkp01
Step 2: Switch to root user : sudo su -
Step 3: Run Below command to check is there already any yum repository is available
yum repolist
Step 4: If there is no repo you need to create local repo as per the task.
vi /etc/yum.repos.d/localyum.repo
Step 5: Please add the location of the downloaded rpms folder. It should resemble output below:
[localyum]
name=localyum
baseurl=file:///packages/downloaded_rpms/
enabled = 1
gpgcheck = 0
[epel_local]
Repository ID= epel_local
name=epel_local
baseurl=file:/packages/downloaded_rpms/
enabled=1
gpgcheck=0
Step 6: Run command createrepo /yum_local/
To clean all run
yum clean all
Step 7: After file saved please run yum repolist
to check create repo listed
Step 8: As per the task install package using the following command:
yum install --disablerepo="*" --enablerepo= “epel_local” wget
Get snoopy and Keep Learning…!!