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
  • 71,754
NobbZ
  • 511

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
  • 8,026
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