I have a very simple solution which is based on how I name my templates.
All AppVMs are based on my own templates, which I build from a minimal image.
This is a script which will update all templates:
My templates are all named t-<DISTRIBUTION>-<VERSION>-<PURPOSE>
Example: t-fedora-29-mail
This is a fedora 29 based template VM which has all packages installed I need for my mail-AppVMs.
It's very simple but does the job, but it depends on how you name your templates.
The other solution which has been send to this list maybe better if you have another template naming.
Look here:
My (poor man) solution
#!/bin/bash
# update-all.sh - Update all Template-VMs
# Update dom0
sudo qubes-dom0-update
# Update all Fedora templates
echo "[ Updating Fedora Templates ]"
for i in `qvm-ls | grep Template | grep t-fedora | gawk '{ print $1 }'`;
do
echo
echo "Updating $i ..."
qvm-run --auto --user root --pass-io $i 'dnf -y update';
qvm-shutdown $i;
echo "... done."
done
# Update all Debian Templates
echo "[ Updating Debian Templates ]"
for i in `qvm-ls | grep Template | grep t-debian | gawk '{ print $1 }'`;
do
echo
echo "Updatung $i ..."
qvm-run --auto --user root --pass-io $i 'apt-get update && apt-get -y upgrade';
qvm-shutdown $i;
echo "... done."
done
# Update Whonix
#qvm-run --auto --user root --pass-io --no-gui whonix-gw-14 'apt-get -y update' && qvm-shutdown whonix-gw-14
#qvm-run --auto --user root --pass-io --no-gui whonix-ws-14 'apt-get -y update' && qvm-shutdown whonix-ws-14
# Update Whonix Templates
echo "[ Updating Whonix Templates ]"
for i in `qvm-ls | grep Template | grep whonix | gawk '{ print $1 }'`;
do
echo
echo "Updatung $i ..."
qvm-run --auto --user root --pass-io $i 'apt-get update && apt-get -y upgrade';
qvm-shutdown $i;
echo "... done."
done
- O