컬쥐네 다락방

리눅스 | yum 에러 해결 Another app is currently holding the yum lock 본문

클라우드/리눅스

리눅스 | yum 에러 해결 Another app is currently holding the yum lock

코딩하는 갱얼쥐 2022. 3. 15. 09:46

yum을 사용하다보면 Another app is currently holding the yum lock 라는 에러가 뜰 때가 있다.

yum이 실행중인 상태로 멈춰있어서 새로운 yum 명령어를 쓸 수 없을 때 발생한다.

 

이런 경우 PID 넘버를 확인해서 프로세스는 죽이던지, yum.pid의 존재 유무를 확인 후 삭제해주면 된다.

[root@server ~]# yum info Mariadb-server
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 2907.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 121 M RSS (465 MB VSZ)
    Started: Tue Mar 15 18:34:39 2022 - 00:41 ago
    State  : Sleeping, pid: 2907
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 121 M RSS (465 MB VSZ)
    Started: Tue Mar 15 18:34:39 2022 - 00:43 ago
    State  : Sleeping, pid: 2907

리눅스가 알려주는대로 pid 2907을 죽이던지, ps -ef | grep yum 명령어를 통해 PID 번호를 알아낼 수 있다.

그 후 kill -9 명령어를 사용해서 죽이고 재실행하기.

[root@server ~]# ps -ef | grep yum
root       2907   1987  4 18:34 ?        00:00:17 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none
root       4438   2830  0 18:40 pts/0    00:00:00 grep --color=auto yum
[root@server ~]# kill -9 2907
[root@server ~]# yum info MariaDB-server
BDB2053 Freeing read locks for locker 0x4d8: 2907/139660619855680
BDB2053 Freeing read locks for locker 0x4e2: 2907/139660619855680
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.navercorp.com
 * extras: mirror.navercorp.com
 * updates: mirror.navercorp.com
Available Packages
Name        : MariaDB-server
Arch        : x86_64
Version     : 10.2.43
Release     : 1.el7.centos
Size        : 24 M
Repo        : mariadb
Summary     : MariaDB database server binaries
URL         : http://mariadb.org
License     : GPLv2
Description : MariaDB: a very fast and robust SQL database server
            : 
            : It is GPL v2 licensed, which means you can use the it free of charge
            : under the conditions of the GNU General Public License Version 2
            : (http://www.gnu.org/licenses/).
            : 
            : MariaDB documentation can be found at https://mariadb.com/kb
            : MariaDB bug reports should be submitted through https://jira.mariadb.org

Name        : mariadb-server
Arch        : x86_64
Epoch       : 1
Version     : 5.5.68
Release     : 1.el7
Size        : 11 M
Repo        : base/7/x86_64
Summary     : The MariaDB server and related files
URL         : http://mariadb.org
License     : GPLv2 with exceptions and LGPLv2 and BSD
Description : MariaDB is a multi-user, multi-threaded SQL database server. It is a
            : client/server implementation consisting of a server daemon (mysqld)
            : and many different client programs and libraries. This package contains
            : the MariaDB server and some accompanying files and directories.
            : MariaDB is a community developed branch of MySQL.

yum.pid 의 존재 유무를 확인하려면 ls /var/run/ grep | yum 을 통해 가능하다.

Comments