How do i protect a package from being removed by yum?



  • Man page for yum.conf.

    $ cd /etc/yum/protected.d
    

    Create a config file for the package. Put the names of the package(s) in the file.

    $ vi cowsay.conf
    

    In this case just:

    cowsay
    

    The output from yum when you try to remove the package.

    $ sudo yum erase cowsay
    Loaded plugins: fastestmirror, langpacks
    Resolving Dependencies
    --> Running transaction check
    ---> Package cowsay.noarch 0:3.04-4.el7 will be erased
    --> Finished Dependency Resolution
    Error: Trying to remove "cowsay", which is protected
    

    Good for hardening operating systems using yum or prevent accidentally removal of packages.


Log in to reply
 

© Lightnetics 2024