Just to follow up, I've been playing with aptdcon as an alternative to
apt-get. So we can definitely do this to install the dotdee and pwgen
packages.
$ echo y | DEBIAN_FRONTEND=3Dnoninteractive sudo aptdcon --install "dotde=
e
pwgen"
Setting DEBIAN_FRONTEND and using sudo are of course not necessary in a
hook; the yes command doesn't work, presumably because aptdcon is not
supporting SIGPIPE properly, so use echo y.
You can also add a repository using --add-repository or do an upgrade;
this is reasonably well documented in the man page.
I didn't see how to manage the package index update with aptdcon, but
it's certainly possible with a short Python fragment:
from aptdaemon import client
apt_client =3D client.AptClient()
apt_client.update_cache(wait=3DTrue) # implicitly runs, waits until
finished. Good for install hooks!
Lastly, we can combine these approaches together; call the following
file: install-some-packages.py
In terms of a quick analysis of charms out there, the one other option I
saw in apt-get usage that's out there is --no-install-recommends. No
clear way to do this in aptdaemon/aptdcon, but perhaps possible. TBD.
notes on general soln to apt lock contention between primary and sub(s)...
------- ------- ------- ---8<-- ------- ------- ------- ----
Juan,
Just to follow up, I've been playing with aptdcon as an alternative to
apt-get. So we can definitely do this to install the dotdee and pwgen
packages.
$ echo y | DEBIAN_ FRONTEND= 3Dnoninteractiv e sudo aptdcon --install "dotde=
e
pwgen"
Setting DEBIAN_FRONTEND and using sudo are of course not necessary in a
hook; the yes command doesn't work, presumably because aptdcon is not
supporting SIGPIPE properly, so use echo y.
You can also add a repository using --add-repository or do an upgrade;
this is reasonably well documented in the man page.
I didn't see how to manage the package index update with aptdcon, but
it's certainly possible with a short Python fragment:
from aptdaemon import client
apt_client =3D client.AptClient() update_ cache(wait= 3DTrue) # implicitly runs, waits until
apt_client.
finished. Good for install hooks!
Lastly, we can combine these approaches together; call the following some-packages. py
file: install-
from aptdaemon import client
apt_client =3D client.AptClient() install_ packages( package_ names=3D[ "pwgen" , "dotdee"], wait=3DT=
apt_client.
rue)
$ yes | DEBIAN_ FRONTEND= 3Dnoninteractiv e sudo python ./apt-update.py
In terms of a quick analysis of charms out there, the one other option I recommends. No
saw in apt-get usage that's out there is --no-install-
clear way to do this in aptdaemon/aptdcon, but perhaps possible. TBD.
- Jim
------- ------- ------- ---8<-- ------- ------- ------- ----