You can list multiple packages to install at once:
aptitude install package1 package2
If you truly care about the order in which they are installed (you almost definitely don't, as aptitude takes into account dependencies and other subtleties automatically), or are looking for a more general solution, do something like the following:
aptitude install package1 && aptitude install package2
The logical AND (&&
) operator will only perform the second command if the one preceding it succeeded (returned exit status 0).
If you are asking how to do this even after you initially did the command, try this another terminal:
aptitude-after() {
printf '%s\n' "Waiting for current aptitude operations to finish"
while pgrep -x aptitude >/dev/null 2>&1; do
sleep 10
done
printf '%s\n' "Done, running new instance of aptitude."
aptitude "$@"
}
Run it as aptitude-after install mypackage2
. It will wait for all current instances of aptitude to finish.