Yellow-dog Updater Modified(YUM):
YUM stands for “Yellowdog Updater Modified”. It is an interactive, rpm-based package manager. YUM allows user and administrators to easily install and update, remove packages on systems. It helps to install rpm packages easily with numerous third-party repositories and need not to worry about dependencies.
YUM is an open source command-line and graphical based package manager tool for RPM-based Linux Systems. It automatically computes dependencies and figures out the things to install packages. It is easier to manage a group of machines without any manual updates using rpm.
What is YUM Repository
A repository is a collection of software and stored on a server. YUM repositories hold the rpm packages and enable download and install new software on your system. YUM repository configuration file is stored in /etc/yum.repos.d/repo name. repo extension to be recognized by YUM.
Required YUM Repository configuration file options are:
- Repository ID – repository id is a unique name.
example: [Newrepo]
- Name – A human-readable name of the repository.
example: name=new repository
- Baseurl – URL to the repodata directory
4. Enabled – Enable repository when performing updates and installs
How to Configure YUM Repository file
Step 1:
Create a new YUM Repository configuration file with .repo extension in /etc/yum.repos.d/filename with extension. To create a new file with “vi editor” use the following command from the console
# vi /etc/yum.repos.d/new.repo
Step 2:
Add the YUM repository options to the newly created YUM repository configuration file and save changes.
/etc/yum.repos.d/new.repo
[newrepofile]
name=New Repo File
baseurl= http://content.example.com/rhel7.0/x86_64/dvd
enabled=1
Basic YUM Commands used in Linux:
1. Install a package with YUM
To install a YUM package, you can use the following command. Multiple package names can be separated by a space.
Syntax:
# yum install package name
Example: #yum install httpd
2. Remove a Package with YUM
To remove any package, run the following command. You can add multiple package names separated by a space.
Syntax:
# yum remove package name
Example: #yum remove Mozilla Firefox
3. Update a Package with YUM
To update any software to the latest version, run the following command. You can use multiple package names separated by a space
Syntax:
#yum update package name
Example: #yum update samba
4. Reinstall a Package with YUM
You can reinstall a YUM using the following command to resolve installation issues
Syntax:
#yum reinstall package name
Example: #yum reinstall sudo
5. To list all installed packages
You can view all the installed the packages in your system.
Syntax:
#yum list all
6. To search available installed packages
You can search available installed packages in your system with help of ‘keyword’
Syntax:
#yum search ‘keyword’
Example: yum search nfs
7. To display the package information
You can display the specific package information with help of ‘info’ command.
Syntax:
#yum info package name
#yum info package name
8. Which package does a file belong to?
Use ‘yum provides’ if you want to know which package a particular file belongs to.
for example /etc/sysconfig/nfs
Syntax:
# yum provides ‘file location’
Example: # yum provides /etc/sysconfig/nfs
We hope that this article provides detailed information about YUM. For more information, follow us on Twitter and Facebook and For video tutorials, subscribe to our YouTube channel ServerCake India.