{"id":13754,"date":"2025-12-16T14:22:05","date_gmt":"2025-12-16T08:52:05","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=13754"},"modified":"2025-12-24T16:13:56","modified_gmt":"2025-12-24T10:43:56","slug":"optimize-yum-on-linux","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/optimize-yum-on-linux","title":{"rendered":"How to Optimize YUM on Linux Server"},"content":{"rendered":"\n<p>To optimize YUM on a Linux server, enable the fastest mirror selection, tune caching and metadata settings, clean and rebuild YUM data regularly, disable slow or unused repositories, use delta RPMs, and automate off-peak updates. For fleets, add a local mirror or caching proxy. On RHEL 8\/9 derivatives, use the equivalent DNF options.<\/p>\n\n\n\n<p>Managing updates should be fast, consistent, and safe. In this guide, you\u2019ll learn how to optimize YUM on Linux servers for quicker installs and updates, predictable performance, and fewer repo-related errors\u2014based on years of managing CentOS\/RHEL systems in production <a href=\"https:\/\/www.youstable.com\/blog\/create-a-custom-hosting-environment-with-a-dedicated-server\/\">hosting environments<\/a>. Where applicable, I\u2019ll also map settings to DNF for newer distributions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"what-is-yum-and-why-optimization-matters\"><strong>What Is YUM and Why Optimization Matters<\/strong><\/h2>\n\n\n\n<p>YUM (Yellowdog Updater, Modified) is the package manager used on CentOS\/RHEL 7 and older. It resolves dependencies, pulls metadata, and downloads packages from multiple repositories. Without tuning, YUM can feel slow due to network latency, overly chatty repositories, or bloated metadata. Proper optimization saves time, bandwidth, and reduces update failures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"quick-wins-a-5-minute-yum-speed-checklist\"><strong>Quick Wins: A 5-Minute YUM Speed Checklist<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable the fastest mirror plugin and keep plugins on.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youstable.com\/blog\/clear-cache-in-windows-11\/\">Clean and rebuild YUM cache<\/a> and RPM database.<\/li>\n\n\n\n<li>Disable slow or unused third\u2011party repos by default.<\/li>\n\n\n\n<li>Keep packages cached for reuse (especially on build servers).<\/li>\n\n\n\n<li>Automate updates off\u2011peak with yum-cron and lock down GPG checks.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"prerequisites-and-notes\"><strong>Prerequisites and Notes<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Applies to CentOS\/RHEL 6\/7 and compatible forks still using YUM.<\/li>\n\n\n\n<li>For RHEL\/AlmaLinux\/Rocky 8+ (DNF), see the DNF mapping section below.<\/li>\n\n\n\n<li>Run commands as root or with sudo.<\/li>\n\n\n\n<li>Back up repo <a href=\"https:\/\/www.youstable.com\/blog\/edit-wp-config-php-file-in-wordpress\/\">files in \/etc\/yum.repos.d\/ before editing<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-1-enable-and-tune-core-yum-settings\"><strong>Step 1: Enable and Tune Core YUM Settings<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"edit-etc-yum-conf-for-performance\"><strong>Edit \/etc\/yum.conf for Performance<\/strong><\/h3>\n\n\n\n<p>These settings reduce unnecessary downloads, avoid stalls, and keep YUM responsive under normal network conditions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cp \/etc\/yum.conf \/etc\/yum.conf.bak\nsudo vi \/etc\/yum.conf\n\n&#91;main]\nplugins=1\nkeepcache=1\nmetadata_expire=6h\n# Network tuning (adjust to your environment)\ntimeout=30\nretries=3\nminrate=200k\n# If IPv6 is flaky in your DC:\n# ip_resolve=4\n# Install faster by skipping docs in minimal images\ntsflags=nodocs\n# Security\ngpgcheck=1\n<\/code><\/pre>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>plugins=1 ensures YUM can use <a href=\"https:\/\/www.youstable.com\/blog\/top-wordpress-security-plugins\/\">performance and security plugins<\/a>.<\/li>\n\n\n\n<li>keepcache=1 helps when multiple servers reuse packages (build\/release hosts).<\/li>\n\n\n\n<li>metadata_expire=6h balances freshness with fewer metadata fetches.<\/li>\n\n\n\n<li>timeout\/minrate\/retries reduce slow-hanging sessions.<\/li>\n\n\n\n<li>tsflags=nodocs cuts install time and <a href=\"https:\/\/www.youstable.com\/blog\/check-disk-space-files-in-linux\/\">disk usage<\/a> on minimal hosts.<\/li>\n\n\n\n<li>gpgcheck=1 keeps signature verification on for security (recommended).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"enable-the-fastest-mirror-plugin\"><strong>Enable the Fastest Mirror Plugin<\/strong><\/h3>\n\n\n\n<p>Fastestmirror selects the nearest\/fastest mirror automatically, reducing download time significantly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install plugins if missing\nsudo yum install -y yum-plugin-fastestmirror yum-utils\n\n# Ensure the plugin is enabled\nsudo sed -i 's\/^enabled=.*\/enabled=1\/' \/etc\/yum\/pluginconf.d\/fastestmirror.conf\n\n# Optional: clear and rebuild cache\nsudo yum clean all\nsudo yum makecache fast\n<\/code><\/pre>\n\n\n\n<p>On many CentOS\/RHEL 7 builds, fastestmirror is installed by default but may not be enabled. Keeping it on is one of the biggest speed wins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-2-optimize-repositories-the-biggest-real-world-bottleneck\"><strong>Step 2: Optimize Repositories (The Biggest Real\u2011World Bottleneck)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"disable-slow-or-unused-repos-by-default\"><strong>Disable Slow or Unused Repos by Default<\/strong><\/h3>\n\n\n\n<p>Every enabled repo adds metadata fetches and dependency checks. Disable what you don\u2019t need and enable only when required.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># List repos and status\nyum repolist all\n\n# Disable a repo\nsudo yum-config-manager --disable some-thirdparty\n\n# Enable only when needed\nsudo yum --enablerepo=some-thirdparty install package-name\n<\/code><\/pre>\n\n\n\n<p>For flaky sources, add skip_if_unavailable=1 in their .repo files to prevent YUM from stalling when that repo is down.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/yum.repos.d\/some-thirdparty.repo\n\n&#91;some-thirdparty]\nname=Third-party Repo\nbaseurl=http:\/\/mirror.example\/repo\/\nenabled=0\ngpgcheck=1\nskip_if_unavailable=1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"use-reliable-mirrors-and-prefer-baseurl-over-mirrorlist-when-needed\"><strong>Use Reliable Mirrors and Prefer Baseurl Over Mirrorlist (When Needed)<\/strong><\/h3>\n\n\n\n<p>If mirrorlist is inconsistent in your region, choose a stable, known-fast baseurl. This cuts redirection overhead and flakiness.<\/p>\n\n\n\n<p>For enterprise fleets, standardize the same mirror <a href=\"https:\/\/www.youstable.com\/blog\/how-to-clear-cache-in-browser\/\">across servers to maximize cache<\/a> hits and predictability.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"repository-priorities-to-reduce-dependency-conflicts\"><strong>Repository Priorities to Reduce Dependency Conflicts<\/strong><\/h3>\n\n\n\n<p>Setting priorities ensures core OS repos outrank third-party ones, reducing conflict resolution time and surprises.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install priorities plugin\nsudo yum install -y yum-plugin-priorities\n\n# In each .repo file, add a lower number = higher priority\nsudo vi \/etc\/yum.repos.d\/CentOS-Base.repo\npriority=1\n\nsudo vi \/etc\/yum.repos.d\/epel.repo\npriority=10\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-3-speed-up-downloads-and-reduce-bandwidth\"><strong>Step 3: Speed Up Downloads and Reduce Bandwidth<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"enable-delta-rpms-when-cpu-is-not-a-bottleneck\"><strong>Enable Delta RPMs (When CPU Is Not a Bottleneck)<\/strong><\/h3>\n\n\n\n<p>Delta RPMs download only differences between versions, saving bandwidth at the cost of some CPU to reconstruct packages. Great on constrained links; optional in CPU-limited VMs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install -y deltarpm yum-plugin-deltarpm\n\n# In \/etc\/yum.conf\ndeltarpm=1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"cache-aggressively-on-build-ci-hosts\"><strong>Cache Aggressively on Build\/CI Hosts<\/strong><\/h3>\n\n\n\n<p>For build servers and golden-image pipelines, keepcache=1 prevents re-downloading packages repeatedly. Combine with a local repository or caching proxy for maximum savings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"throttle-and-minrate\"><strong>Throttle and Minrate<\/strong><\/h3>\n\n\n\n<p>Use minrate to fail fast on underperforming mirrors, and throttle only when you need to preserve bandwidth for other workloads.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># In \/etc\/yum.conf\nminrate=200k\n# throttle=0 (no limit) or set a value like 1M to cap bandwidth\n# throttle=1M\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-4-automate-updates-off-peak\"><strong>Step 4: Automate Updates Off\u2011Peak<\/strong><\/h2>\n\n\n\n<p>Automating routine refreshes and updates reduces latency during work hours and keeps metadata warm.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install and enable automatic update tools\nsudo yum install -y yum-cron\nsudo systemctl enable --now yum-cron\n\n# Configure security-only or full updates\nsudo vi \/etc\/yum\/yum-cron.conf\napply_updates = yes\ndownload_updates = yes\n# Consider security update filters based on your policy\n<\/code><\/pre>\n\n\n\n<p>Schedule heavy updates during low-traffic windows. In managed environments, providers like YouStable can configure maintenance windows and test updates on staging first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-5-maintenance-and-troubleshooting-for-long-lived-hosts\"><strong>Step 5: Maintenance and Troubleshooting for Long\u2011Lived Hosts<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"clean-and-rebuild-yum-data\"><strong>Clean and Rebuild YUM Data<\/strong><\/h3>\n\n\n\n<p>Over time, caches and RPM databases can bloat or become inconsistent, slowing down dependency resolution.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Clean everything and rebuild cache\nsudo yum clean all\nsudo rm -rf \/var\/cache\/yum\nsudo yum makecache fast\n\n# Rebuild RPM database if dependency resolution is slow or errors occur\nsudo rpm --rebuilddb\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"fix-incomplete-transactions-and-locks\"><strong>Fix Incomplete Transactions and Locks<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># If a previous run was interrupted:\nsudo yum-complete-transaction\n\n# If a lock remains, identify the process\nsudo lsof \/var\/run\/yum.pid\n# Or simply wait\/kill responsibly, then retry\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-6-centralize-with-a-local-mirror-or-caching-proxy\"><strong>Step 6: Centralize with a Local Mirror or Caching Proxy<\/strong><\/h2>\n\n\n\n<p>For dozens or hundreds of servers, nothing beats a local mirror or caching proxy. It eliminates WAN latency and maximizes cache hits.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lightweight caching: Squid or Nginx reverse proxy in front of upstream mirrors.<\/li>\n\n\n\n<li>Full mirrors: reposync + createrepo to host your own mirror of Base\/EPEL.<\/li>\n\n\n\n<li>Enterprise repo managers: Pulp, Sonatype Nexus, or Artifactory for version pinning and access control.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Example: local mirror with reposync (run on mirror host)\nsudo yum install -y yum-utils createrepo\nsudo reposync -p \/var\/www\/html\/repos\/ -r base -r updates -r extras\nsudo createrepo \/var\/www\/html\/repos\/base\n# Then point clients' baseurl to http:\/\/your-mirror\/repos\/base\/\n<\/code><\/pre>\n\n\n\n<p>YouStable\u2019s managed server team can set up a private mirror and enforce consistent repo policies across your fleet to stabilize and speed up patching.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"security-best-practices-while-optimizing\"><strong>Security Best Practices While Optimizing<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep gpgcheck=1 for all repos and verify GPG keys are correct and current.<\/li>\n\n\n\n<li>Restrict or audit third\u2011party repos; use priorities and enable on demand.<\/li>\n\n\n\n<li>Use HTTPS mirrors where available; pin trusted baseurls.<\/li>\n\n\n\n<li>Log updates: monitor \/var\/log\/yum.log for anomalies and performance trends.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"dnf-equivalents-for-rhel-8-9-almalinux-rocky\"><strong>DNF Equivalents for RHEL 8\/9, AlmaLinux, Rocky<\/strong><\/h2>\n\n\n\n<p>Modern distributions replaced YUM with DNF. Most optimizations still apply with slightly different options.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fastest mirror: fastestmirror=true in \/etc\/dnf\/dnf.conf<\/li>\n\n\n\n<li>Parallel downloads: max_parallel_downloads=10 (DNF only)<\/li>\n\n\n\n<li>Metadata sync: metadata_timer_sync=3600<\/li>\n\n\n\n<li>Delta RPMs: deltarpm=true (default on many builds)<\/li>\n\n\n\n<li>Keep cache: keepcache=True<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cp \/etc\/dnf\/dnf.conf \/etc\/dnf\/dnf.conf.bak\nsudo vi \/etc\/dnf\/dnf.conf\n\n&#91;main]\nfastestmirror=True\nmax_parallel_downloads=10\nmetadata_timer_sync=3600\nkeepcache=True\ndeltarpm=True\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"real-world-scenarios-and-tips\"><strong>Real\u2011World Scenarios and Tips<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.youstable.com\/blog\/what-is-ci-cd-on-linux-server\/\">CI\/CD pipelines:<\/a> keepcache=1 and a local mirror cut build times drastically.<\/li>\n\n\n\n<li>Remote branches\/offices: use a site-local caching proxy to avoid WAN dependency.<\/li>\n\n\n\n<li>Air\u2011gapped servers: mirror repos internally with reposync and sign your metadata.<\/li>\n\n\n\n<li>Minimal containers: tsflags=nodocs to speed up image layers and save space.<\/li>\n\n\n\n<li>Flaky IPv6 networks: set ip_resolve=4 until network reliability improves.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"optimization-checklist-copy-paste\"><strong>Optimization Checklist (Copy\/Paste)<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>plugins=1, fastestmirror enabled, gpgcheck=1<\/li>\n\n\n\n<li>keepcache=1, metadata_expire=6h<\/li>\n\n\n\n<li>timeout=30, retries=3, minrate=200k<\/li>\n\n\n\n<li>Disable unused repos; set priorities; skip_if_unavailable=1<\/li>\n\n\n\n<li>Enable deltarpm when bandwidth is precious<\/li>\n\n\n\n<li>Automate with yum-cron during off\u2011peak hours<\/li>\n\n\n\n<li>Regularly yum clean all; rpm &#8211;rebuilddb if needed<\/li>\n\n\n\n<li>Consider a local mirror or caching proxy for fleets<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"common-commands-reference\"><strong>Common Commands Reference<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Show enabled repos\nyum repolist\n\n# Clean and rebuild cache\nyum clean all &amp;&amp; yum makecache fast\n\n# List fastest mirror plugin details\nyum info yum-plugin-fastestmirror\n\n# Disable\/enable repos on demand\nyum --disablerepo=\"*\" --enablerepo=\"base,updates\" list available\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"faqs-how-to-optimize-yum-on-linux-server\"><strong>FAQs: How to Optimize YUM on Linux Server<\/strong><\/h2>\n\n\n\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h3 id=\"what-is-the-fastest-way-to-speed-up-yum-immediately\">What is the fastest way to speed up YUM immediately?<\/h3>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Enable the fastestmirror plugin, clean the cache, and disable slow or unused repositories. In many environments, those three steps deliver the biggest improvement with minimal risk.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h3 id=\"should-i-enable-delta-rpms-on-all-servers\">Should I enable delta RPMs on all servers?<\/h3>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Enable delta RPMs when bandwidth is limited or expensive. If CPU is scarce or updates are infrequent, the overhead may not be worth it. Test both ways on a representative host and measure runtime and bandwidth.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h3 id=\"is-it-safe-to-increase-metadata_expire-to-reduce-refreshes\"> Is it safe to increase metadata_expire to reduce refreshes?<\/h3>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Yes, within reason. Values like 6\u201324 hours are a good balance for most servers. For fast-moving repos or security-sensitive workloads, keep it lower and automate off-peak refreshes with yum-cron.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h3 id=\"how-do-i-handle-a-slow-or-failing-repository-without-breaking-updates\">How do I handle a slow or failing repository without breaking updates?<\/h3>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Set skip_if_unavailable=1 in the repo file, lower its priority, and keep it disabled by default. Enable it only when you need that specific package. This prevents YUM from hanging when the repo misbehaves.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h3 id=\"is-yum-still-supported-or-should-i-migrate-to-dnf\"> Is YUM still supported, or should I migrate to DNF?<\/h3>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>YUM is maintained for CentOS\/RHEL 7, but newer releases use DNF. If you\u2019re planning an OS upgrade, map your YUM settings to DNF equivalents (fastestmirror, keepcache, max_parallel_downloads) to gain further speed and stability improvements.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\n<script type=\"application\/ld+json\">\n\t{\n\t\t\"@context\": \"https:\/\/schema.org\",\n\t\t\"@type\": \"FAQPage\",\n\t\t\"mainEntity\": [\n\t\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"What is the fastest way to speed up YUM immediately?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Enable the fastestmirror plugin, clean the cache, and disable slow or unused repositories. In many environments, those three steps deliver the biggest improvement with minimal risk.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Should I enable delta RPMs on all servers?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Enable delta RPMs when bandwidth is limited or expensive. If CPU is scarce or updates are infrequent, the overhead may not be worth it. Test both ways on a representative host and measure runtime and bandwidth.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \" Is it safe to increase metadata_expire to reduce refreshes?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Yes, within reason. Values like 6\u201324 hours are a good balance for most servers. For fast-moving repos or security-sensitive workloads, keep it lower and automate off-peak refreshes with yum-cron.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"How do I handle a slow or failing repository without breaking updates?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Set skip_if_unavailable=1 in the repo file, lower its priority, and keep it disabled by default. Enable it only when you need that specific package. This prevents YUM from hanging when the repo misbehaves.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \" Is YUM still supported, or should I migrate to DNF?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>YUM is maintained for CentOS\/RHEL 7, but newer releases use DNF. If you\u2019re planning an OS upgrade, map your YUM settings to DNF equivalents (fastestmirror, keepcache, max_parallel_downloads) to gain further speed and stability improvements.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t]\n\t}\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"final-word\">Final word: <\/h2>\n\n\n\n<p>consistent, well-documented YUM settings save hours across a fleet. If you prefer a managed approach, YouStable can provision servers with optimized YUM\/DNF defaults, private mirrors, and staged rollouts to keep your production environment fast, secure, and predictable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To optimize YUM on a Linux server, enable the fastest mirror selection, tune caching and metadata settings, clean and rebuild [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":14080,"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":8,"footnotes":""},"categories":[350],"tags":[2141,2165],"class_list":["post-13754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","tag-linux-server","tag-optimize-yum-on-linux"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/How-to-Optimize-YUM-on-Linux-Server.jpg","author_info":{"display_name":"Prahlad Prajapati","author_link":"https:\/\/www.youstable.com\/blog\/author\/prahladblog"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/13754","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=13754"}],"version-history":[{"count":2,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/13754\/revisions"}],"predecessor-version":[{"id":14097,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/13754\/revisions\/14097"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/14080"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=13754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=13754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=13754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}