Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Yum»How to Exclude Specific Packages from Yum Update

    How to Exclude Specific Packages from Yum Update

    By RahulJuly 26, 20182 Mins Read

    During the full update or automatic packages upgrade process, sometimes packages are upgraded which is not required. Sometimes this causes serious issues on the server. For example, You need to exclude kernel, PHP, MySQL and Apache packages from getting updated while updating the system via yum. This tutorial will help you find the answer of how to exclude packages from the yum update? How to use exclude option with yum? How to prevent packages from auto update via yum? How to exclude only 32-bit or 64-bit packages?

    Advertisement
    • How To Exclude Packages from Apt-Get Upgrade

    1. Exclude Packages with Command

    You can simply use –exclude command line parameter with yum to exclude specific packages from getting update. You can specify multiple packages as per your requirement. For example, below command will update all packages except kernel and php.

    # yum update --exclude=kernel* --exclude=php*
    

    2. Exclude Packages from Auto Update

    In addition, You can also add entries in /etc/yum.conf to disable packages updates permanently. Using this option, you don’t need to specify each time you run yum update command from prompt. This will also prevent packages from any accidental update.

    Edit /etc/yum.conf in editor and add exclude line as showing in below example configuration file. The below will prevent updating packages name begin with the kernel, redhat-release, php, mysql, and httpd.

    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    installonly_limit=5
    exclude=kernel* redhat-release* php* mysql* httpd* 
    

    3. Exclude 32-bit or 64-bit Packages

    Also, you can ignore the specific package architecture. Like you need to exclude 32-bit or 64-bit packages from auto update. Specify them in /etc/yum.conf as below.

    exclude=*.i?86 *.i686
    

    Conclusion

    This tutorial helps you to exclude specific packages from the yum update. You can easily exclude any packages or group of packages from yum update and prevents accidental rpm updates.

    rpm update yum
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Excluding Packages from Apt-Get Upgrade

    Adding Extra Repository EPEL and REMI on a RHEL-based System

    How to Add RPMForge Yum Repository in CentOS/RHEL 7/6/5

    View 2 Comments

    2 Comments

    1. Mojtaba on May 13, 2020 8:38 am

      Very Useful for me.. Thank you so much.

      Reply
    2. a on September 18, 2019 2:31 am

      Thank you.

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • tail Command in Linux with Examples
    • What is a Orphan Process in Unix/Linux
    • How To Display Warning Message to Unauthorized SSH Access
    • How to Set a Custom SSH Login Banner and MOTD
    • Understanding Reverse DNS: What it is and Why it Matters?
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.