dom0 command to update multiple templates?

38 views
Skip to first unread message

Stumpy

unread,
Feb 7, 2019, 9:52:41 PM2/7/19
to Qubes users
I tried a variation or two of:
sudo qvm-run -u root fedora-29 dnf update && sudo qvm-run -u root
debian-8 apt-get update
but none of them worked.
The little sun icon/updater doesnt seem to be working completely yet
though it be nice to just have everything check for then update with one
neat little script, possible?

Jon deps

unread,
Feb 9, 2019, 10:20:34 PM2/9/19
to qubes...@googlegroups.com
you could try tasket's tool ..... though I guess its still unofficial

my little sun thing works fine, and iirc , there are some minuses from
doing the updates via terminals unless you need to do dist-upgrade

PS: you might want to upgrade to debian-9 :)

799

unread,
Feb 10, 2019, 4:45:27 AM2/10/19
to stu...@posteo.net, qubes-users
Hello,


Am Fr., 8. Feb. 2019, 03:52 hat Stumpy <stu...@posteo.net> geschrieben:

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
Reply all
Reply to author
Forward
0 new messages