Configuration of Local Yum Repository
Hi Everyone! Today we are going to discuss regarding configuration of Local Yum on Linux machine. Yum’s most important function is for adding and removing packages. It adds up to many features in a Linux machine. As per the requirement you can add or remove the packages. Before starting with yum configuration, Lets go into basics.
What is YUM?
YUM stands for Yellow Dog Updater Manager. It is a default package management utility. Yum uses repository to get necessary rpm files. Yum can automatically resolve software dependencies and based on system hardware it can automatically select appropriate version of RPM package from repository
What is Repository?
A Repository is a collection of RPM files. Repository may contain multiple versions of the same RPM package. Repository may contain different builds for different architectures for example one for i686 and other for x86_64. A repository can be configured locally or remotely. Today we are going to discuss configuration of local repository.
So, Lets begin with configuration of Yum local repository.
Step 1 : Copy the packages from base server to required server.
Command : scp -r /Packages [email protected]_address:/path
Step 2 : Create Repository
Command : createrepo /Packages
Step 3 : Create file in default repo location.
Default Location : /etc/yum.repos.d
Command : vi /etc/yum.repos.d/local.repo
Here, New file is created local.repo
Step 4 : Once file is created, write below statement into it.
Command : vi local.repo
Click on ‘i’ (To insert)
Press Colon and wq! (Save and Exit Recursive)
Step 5 : Now delete the cache or yum cache using below command.
Command: yum clean all
Step 6 : Now, Enable yum repository using below command.
Command: yum repolist all
I will share some of the important commands related to Yum which will be helpful to you for rest of your career.
- To install new package in YUM
Syntax : yum install package name
For Example : yum install httpd.18.104.22.168.e15
- To delete existing package in YUM
Syntax : yum remove package name
For Example : yum remove httpd.22.214.171.124.e15
- To update the package
Command : yum update
- To list the package
Command : yum list pkg_name
For Ex : yum list firefox
- To search a package
Command : yum search pkg_name
For ex : yum search firefox
- To list all installed packages.
Command : yum list installed | less
- To check available updates.
Command : yum check-update
- To update system
Command : yum update
- List enabled Yum repositories
Command : yum repolist
10.List enabled and disabled Yum repositories.
Command : yum repolist all
- To clean Yum cache
Command : yum clean all
- View history of Yum
Command : yum history
Do let me know, how you find the blog. Was it helpful to you ? So, if you like the blog. Do subscribe to get notified…!!!
Thank You !
Happy Learning !!!
If you have doubt or queries, you can definetely comment us or can mail us on [email protected]
If you have any Recommendation for future blog, You can email us on [email protected]
Top Searches :
- Best Patching Guide
- 2. Top Linux Commands
- Introduction to linux.
- Websphere hack
- My Story – Jboss Hardening
- Installation and configuration of Apache 2.2 on Linux
- DB Auto Re-connect.