3

Many times there is the problem, that I have only a small bandwith connection, and when running a sudo aptitude safe-upgrade or similar with a big download volume and then stumble upon a program that I want to install additionally via packagemanagement, then I have to remember that myself. Even worse when I have to add a ppa...

Is there a way to add the PPAs and add packages for installation to a queue even when there is another instance of an installation or upgrade is running?

I am using Ubuntu 11.10 and I am not bound to aptitude, apt-get or synaptic, but would prefer a CLI solution.

6
  • 2
    possible duplicate of How to make a package manager wait if another instance of APT is running?
    – muru
    Apr 15, 2015 at 18:28
  • 1
    Nope, the old question is never a duplicate of the new one, but feel free to mark that other one as a duplicate of mine.
    – NobbZ
    Apr 15, 2015 at 19:45
  • 1
    Question age is not a factor in determining which is a dupe of which.
    – muru
    Apr 15, 2015 at 19:47
  • Of course it is. This question wouldn't have been asked, if the other question were about 2 years older. So this question is not a duplicate of the new one. But yes, I can see that the answers to the new question are much more exhaustive, so I would be fine with other ways to link. But flagging this as duplicate makes me appear to be to stupid to look for similar questions before posting.
    – NobbZ
    Apr 15, 2015 at 19:52
  • 1
    Whether it makes you appear stupid is entirely your perspective. I don't really care either way.
    – muru
    Apr 15, 2015 at 19:53

2 Answers 2

4

You can safely interrupt apt during the download phase.

Otherwise, poor man's queue?

while pgrep aptitude; do sleep 10; done && aptitude install foo

:)

1

I know this is a late answer, but here is a little script called apt-iq (apt install queue) that I made. It essentially runs apt-get commands in the background once it becomes possible.

#!/bin/bash
# apt-iq - An install queue system for apt-get.
# usage: apt-iq [aptgetargs].
#        apt-iq --nosep [aptgetargs]
# Run with --nosep to NOT split off and free the terminal.
if [ $1 == '--nosep' ]; then
  while :; do
    lsof /var/lib/dpkg/lock >/dev/null 2>&1
    [ ! $? = 0 ] && break
    sleep .01
  done
  apt-get ${@:2} -y -qq
  echo "DONE."
else
  $0 --nosep $@ &
fi

To use:

sudo apt-iq install foo
sudo apt-iq remove bar

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .