# Failed upgrade on WSL

**URL:** <https://discourse.flox.dev/t/failed-upgrade-on-wsl/672>\
**Category:** Uncategorized\
**Created:** [February 23, 2023, 12:45pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672 "2023-02-23T12:45:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fleimgruber](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/fleimgruber/32/400_2.png) [@fleimgruber](https://discourse.flox.dev/u/fleimgruber)\
**Post date:** [February 23, 2023, 12:45pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/1 "2023-02-23T12:45:35Z")

</div>

I ran a `sudo apt update && sudo apt upgrade` and rebooted WSL. After that I saw this error from `flox list`

```auto
ERROR: environment 'fleimgruber/x86_64-linux.default' not found for system 'x86_64-linux'

```

I then tried `sudo apt --only-upgrade install flox` to be sure of the latest version and got this output:

```auto
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
flox is already the newest version (0.1.0-r372-0.0.10-r190).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up flox (0.1.0-r372-0.0.10-r190) ...
tar: This does not look like a tar archive
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package flox (--configure):
 installed flox package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 flox
E: Sub-process /usr/bin/dpkg returned an error code (1)

```

and the error after `flox list` remains.

---

<div class="post-metadata">

**Author:** ![robinbrantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/robinbrantley/32/39_2.png) [@robinbrantley](https://discourse.flox.dev/u/robinbrantley)\
**Post date:** [February 23, 2023, 1:34pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/2 "2023-02-23T13:34:29Z")

</div>

Hi @fleimgruber!  
So sorry you ran into this. Would you please send me (here or offline to my email) the details of your temp flox installation log file in /tmp? It should be of the format /tmp/flox-installation.log or /tmp/flox-installation.log.[some long number].

---

<div class="post-metadata">

**Author:** ![robinbrantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/robinbrantley/32/39_2.png) [@robinbrantley](https://discourse.flox.dev/u/robinbrantley)\
**Post date:** [February 24, 2023, 2:03pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/3 "2023-02-24T14:03:47Z")

</div>

Hi @fleimgruber - we have found the issue: the upgrade automation is tripping over interactions with systemd. This was previously addressed with an installation but not with an update. I will log this internally to get it sorted.

In the meantime, here is a workaround:  
 → we need to trick the post-installer into succeeding regardless…

Procedure:

```auto
$ sudo mv /var/lib/dpkg/info/flox.postinst /var/lib/dpkg/info/flox.postinst.real
$ sudo ln -s `which true` /var/lib/dpkg/info/flox.postinst
$ sudo dpkg --debug=13 --configure flox
D000001: ensure_diversions: new, (re)loading
D000001: process queue pkg flox:amd64 queue.len 0 progress 1, try 1
Setting up flox (0.1.0-r372-0.0.10-r190) ...
D000002: fork/exec /var/lib/dpkg/info/flox.postinst ( configure 0.0.8-r123 )
D000001: ensure_diversions: same, skipping
$ flox --version
Version: 0.1.0-r372-0.0.10-r190

```

Please let me know how you get on!

---

<div class="post-metadata">

**Author:** ![fleimgruber](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/fleimgruber/32/400_2.png) [@fleimgruber](https://discourse.flox.dev/u/fleimgruber)\
**Post date:** [February 24, 2023, 2:49pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/4 "2023-02-24T14:49:24Z")

</div>

Thanks for the fast fix! I now see this error (should I open a new issue?):

```auto
$ flox pull
Everything up-to-date
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 337 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 519 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 1164 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 2608 ms
warning: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28)
error: path '/nix/store/1rd6d355v7kj8fm3zl6vhr17mhr1ii22-jabref-5.6' does not exist and cannot be created
(use '--show-trace' to show detailed location information)

```

---

<div class="post-metadata">

**Author:** ![robinbrantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/robinbrantley/32/39_2.png) [@robinbrantley](https://discourse.flox.dev/u/robinbrantley)\
**Post date:** [February 24, 2023, 3:03pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/5 "2023-02-24T15:03:23Z")

</div>

odd. (No, it is fine to keep it in this thread but thanks for asking! :-).  
Given it is a timeout, I’m wondering if it is an issue with the other end. I just ran the command and it succeeded so can you run it again and see if you get the same thing?

---

<div class="post-metadata">

**Author:** ![fleimgruber](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/fleimgruber/32/400_2.png) [@fleimgruber](https://discourse.flox.dev/u/fleimgruber)\
**Post date:** [February 24, 2023, 3:16pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/6 "2023-02-24T15:16:19Z")

</div>

Yes, very odd. It seems like an issue on my end, but I am able to download from all the other URLs…

**Update** : there seems to be some SSL issue as I am able to do a plain HTTP:

```auto
$ wget -T 5 http://cache.nixos.org/nix-cache-info
--2023-02-24 16:19:46-- http://cache.nixos.org/nix-cache-info
Resolving cache.nixos.org (cache.nixos.org)... 199.232.18.217, 2a04:4e42:41::729
Connecting to cache.nixos.org (cache.nixos.org)|199.232.18.217|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51 [text/x-nix-cache-info]
Saving to: ‘nix-cache-info’

nix-cache-info 100%[==========================================================>] 51 --.-KB/s in 0s

2023-02-24 16:19:46 (21.4 MB/s) - ‘nix-cache-info’ saved [51/51]

```

but not the HTTPS:

```auto
$ wget -T 5 https://cache.nixos.org/nix-cache-info
--2023-02-24 16:19:32-- https://cache.nixos.org/nix-cache-info
Resolving cache.nixos.org (cache.nixos.org)... 199.232.18.217, 2a04:4e42:41::729
Connecting to cache.nixos.org (cache.nixos.org)|199.232.18.217|:443... connected.
Unable to establish SSL connection.

```

---

<div class="post-metadata">

**Author:** ![fleimgruber](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/fleimgruber/32/400_2.png) [@fleimgruber](https://discourse.flox.dev/u/fleimgruber)\
**Post date:** [February 24, 2023, 3:26pm UTC](https://discourse.flox.dev/t/failed-upgrade-on-wsl/672/7 "2023-02-24T15:26:28Z")

</div>

I figured it out. The issue was an activated company VPN, see also e.g.: [https://github.com/microsoft/WSL/issues/4698](https://github.com/microsoft/WSL/issues/4698). After disabling company VPN, everything works smoothly.
