# How to Pin Versions in Yum or Dnf for RHEL or CentOS Linux

DevFeed: [How to Pin Versions in Yum or Dnf for RHEL or CentOS Linux](<https://devfeed.tech/articles/how-to-pin-versions-in-yum-or-dnf-for-rhel-or-centos-linux-41968.md>)

Original publisher: [Read original article](<https://www.cyberciti.biz/tips/yum-dnf-pin-package-versions-on-rhel-centos-rocky-oracle-almalinux.html>)

Author: Vivek Gite

Published: 2024-05-07T09:01:47Z

Content type: tutorial

Language: en

Sources: [nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED)](<https://devfeed.tech/sources/nixcraft-linux-tips-hacks-tutorials-and-ideas-in-blog-format-rss-feed.md>)

Topics: [dnf](<https://devfeed.tech/topics/dnf.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [centos](<https://devfeed.tech/topics/centos.md>), [rhel](<https://devfeed.tech/topics/rhel.md>), [Fedora](<https://devfeed.tech/topics/fedora.md>)

Tags: [centos](<https://devfeed.tech/tags/centos.md>), [dnf](<https://devfeed.tech/tags/dnf.md>), [fedora](<https://devfeed.tech/tags/fedora.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [howto](<https://devfeed.tech/tags/howto.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-distribution](<https://devfeed.tech/tags/linux-distribution.md>), [pin](<https://devfeed.tech/tags/pin.md>), [redhat-fedora-linux](<https://devfeed.tech/tags/redhat-fedora-linux.md>), [rhel](<https://devfeed.tech/tags/rhel.md>), [sys-admin](<https://devfeed.tech/tags/sys-admin.md>), [tips](<https://devfeed.tech/tags/tips.md>)

## AI overview

A tutorial explains how to pin packages to specific versions on RHEL, CentOS, Fedora, and related distributions using yum or dnf. It covers installing the versionlock plugin, locking packages such as PHP and nginx, listing or removing locks, and checking blocked updates.

## Source excerpt

CentOS, RHEL (Red Hat Enterprise Linux), Fedora and other clones of RHEL, such as Oracle, Alma, and Rocky, offer support for version pinning. This feature allows developers and system administrators to lock a particular package to a specific version, preventing it from being automatically updated by yum or dnf commands. Sometimes, it is necessary to protect packages from being updated to newer versions to avoid incompatibility issues with your applications. For example, you can lock down PHP version 8.3.6 and avoid using updated PHP version 8.4. Let us see how to lock a package to a specific version, only exclude a package from yum update or dnf update on a CentOS, RHEL, Fedora, and friends. Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit The post How to Pin Versions in Yum or Dnf for RHEL or CentOS Linux appeared first on nixCraft.