LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-29-2007, 08:20 AM   #1
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Rep: Reputation: 30
Another app is currently holding the yum lock


When I try to follow the instructions on this page

http://www.fedorafaq.org/#yumconf

I get this message in the terminal window:

Another app is currently holding the yum lock; waiting for it to exit...

As far as I can see, I don't have anything running except the Firefox browser, Kate editor and the terminal. And I stopped the service

yum-updatesd is stopped

So now what? How can I run yum?

And how do I escape out of the terminal window, which just keeps scrolling the same message over and over?

Fer pete sake.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-29-2007, 10:55 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
And how do I escape out of the terminal window, which just keeps scrolling the same message over and over?
Hit Ctrl-C; that's the key combination to kill any currently running process in a bash shell or terminal.

To find out what's locking up yum, try running:

# ps aux | grep yum

Note the PID number of the process and run this to kill the process:

# kill <insert PID number>

Check to see if the process has been killed by rerunning:

# ps aux | grep yum

If not, rinse and repeat until the process is killed; some processes can be very stubborn.
 
2 members found this post helpful.
Old 11-29-2007, 10:58 AM   #3
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
If you have a terminal window open on the desktop and can't kill it by clicking the X button in the top-right, you can use xkill. If you are using KDE, hit ALT+F2, which will call up a run command window. (I'm not sure what it would be in GNOME.) Type in "xkill" and hit enter. The cursor will turn into a skull-and-crossbones. Click on the application you want to kill, and it will kill it.

If you are sure you don't have yum currently running, then something prob'ly happened last time it was run, and it didn't remove the lock. Somewhere in /var, there will be a yum.lock file. I forget exactly where it is and am not on a computer with yum. Search for it, and you should find it. Delete the lock file, and you should be able to run yum again.
 
Old 11-29-2007, 11:06 AM   #4
Glennzo
Member
 
Registered: May 2003
Location: Salem, Mass USA
Distribution: Fedora
Posts: 394

Rep: Reputation: 52
su -c 'chkconfig --level 2345 yum-updatesd off' will work. Every other workaround seems to only kill yum-updatesd for runlevel 5. Try yum update after that. Keep in mind that you will no longer be informed that there updates available and as such you will need to check periodically with yum check-update.
 
Old 11-29-2007, 01:08 PM   #5
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
The easiest way to find out which process has a lock is to cat /var/run/yum.pid.

While using the kill command to kill that process will stop it, the command probably won't get rid of the yum.pid file. You may have a lock file sitting out there and no process belonging to it. If you enter ps < /var/run/yum.pid and only get the PID TTY TIME CMD headers you can delete the file and the lock will be removed. If you get process information than something is still running and you can track it down. Be careful when killing a yum process, it may be busy doing an rpm update and you can then cause trouble with your rpm database.

If it is yum-updatesd, use the command service yum-updatesd stop. This will be a much nicer way of stopping the process than the kill command. You can use the command service yum-updatesd status to see if it is running. Though typically yum-updatesd will finish checking for updates in a few minutes and free up the lock. Glennzo's way will only stop the yum-updatesd service from starting up on reboots, not stop the current service from running.

As mentioned earlier Cntl+C will stop the current process on a terminal screen.

Bill

Last edited by wmakowski; 11-29-2007 at 01:14 PM.
 
1 members found this post helpful.
Old 11-29-2007, 02:18 PM   #6
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by kilgoretrout View Post
To find out what's locking up yum, try running:

# ps aux | grep yum

Note the PID number of the process and run this to kill the process:

# kill <insert PID number>
This is what I get when I run that command:

Quote:
# ps aux | grep yum
root 2016 0.0 1.7 21668 4380 ? SN 12:21 0:00 /usr/bin/python -tt /usr/sbin/yum-updatesd
root 2539 0.0 0.2 4048 688 pts/4 S+ 15:11 0:00 grep yum
I have no idea which number is the PID.

Sorry, but you're talking to an extremely rusty linux user here.
 
Old 11-29-2007, 02:30 PM   #7
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by wmakowski View Post
The easiest way to find out which process has a lock is to cat /var/run/yum.pid
When I do that command, no such file is found.

But when I do # service yum-updatesd status as suggested in another post on this thread, it reports that yum-updatesd (pid 2016) is running...

yum did an automatic update earlier today. Does the thing run all the time? And when it is running, does that mean it's 'locked'?

I ran it the other day and did an installation of firefox and didn't have any problem. Now, the last couple of times I've tried to run it or the 'Add/Remove Software' GUI, I've been having problems. 'Add/Remove Software' tries to download the list and then freezes near the end and the list never shows in the window.
 
Old 11-29-2007, 02:34 PM   #8
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Glennzo View Post
Keep in mind that you will no longer be informed that there updates available and as such you will need to check periodically with yum check-update.
I'd rather not kill my automatic update feature if I can get away with it. I've only had Fedora 8 installed for a week or two and I'd like to keep it functioning as intended for as long as possible.
 
Old 11-29-2007, 02:40 PM   #9
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by ranger_nemo View Post
If you are sure you don't have yum currently running, then something prob'ly happened last time it was run, and it didn't remove the lock. Somewhere in /var, there will be a yum.lock file.
According to # service yum-updatesd status, yum-updatesd is running right now but a search didn't find any yum.lock file in /var
 
Old 11-29-2007, 03:07 PM   #10
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
Quote:
Originally Posted by 9nine9 View Post
When I do that command, no such file is found.

