Configure Local Yum repos KodeKloud Engineer Task Success

Ticker

6/recent/ticker-posts

Configure Local Yum repos KodeKloud Engineer Task Success


Question :  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 local_yum and make sure to set Repository ID to local_yum. Configure it to use package's location /packages/downloaded_rpms/.

c. Install package httpd from this newly created repo.


Please Note :-  Perform the below commands based on your question server,  user name & other details that might differ. So please read the task carefully before executing it. All the Best 👍


Solution:  

1. At first login on Backup server  & Switch to  root user

thor@jump_host ~$ ssh clint@stbkp01

The authenticity of host 'stbkp01 (172.18.0.5)' can't be established.

ECDSA key fingerprint is SHA256:oElhfthbqdFj2jofFZT4DnHiMZ+NX756xIoKVv8Juq8.

ECDSA key fingerprint is MD5:2d:e9:0e:d0:e4:61:61:fe:6d:40:18:75:8e:78:97:a2.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'stbkp01,172.18.0.5' (ECDSA) to the list of known hosts.

clint@stbkp01's password:

[clint@stbkp01 ~]$

[clint@stbkp01 ~]$ sudo su -

 We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:

     #1) Respect the privacy of others.

    #2) Think before you type.

    #3) With great power comes great responsibility.

 [sudo] password for clint:

[root@stbkp01 ~]#

2. Run the Below command to   check is there  already any yum repository is available     

[root@stbkp01 ~]# yum repolist   

Loaded plugins: fastestmirror, ovl

Determining fastest mirrors

repolist: 0

[root@stbkp01 ~]#

 3. Since there is no repo you need to create local repo  as per the task

[root@stbkp01 ~]# vi /etc/yum.repos.d/local_yum.repo

[root@stbkp01 ~]# cat /etc/yum.repos.d/local_yum.repo

[local_yum]

name=local_yum

baseurl=file:///packages/downloaded_rpms/

enabled = 1

gpgcheck = 0

[root@stbkp01 ~]#


4. After the file is saved, check to create repo listed 

[root@stbkp01 yum.repos.d]# yum repolist

Loaded plugins: fastestmirror, ovl

Loading mirror speeds from cached hostfile

local_yum                                                                                                           | 2.9 kB  00:00:00    

local_yum/primary_db                                                                                                |  57 kB  00:00:00    

repo id                                                           repo name                                                          status

local_yum                                                         local_yum                                                          55

repolist: 55

[root@stbkp01 yum.repos.d]#


5. As per the task install package  (I have installed httpd using this repo )

[root@stbkp01 yum.repos.d]# yum install httpd

Loaded plugins: fastestmirror, ovl

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package httpd.x86_64 0:2.4.6-90.el7.centos will be installed

--> Processing Dependency: httpd-tools = 2.4.6-90.el7.centos for package: httpd-2.4.6-90.el7.centos.x86_64

--> Processing Dependency: system-logos >= 7.92.1-1 for package: httpd-2.4.6-90.el7.centos.x86_64

Verifying  : apr-1.4.8-5.el7.x86_64                                                                                                 

  Verifying  : centos-logos-70.0.6-3.el7.centos.noarch                                                                                  

 Installed:

  httpd.x86_64 0:2.4.6-90.el7.centos                                                                                                       

 Dependency Installed:

  apr.x86_64 0:1.4.8-5.el7                         apr-util.x86_64 0:1.5.2-6.el7         centos-logos.noarch 0:70.0.6-3.el7.centos       

  httpd-tools.x86_64 0:2.4.6-90.el7.centos         mailcap.noarch 0:2.1.41-2.el7       

 Complete!

[root@stbkp01 yum.repos.d]#


6. Validate the task 

[root@stbkp01 yum.repos.d]# yum list httpd

Loaded plugins: fastestmirror, ovl

Loading mirror speeds from cached hostfile

Installed Packages

httpd.x86_64                                                 2.4.6-90.el7.centos                                                 @local_yum

[root@stbkp01 yum.repos.d]#


7.  Click on Finish & Confirm to complete the task successful

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , please go through and share your comments. Like and share the knowledge





Post a Comment

0 Comments

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user