Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

While running sudo apt-get install alien, there is an error: Unable lock administrator directory (/var/lib/dpkg/), is another process using it?

How do I fix this?

share|improve this question
add comment

2 Answers 2

It could be that some other package or package update is already downloading, and it hasn't finished downloading yet, so the /var/lib/dpkg/ directory is locked until it finishes. Try to install alien again in a couple of hours.

share|improve this answer
    
I'm trying this few days...same error. If there any command to stop back end download or updates.... –  Zafran Jun 20 '13 at 4:09
    
Now i'm getting error, but 13.04 dvd inside cd rom " Media change: please insert the disc labeled 'Ubuntu 13.04 Raring Ringtail - Release amd64 (20130424)' in the drive '/media/cdrom/' and press enter " –  Zafran Jun 20 '13 at 4:18
    
Something like that should be asked as a separate question instead of hiding it inside a thread. Including all the details in your question will improve your chances of getting a good answer. –  karel Jun 20 '13 at 4:26
add comment

karel's answer should be correct in nearly every case... however, there are some cases where dpkg forgets to clean its lock after its done (it happened to me a couple of times), so then you have to remove it:

sudo rm -f /var/lib/dpkg/lock

But don't remove it unless you are certain dpkg isn't running:

ps -eo command | grep dpkg | grep -v 'grep' # If there is output, then it means
                                            # dpkg is running
share|improve this answer
    
Now i'm getting error, but 13.04 dvd inside cd rom " Media change: please insert the disc labeled 'Ubuntu 13.04 Raring Ringtail - Release amd64 (20130424)' in the drive '/media/cdrom/' and press enter " – Zafran 41 secs ago edit –  Zafran Jun 20 '13 at 4:19
    
@Zafran Try this: askubuntu.com/questions/236288/apt-get-asks-me-to-insert-cd-why –  MiJyn Jun 20 '13 at 4:28
    
Now i'm getting error, but 13.04 dvd inside cd rom " Media change: please insert the disc labeled 'Ubuntu 13.04 Raring Ringtail - Release amd64 (20130424)' in the drive '/media/cdrom/' and press enter " –  Zafran Jun 20 '13 at 6:52
    
@Zafran, could you pastebin /etc/apt/sources.list, and then link it here? –  MiJyn Jun 20 '13 at 7:14
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.