But when I do # service yum-updatesd status as suggested in another post on this thread, it reports that yum-updatesd (pid 2016) is running...

yum did an automatic update earlier today. Does the thing run all the time? And when it is running, does that mean it's 'locked'?
yum-updatesd is a daemon that runs periodically based on the entries in yum-updatesd.conf. See man yum-updatesd.conf for more details. When you did the cat command, nothing had a lock on yum. I installed F8 the other day and yum was locked for quite some time since all the packages were being checked the first time for updates.

Quote:
Originally Posted by 9nine9 View Post
I ran it the other day and did an installation of firefox and didn't have any problem. Now, the last couple of times I've tried to run it or the 'Add/Remove Software' GUI, I've been having problems. 'Add/Remove Software' tries to download the list and then freezes near the end and the list never shows in the window.
I've noticed that things have been taking a lot longer with F8. You may have to just be patient and wait for it to do its thing. On my system pup (package updater) timed out the first time it was used. I followed up with yum update and could see why it had a conniption. The selinux package updates were particularly brutal. pup is now functioning okay with the reduced workload. Perhaps this is one of the reasons they are working on PackageKit for F9. I just launched pirut (Add/Remove Software tool) for first time and can see what you mean. It's acting like the Energizer Bunny right now. I can see the process with the top command still trying to do something and plan on letting it go for a while. I'll post if something traumatic happens.

Quote:
Originally Posted by 9nine9 View Post
I'd rather not kill my automatic update feature if I can get away with it. I've only had Fedora 8 installed for a week or two and I'd like to keep it functioning as intended for as long as possible.
I agree, they have come out with a great number of updates for F8 already. It would seem impratical to disable yum-updatesd.

Bill
 
Old 11-29-2007, 03:29 PM   #11
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by wmakowski View Post
I just launched pirut (Add/Remove Software tool) for first time and can see what you mean. It's acting like the Energizer Bunny right now.
Well now here's a strange one. I tried to run pirut just a few minutes ago and it ran just fine even though yum-updatesd is still running.

So I don't understand this at all. Apparently pirut can run along side yum-updatesd as long as it's in the mood to do so.

So now I'm wondering if I can do a yum install command while yum-updatesd is running.

Anyway, thanks for your help. Sure beats trying to get Billy on the phone.

Now if I sleep on all this information for a couple of nights, maybe I'll get this yum thing figured out.

Thanks again, guys.
 
Old 11-29-2007, 03:43 PM   #12
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
yum and pirut can run when yum-updatesd is running as long as it isn't actively doing something. As a daemon it just sits out there and waits until the appropriate time comes around to run active again. When it is actively doing something it will start a yum lock until it finishes. You'll also get a lock when pirut starts and not be able to use yum at the command line.

My first run of pirut completed. It probably took 20 minutes to get to the actual gui where you can pick packages. I wonder if it has to build something the first time it runs? After it came up, I closed it and brought it up again. It came up much faster the second time, maybe 10-15 seconds.

Bill
 
Old 11-30-2007, 12:36 PM   #13
9nine9
Member
 
Registered: Nov 2001
Distribution: Debian, Fedora, Kubuntu, Puppy
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by wmakowski View Post
yum and pirut can run when yum-updatesd is running as long as it isn't actively doing something. As a daemon it just sits out there and waits until the appropriate time comes around to run active again.
Is that an option that can be changed in some file? Can it be scheduled to do it's thing at a particular time?

Quote:
When it is actively doing something it will start a yum lock until it finishes. You'll also get a lock when pirut starts and not be able to use yum at the command line.
Yeah, I realized that yesterday when I had it open.

Quote:
My first run of pirut completed. It probably took 20 minutes to get to the actual gui where you can pick packages. I wonder if it has to build something the first time it runs?
Maybe so, but it didn't take that long the first time I ran it.

Quote:
After it came up, I closed it and brought it up again. It came up much faster the second time, maybe 10-15 seconds.
Yeah, mine came up pretty fast yesterday too when I ran it later in the day, just to see if I could get it to come up. So I guess the 'yum lock' problem basically resolved itself.
 
Old 11-30-2007, 02:03 PM   #14
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
Quote:
Originally Posted by 9nine9 View Post
Is that an option that can be changed in some file? Can it be scheduled to do it's thing at a particular time?
Only schedule related piece I know about is the run interval in yum-updatesd.conf, see man yum-updatesd.conf. I do recall, prior to yum-updatesd coming on the scene, people used cron to schedule a job using yum check-update to notify them when updates were available.

Bill
 
Old 01-12-2008, 02:06 PM   #15
axmukher
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 6
Question Another application is holding yum lock ........

Try this:

Open a terminal.
Become superuser by entering 'su' and then the password.
Then,
# cd /var/run/
# dir
Look for the 'yum.pid' file.
# rm -f yum.pid
# dir
Confirm that the 'yum.pid' file has been deleted.
# yum update
This should re-start your update process.
 
6 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) phreakshew Linux - Newbie 24 04-12-2019 10:42 AM
all software installs hang scroll lock and caps lock lights flash jcorrnt Linux - Hardware 6 02-07-2009 12:44 PM
gnome\kde screen lock app asulwer Programming 2 04-06-2007 09:22 AM
Caps Lock and Num Lock leds dont work! npc Linux - Hardware 2 11-08-2005 10:40 AM
"yum" bad lock error ServalSoft Linux - Software 7 02-09-2004 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration