Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have seen many softwares such as Update Manager and Synaptic Package Manager, they wait if some other program is using the apt-get and is locked. How can we do this through the Terminal? I saw apt-get's manual but didn't find anything useful.

share|improve this question

3 Answers

You can use the aptdcon command Manpage icon to queue up package manager tasks by communicating with aptdaemon instead of using apt-get directly.

So basically you can just do sudo aptdcon install chromium-browser or whatever and while that command is running you can run it again but install different packages and apt-daemon will just queue them up instead of erroring out.

This is especially useful if you're doing a long upgrade or something and want to keep installing packages or if you're scripting something together and want to make sure installing things will be more reliable.

share|improve this answer

Only one package manager can access the package directory while using apt-get. Either you have to quit an existing one to start a new one or you have to wait for one to finish to start a new one.

The commands corresponding to synaptic search and install are respectively "apt-cache search package" and "sudo apt-get install package".

share|improve this answer
But how can we make it wait if other apt-get is running? – Piyush May 5 '12 at 13:25
You'll have to wait manually or write a script that will start running the new apt-get once the old one is finished. But I don't understand a situation in which you would want to do that. Is there any problem manually waiting? Perhaps you could explain your situation so that we can help more. – harisibrahimkv May 5 '12 at 13:28
It will help me in the situation when like I have lots of packages to download and suddenly I got an important call and I have to go somewhere. I want to complete the download by the time I return. But right now some other program is using the apt-get so I cannot start my download. – Piyush May 6 '12 at 9:50

As far as I know, you can select multiple packages from synaptic and also you can provide multiple packages to apt-get. So all you need to do, is to provide apt-get with all the packages you want to install, that should do the trick.

share|improve this answer

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.