{"id":11674,"date":"2025-11-27T11:27:36","date_gmt":"2025-11-27T05:57:36","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=11674"},"modified":"2026-09-07T11:08:19","modified_gmt":"2026-09-07T05:38:19","slug":"configure-yum-on-linux","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/configure-yum-on-linux\/","title":{"rendered":"Configure YUM on Linux: Ultimate Setup Guide for Admins"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">YUM (Yellowdog Updater, Modified) is a popular package management tool used by Linux distributions such as CentOS, Red Hat Enterprise Linux (RHEL), and Fedora. To streamline software management, you can configure YUM to install, update, and remove software packages easily using repositories. Configuring YUM on Linux is essential for managing software packages and ensuring your system stays up to date.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will walk you through how to configure YUM, set up custom repositories, and manage software packages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before configuring YUM on your Linux system, ensure the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Linux Distribution<\/strong>: YUM is used by CentOS, RHEL, and Fedora. The instructions here are specific to those distributions.<\/li>\n\n\n\n<li><strong>Root Access<\/strong>: You will need root or sudo access to\u00a0<a href=\"https:\/\/www.youstable.com\/blog\/install-yum-on-linux\/\" data-type=\"link\" data-id=\"https:\/\/www.youstable.com\/blog\/install-yum-on-linux\/\">configure YUM and install packages<\/a>.<\/li>\n\n\n\n<li><strong>Basic Knowledge of Linux Commands<\/strong>: Familiarity with the Linux command line is helpful when managing repositories and using YUM.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once the prerequisites are in place, you can begin configuring YUM for package management on your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure-yum-on-linux\"><strong>Configure YUM on Linux<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Configure YUM on Linux to streamline software installation, updates, and dependency management across your system using trusted repositories.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-understand-yum-configuration-files\"><strong>Step 1: Understand YUM Configuration Files<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">YUM configuration is controlled through several files, including the main configuration file (<code>\/etc\/yum.conf<\/code>) and individual repository files stored in&nbsp;<code>\/etc\/yum.repos.d\/<\/code>. The configuration files define how YUM will behave, including the repositories it should use to find and download software packages.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Main Configuration File (<code>\/etc\/yum.conf<\/code>)<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<code>yum.conf<\/code>&nbsp;file contains system-wide configuration settings for YUM. To edit the configuration, run:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo nano \/etc\/yum.conf\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Some important sections of this file include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>[main] section<\/strong>: Defines general YUM settings like timeout, caching, and logging.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example configuration:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;main]\ncachedir=\/var\/cache\/yum\nkeepcache=0\ndebuglevel=2\nlogfile=\/var\/log\/yum.log\nexactarch=1\ngpgcheck=1\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>cachedir<\/strong>: Location of YUM\u2019s cache directory.<\/li>\n\n\n\n<li><strong>keepcache<\/strong>: Defines whether to keep downloaded packages in the cache after installation (<code>1<\/code>\u00a0to keep,\u00a0<code>0<\/code>\u00a0to delete).<\/li>\n\n\n\n<li><strong>gpgcheck<\/strong>: Enables GPG signature verification for packages to ensure they come from trusted sources.<\/li>\n\n\n\n<li><strong>Repository Configuration Files (<code>\/etc\/yum.repos.d\/<\/code>)<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The repository configuration files are where the locations of YUM repositories are defined. These files end with&nbsp;<code>.repo<\/code>&nbsp;and can contain multiple repositories. To view or edit a repository file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo nano \/etc\/yum.repos.d\/CentOS-Base.repo\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Each&nbsp;<code>.repo<\/code>&nbsp;file consists of multiple repository definitions that specify the repository\u2019s name, base URL, and additional settings like whether GPG verification is enabled.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-set-up-and-configure-yum-repositories\"><strong>Step 2: Set Up and Configure YUM Repositories<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">YUM uses repositories to download and install packages. Repositories can be official (provided by the distribution) or custom repositories that you or your organization may set up. To configure repositories, you need to edit the&nbsp;<code>.repo<\/code>&nbsp;files in&nbsp;<code>\/etc\/yum.repos.d\/<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"official-repositories\"><strong>Official Repositories<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Most Linux distributions provide official repositories that can be enabled out-of-the-box. For example, on CentOS, the default repository file is&nbsp;<code>\/etc\/yum.repos.d\/CentOS-Base.repo<\/code>. Here\u2019s an example of an entry in the repository file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;base]\nname=CentOS-$releasever - Base\nbaseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/os\/$basearch\/\ngpgcheck=1\nenabled=1\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>[base]<\/strong>: The repository ID.<\/li>\n\n\n\n<li><strong>name<\/strong>: A human-readable name for the repository.<\/li>\n\n\n\n<li><strong>baseurl<\/strong>: The URL from which to download packages.<\/li>\n\n\n\n<li><strong>enabled<\/strong>: Whether the repository is enabled (<code>1<\/code>\u00a0for enabled,\u00a0<code>0<\/code>\u00a0for disabled).<\/li>\n\n\n\n<li><strong>gpgcheck<\/strong>: Whether to check GPG signatures of the packages.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"add-custom-repositories\"><strong>Add Custom Repositories<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To add a custom repository, you\u2019ll need to create a new&nbsp;<code>.repo<\/code>&nbsp;file or modify an existing one. For example, to add a custom repository for a third-party package, create a file in&nbsp;<code>\/etc\/yum.repos.d\/<\/code>&nbsp;with the following content:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;custom-repo]\nname=Custom Repository\nbaseurl=http:\/\/example.com\/repo\/\ngpgcheck=1\nenabled=1\ngpgkey=http:\/\/example.com\/repo\/RPM-GPG-KEY\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>baseurl<\/code>\u00a0specifies the URL of the custom repository.<\/li>\n\n\n\n<li><code>gpgkey<\/code>\u00a0points to the GPG key used to sign packages.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"enable-or-disable-repositories\"><strong>Enable or Disable Repositories<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To enable or disable a repository, you can set the&nbsp;<code>enabled<\/code>&nbsp;value in the&nbsp;<code>.repo<\/code>&nbsp;file to&nbsp;<code>1<\/code>&nbsp;(enabled) or&nbsp;<code>0<\/code>&nbsp;(disabled). You can also disable repositories temporarily using the&nbsp;<code>--disablerepo<\/code>&nbsp;flag when running&nbsp;<code>yum<\/code>&nbsp;commands. Example to disable a repository:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum install package_name --disablerepo=repo_id\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"check-available-repositories\"><strong>Check Available Repositories<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To list all repositories available to YUM:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum repolist\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This will show the repositories and the number of packages available in each one.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-install-remove-and-update-packages-using-yum\"><strong>Step 3: Install, Remove, and Update Packages Using YUM<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To install a package using YUM, use the&nbsp;<code>install<\/code>&nbsp;command. For example, to install the&nbsp;<code>vim<\/code>&nbsp;package:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum install vim\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Remove Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To remove a package, use the&nbsp;<code>remove<\/code>&nbsp;command. For example, to remove the&nbsp;<code>vim<\/code>&nbsp;package:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum remove vim\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Update Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To update all installed packages to the latest available version, run:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum update\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">To update a specific package, use:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum update package_name\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Search for Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To search for a package in the enabled repositories:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum search package_name\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>List Installed Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To list all installed packages:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum list installed\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Upgrade Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To upgrade installed packages to the latest version:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum upgrade\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-clean-yum-cache\"><strong>Step 4: Clean YUM Cache<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">YUM caches packages and metadata by default to improve performance. Over time, the cache can take up significant disk space. You can\u00a0<a href=\"https:\/\/www.youstable.com\/blog\/how-to-clear-cache-in-browser\/\" data-type=\"link\" data-id=\"https:\/\/www.youstable.com\/blog\/how-to-clear-cache-in-browser\/\">clean the cache<\/a>\u00a0with the following commands:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Clean All YUM Cache<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To remove all cached data (packages,\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Metadata\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Metadata\" rel=\"noreferrer noopener\">metadata<\/a>, etc.):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum clean all\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Clean Metadata Cache<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To clean only the metadata cache:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum clean metadata\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Clean Package Cache<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To clean only the cached packages:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum clean packages\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-5-manage-yum-groups\"><strong>Step 5: Manage YUM Groups<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">YUM groups are collections of related packages that can be installed or removed together. To manage YUM groups, use the following commands:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>List Available Groups<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To list all available groups:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum group list\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install a Group<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To install a group of packages (e.g.,&nbsp;<code>Development Tools<\/code>):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum group install &quot;Development Tools&quot;\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Remove a Group<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To remove a group of packages:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum group remove &quot;Development Tools&quot;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we\u2019ve covered how to configure YUM on Linux, including how to install and manage repositories, configure basic settings, install, remove, and update packages, and manage YUM groups. YUM is an essential tool for managing packages on Linux distributions like CentOS, RHEL, and Fedora, providing a simple and powerful way to install, update, and remove software.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By configuring YUM correctly, you can ensure that your system is secure, up-to-date, and running the necessary software packages. Regularly cleaning the YUM cache and managing repositories will<\/p>\n","protected":false},"excerpt":{"rendered":"<p>YUM (Yellowdog Updater, Modified) is a popular package management tool used by Linux distributions such as CentOS, Red Hat Enterprise [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":11679,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"iawp_total_views":56,"footnotes":""},"categories":[350,2259],"tags":[],"class_list":["post-11674","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","category-kb-linux"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=11674"}],"version-history":[{"count":1,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11674\/revisions"}],"predecessor-version":[{"id":23049,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11674\/revisions\/23049"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/11679"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=11674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=11674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=11674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}