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.

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
NobbZ
  • 511
  • 2
  • 21
  • 2
    possible duplicate of [How to make a package manager wait if another instance of APT is running?](http://askubuntu.com/questions/132059/how-to-make-a-package-manager-wait-if-another-instance-of-apt-is-running) – muru Apr 15 '15 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 '15 at 19:45
  • 1
    Question age is not a factor in determining which is a dupe of which. – muru Apr 15 '15 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 '15 at 19:52
  • 1
    Whether it makes you appear stupid is entirely your perspective. I don't really care either way. – muru Apr 15 '15 at 19:53
  • Yeah... Power of the 30k... And the 290 aren't even heard... – NobbZ Apr 15 '15 at 19:56

2 Answers2

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

:)

tumbleweed
  • 7,986
  • 23
  • 36
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
Ethan McTague
  • 380
  • 2
  • 3
  • 23