Fix Existing lock /var/run/yum.pid: another copy is running
กระทู้เก่าที่เก็บไว้อ่าน · หน้านี้ไม่รับข้อความใหม่
หากรันคำสั่ง
yum update
แล้วเกิด error คล้ายตัวอย่าง
Loaded plugins: fastestmirror, priorities Existing lock /var/run/yum.pid: another copy is running as pid 15740. Another app is currently holding the yum lock; waiting for it to exit… The other application is: yum-updatesd-he Memory : 10 M RSS ( 16 MB VSZ) Started: Tue Jul 10 08:19:02 2012 - 614 day(s) 21:47:09 ago State : Sleeping, pid: 15740 Another app is currently holding the yum lock; waiting for it to exit… The other application is: yum-updatesd-he Memory : 10 M RSS ( 16 MB VSZ) Started: Tue Jul 10 08:19:02 2012 - 614 day(s) 21:47:19 ago State : Sleeping, pid: 15740
สาเหตุนี้ส่วนใหญ่มีการรันคำสั่ง yum อยู่ก่อนแล้ว วิธีแก้ให้ลองตรวจสอบว่ามีคำสั่ง yum รันอยู่หรือไม่ด้วยคำสั่ง ps ax | grep -i yum ผลลัพธ์
root 12875 0.0 0.5 26456 10620 ? SN Jun23 0:00 /usr/bin/python -tt /usr/sbin/yum-updatesd root 15740 0.0 0.6 24224 12800 ? Ss 20:58 0:14 /usr/bin/python /usr/bin/yum update -y root 25799 0.0 0.0 4128 608 pts/0 S+ 21:48 0:00 grep yum
แสดงว่ามีคำสั่ง yum รันอยู่ซึ่งมีหมายเลข PID 12875, 15740 รันคำสั่ง kill เพื่อฆ่า process นั้นออกจากระบบ ตามตัวอย่าง kill -9 12875 kill -9 15740 หรือสามารถรันคำสั่ง killall ก็ได้ killall -9 yum