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.


"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
  • 5
    That seems to be the more specific/advanced answer, except for the useless use of cat :) – frostschutz Apr 6 '13 at 11:49
  • 5
    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

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 :)

  • 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

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

root # ps -aef |grep -i package

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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