How to disable PackageKit on CentOS, Fedora or RHEL

Question: When I tried to install a package with yum command on [CentOS, Fedora or RHEL], I got the error saying that "Another app is currently holding the yum lock; waiting for it to exit... The other application is: PackageKit". PackageKit seems starting automatically in the background, interfering with yum command. How can I disable PackageKit to avoid this yum error? Just like below:



PackageKit is a suite of programs designed for checking, updating, and (un)installing packages on a Linux system. When PackageKit is running in the background, it blocks any other software management initiated by users (e.g., with yum command).

When you fail to run yum command due to PackageKit holding the yum lock, you can simply wait for PackageKit to finish, and then run yum command again.

However, if PackageKit is really annoying to you, you can disable PackageKit. Here is how to turn off PackageKit on RedHat-based system.

   1) Disable PackageKit Temporarily

            One way to get around PackageKit during yum operation is to use "--disableplugin" option with yum command. This will temporarily disable PackageKit, and thus you can proceed without being interferred with by PackageKit.

           $ sudo yum install --disableplugin=refresh-packagekit <package-name>

   2) Disable PackageKit Permanently         

            If you want to turn off PackageKit permanently, you can do the following:

                   On CentOS/RHEL 7, Fedora 20 or higher:

                             $ sudo systemctl disable packagekitd

                   This will disable PackageKit permanently on the next boot.

                   On CentOS/RHEL 6, Fedora 19 or earlier:

                            Open /etc/yum/pluginconf.d/refresh-packagekit.conf with a text editor, and change "enabled=1" to "enabled=0".

                            $ sudo vi /etc/yum/pluginconf.d/refresh-packagekit.conf
            enabled=0

   3) Remove PackageKit Altogether       

           A final approach is to simply remove PackageKit altogether.

                           $ sudo yum remove PackageKit

(This post was originally created by Dan Nanni)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值