R3.2: Debian 9 template fails to update 50% of the time

117 views
Skip to first unread message

cubit

unread,
Dec 5, 2017, 4:33:23 AM12/5/17
to Qubes Users
Hello Qubers,

I am having problems with a Debian 9 template on Qubes R3.2

The Debian 9 template is an upgraded Debian 8 from the repos as there is no prebuilt D9 yet.   Each time I try to update it from Qubes VM Manager it fails the first time  every time with error

Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
Done.
Press Enter to shutdown the template, or Ctrl-C to just close this window.

The only way to get around this is to shutdown the template and immediately try an update again.

Starting it up again, it it is very slow to connect, sitting at "0% [Working]" for up to a minute before connecting to the repos and then slowly goes thorugh them.

Any person know how to fix this so it updates first time with out problems?

Cubit


Mits Levojohn

unread,
Dec 5, 2017, 5:32:51 AM12/5/17
to qubes-users
Check out the documentation:

https://www.qubes-os.org/doc/template/debian/upgrade-8-to-9/

User-initiated updates/upgrades may not run when a templateVM first starts. This is due to a new Debian config setting that attempts to update automatically; it can be disabled with systemctl disable apt-daily.timer.

cubit

unread,
Dec 5, 2017, 5:46:50 AM12/5/17
to Mits Levojohn, qubes-users
5. Dec 2017 10:32 by dim...@gmail.com:

User-initiated updates/upgrades may not run when a templateVM first starts. This is due to a new Debian config setting that attempts to update automatically; it can be disabled with systemctl disable apt-daily.timer.


Wow how did I miss  that.


Danke


Cubit

Chris Laprise

unread,
Dec 5, 2017, 6:42:18 AM12/5/17
to cubit, Mits Levojohn, qubes-users
On 12/05/2017 05:46 AM, cubit wrote:
> 5. Dec 2017 10:32 by dim...@gmail.com <mailto:dim...@gmail.com>:
> <https://www.qubes-os.org/doc/template/debian/upgrade-8-to-9/>
>
> User-initiated updates/upgrades may not run when a templateVM
> first starts. This is due to a new Debian config setting that
> attempts to update automatically; it can be disabled with
> systemctl disable apt-daily.timer.
>
>
> Wow how did I miss  that.
>
>

This issue suggests the unattended updates were disabled:

https://github.com/QubesOS/qubes-issues/issues/2621

--

Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

Unman

unread,
Dec 6, 2017, 8:58:57 AM12/6/17
to cubit, Qubes Users
This has been mentioned before - it isnt really a Qubes issue because it
can be seen on a vanilla Debian install.

It isnt neccessary to shtdown the template - have you tried simply
clearing the stale lock file? 'sudo rm /var/lib/apt/lists/lock ' should
do it.

dim...@united.gr

unread,
Dec 6, 2017, 9:02:01 AM12/6/17
to qubes-users
Is deleting the lock file a good idea? Since it is actually using apt and updating the system?

Unman

unread,
Dec 6, 2017, 10:15:25 AM12/6/17
to dim...@united.gr, qubes-users
In my experience it isnt updating the system. You could check this with
ps aux|grep apt . That's why I said "stale lock file"
(This is with a built Debian9, not an upgraded 8)

Op could of course, just start a template and see if it updates
automatically. It shouldn't.

dim...@united.gr

unread,
Dec 6, 2017, 10:21:32 AM12/6/17
to qubes-users
Sorry, I didn't notice the stale part. I am using an upgraded 8 to 9 Debian and in my case it is actually updating.

Chris Laprise

unread,
Dec 6, 2017, 7:46:51 PM12/6/17
to dim...@united.gr, qubes-users, Unman
On 12/06/2017 10:21 AM, dim...@united.gr wrote:
> Sorry, I didn't notice the stale part. I am using an upgraded 8 to 9
> Debian and in my case it is actually updating.

The best way I found is to disable apt-daily.service, not apt-daily.timer.

vel...@tutamail.com

unread,
Dec 8, 2017, 7:33:45 PM12/8/17
to qubes-users
I am struggling with this same issue...I find that after a restart I can do the update but wanted to do this right. I checked the link posted above:

"User-initiated updates/upgrades may not run when a templateVM first starts. This is due to a new Debian config setting that attempts to update automatically; it can be disabled with systemctl disable apt-daily.timer"

But as a rookie I am unsure of the specific terminal steps in my template. Any chance I can ask the Qubes community for help on the specific terminal commands to get this accomplished?

I would truly appreciate the help...thank you and thank you Qubes!

Unman

unread,
Dec 8, 2017, 9:07:02 PM12/8/17
to vel...@tutamail.com, qubes-users
Open a terminal in the Debian template, and type these commands:
sudo systemctl stop apt-daily.timer
sudo systemctl disable apt-daily.timer
sudo systemctl stop apt-daily.service
sudo systemctl disable apt-daily.service

'Systemctl disable' will stop the service from starting on boot.
To make sure a service will never start, use 'systemctl mask ..', so you
could equally try that command.


Vít Šesták

unread,
Dec 9, 2017, 11:05:14 AM12/9/17
to qubes-users
You can disable the two units just by one command:

sudo systemctl disable apt-daily.{service,timer}

You can do the same with the disable command, but it should not be necessary in most cases with Qubes TemplateVMs to call the stop command. Once you start the TemplateVM, the apt is likely to start. When you call stop command, I believe it lets the aready running command to commplete. Then, you are not likely to run TemplateVM for a day, so it is not likely to start again.

You should not need to mask the units, at least in theory.

Regards,
Vít Šesták 'v6ak'

vel...@tutamail.com

unread,
Dec 9, 2017, 9:40:26 PM12/9/17
to qubes-users
Thank you both! Not sure if thanking on this forum is appropriate as the post goes to the top but thanks anyway! Learnt a lot!
Reply all
Reply to author
Forward
0 new messages