Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm on Debian 6.0.5 (squeeze) and every now and then I see the following icon in the notifications area of the GNOME2 pannel: enter image description here but black instead of red. It reads A package manager is working. Usually it just displays the red one after a few seconds, which is Available updates, so I assume it was just looking for updates. But sometimes that's not the case. I don't have the option to auto-install updates so that's probably not it, so I was wondering if there's a way to see which package manager is running.

Clicking on it just opens Synaptic Package Manager, but it does not says what's running.

share|improve this question
add comment

3 Answers

up vote 9 down vote accepted
+100

"A package manager is working" means that something is holding a lock on /var/lib/dpkg/lock and/or/var /cache/apt/archives/lock. You can find out which process this is with the fuser command:

dennis@lightning:~$ sudo fuser /var/lib/dpkg/lock /var/cache/apt/archives/lock
/var/lib/dpkg/lock:  18049
/var/cache/apt/archives/lock: 18049
dennis@lightning:~$ cat /proc/18049/cmdline | sed -e 's/\x0/ /g'; echo
apt-get install kdenlive 

And because no answer is complete without a command pipeline:

cat /proc/$(sudo fuser /var/{lib/dpkg,cache/apt/archives}/lock  2>/dev/null| head -n1 | awk '{print $2}')/cmdline | sed -e 's/\x0/ /g'; echo
share|improve this answer
3  
That seems to be the more specific/advanced answer, except for the useless use of cat :) –  frostschutz Apr 6 '13 at 11:49
3  
Fortunately I don't believe in useless uses of cat. Cat gets lonely and wants to be loved too! –  Dennis Kaarsemaker Apr 6 '13 at 20:19
add comment

You could open a terminal and fetch a process list with ps -Af or pstree -alp, where pstree also shows the mother-child relationships between processes. That's the general answer to "what X is running right now", at least if it's running longer than a fraction of a second.

My guess is that it's updating the package lists, which it has to do in order to be able to tell whether there are any updates at all, and show you the number of updates available. That doesn't mean it's installing them automatically, just showing you that you should check whether to do it manually.

It would show "updates available" when after the check there actually were updates available, and not show it when there weren't any available. If that's not it, I'm interested as well :)

share|improve this answer
    
Seems like what I was looking for, I'll run it as soon as I see the icon again - which shouldn't be long since it happens once a day or so. –  Alex Apr 6 '13 at 11:44
add comment

You can run the following command in terminal to find out which package manager you are using:

root # ps -aef |grep -i package
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.