Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit 1 when upgrading to Ubuntu 21.04 #6942

Closed
1 of 2 tasks
Mystic8b opened this issue May 14, 2021 · 29 comments
Closed
1 of 2 tasks

Exit 1 when upgrading to Ubuntu 21.04 #6942

Mystic8b opened this issue May 14, 2021 · 29 comments

Comments

@Mystic8b
Copy link

Mystic8b commented May 14, 2021

Windows Build Number

Microsoft Windows [Version 10.0.19043.985]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020

Distro Version

Release: 20.10

Other Software

VSCode 1.56.2 with Remote-WSL v0.56.2

Repro Steps

Change Prompt to normal in /etc/update-manager/release-upgrades
sudo apt dist-upgrade -y
sudo do-release-upgrade

Expected Behavior

The update successful

Actual Behavior

Update failed

Diagnostic Logs

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://archive.ubuntu.com/ubuntu groovy InRelease
Hit http://archive.ubuntu.com/ubuntu groovy-updates InRelease
Hit http://archive.ubuntu.com/ubuntu groovy-backports InRelease
Hit http://security.ubuntu.com/ubuntu groovy-security InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

Restoring original system state

Aborting
Reading package lists... Done
Building dependency tree
Reading state information... Done
=== Command terminated with exit status 1 (Fri May 14 10:31:40 2021) ===
@therealkenc
Copy link
Collaborator

The do-release-upgrade pretty much assumes systemd exists, daemons can be stopped and restarted with systemctl, and snaps work (among other things). That's beside generic problems with PPAs that can cause behavior like the above (for example this guy).

The upgrade to 20.10 took here for me with systemd running. Chat about systemd is over in #994.

image

Another way to go is to replace focal with groovy manually in /etc/apt/sources.list with nano or sed, and do an apt update; apt upgrade. Rando guide for that here, which for Stretch to Buster, but applies to updating sources.list in general on Debian derived distros.

But probably a better play still is to wsl.exe --import a Groovy tarball and forgo upgrade entirely. Which is what I would do IRL.

@Mystic8b
Copy link
Author

Mystic8b commented May 14, 2021

Wow. This means that if it is necessary to change the distribution (if it appears in the win store), I need to reconfigure the working environment every time. It is a pain.
Are there any movements in this direction? Will WSL become more like real linux? The same systemd, etc. will ever appear?

upd It turned out that the store is still 20.04, which means that we can normally update only once every 2 years. This is ridiculous.

@BilboTav
Copy link

I had similar issue, took me some time to debug it, but here is what I found out and how I resolved it in the end:

Upgrade tool uses some snap package system which is currently not supported in WSL. I disabled its usage by commenting one line in upgrade script and then it went fine. I upgraded from 20.04 --> 20.10, but I presume it would be same for any other upgrades.

===============================

Run sudo do-release-upgrade

After it fails with abort - go to /tmp, there should be some subfolder something like /tmp/ubuntu-release-upgrader-49jp2ru6/ for example - where instance of upgrade tool is copied. Inside you will found out file called DistUpgradeQuirks.py.

Fine lines 128, 129 and comment them:

#        if cache['snapd'].is_installed:
#            self._checkStoreConnectivity()

Then inside that folder run this command to prompt upgrade again from this edited instance of upgrade tool:

sudo ./dist-upgrade.py --frontend=DistUpgradeViewText

It should run fine now.
A bit complicated, but once the upgrades are done, there are done.

@Mystic8b
Copy link
Author

@BilboTav Crazy😂 Now I can’t risk it, but I’ll try it soon. Thank you!

@guillotp
Copy link

Indeed, a little bit complicated but it works. thank you.
But now I have new issues with the xserver....

@BilboTav
Copy link

@guillotp Link the issue with Xserver here, maybe I dealt with that too.

@guillotp
Copy link

I am using VcXsrv for windows,
It is weird, it works with the option "mutliple windows". But with the option "One large windows" (option I used generally), I have now the following problem.
image

@BilboTav
Copy link

I tried Your example with both of these settings generated by VcXsrv app:

<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="MultiWindow" ClientMode="NoClient" LocalClient="False" Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="" Wgl="True" DisableAC="False" XDMCPTerminate="False"/>
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="Windowed" ClientMode="NoClient" LocalClient="False" Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="" Wgl="True" DisableAC="False" XDMCPTerminate="False"/>

App startxfce4 worked fine on both settings.
Sorry, don't know... don't have much experience with VcXsrv. Maybe start a new issue for that.

@guillotp
Copy link

No worry. Thank you.

@CatInRl
Copy link

CatInRl commented May 24, 2021

I had similar issue, took me some time to debug it, but here is what I found out and how I resolved it in the end:

Upgrade tool uses some snap package system which is currently not supported in WSL. I disabled its usage by commenting one line in upgrade script and then it went fine. I upgraded from 20.04 --> 20.10, but I presume it would be same for any other upgrades.

===============================

Run sudo do-release-upgrade

After it fails with abort - go to /tmp, there should be some subfolder something like /tmp/ubuntu-release-upgrader-49jp2ru6/ for example - where instance of upgrade tool is copied. Inside you will found out file called DistUpgradeQuirks.py.

Fine lines 128, 129 and comment them:

#        if cache['snapd'].is_installed:
#            self._checkStoreConnectivity()

Then inside that folder run this command to prompt upgrade again from this edited instance of upgrade tool:

sudo ./dist-upgrade.py --frontend=DistUpgradeViewText

It should run fine now.
A bit complicated, but once the upgrades are done, there are done.

I came across this issue too. As I didn't use snap package, I just run sudo apt remove snapd to fix this issue. @Mystic8b @BilboTav

@moisespr123
Copy link

Pretty much my 21.04 setup is broken. Can't update packages because of systemd:

Fetched 3,137 kB in 1s (3,040 kB/s)
Setting up systemd (248.2-1ubuntu1) ...
systemd-machine-id-setup: error while loading shared libraries: libsystemd-shared-247.so: cannot open shared object file: No such file or directory
dpkg: error processing package systemd (--configure):
 installed systemd package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)`

@new2f7
Copy link

new2f7 commented Jun 11, 2021

I just run sudo apt remove snapd to fix this issue.

Worked for me when upgrading from 18.04 to 20.04. (The original issue has been closed.)

@throttlemeister
Copy link

There's two easy solutions to the original problem:

  1. start snapd manually and run upgrade
  2. remove snapd from system and run upgrade

Both should work just fine and as normal.

@telorand
Copy link

I know this is a closed issue, but in case anyone comes across this thread, do not use do-release-upgrade to upgrade your WSL Ubuntu version. The recommended method involves modifying your sources.list and sources.list.d with sed or nano and upgrading through sudo apt update' and 'sudo apt upgrade followed by sudo apt full-upgrade.

It would look something like this:

sudo sed -i 's/bionic/hirsute/g' /etc/apt/sources.list
sudo sed -i 's/bionic/hirsute/g' /etc/apt/sources.list.d/*.list
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt autoremove
  • Details about the core concepts can be found here.
  • Some of the discussion about why you shouldn't use do-release-upgrade can be found here.

@hyoretsu
Copy link

@telorand What if we can get snapd working? (A fully working workaround has been found for that)

@putnamca
Copy link

I had similar issue, took me some time to debug it, but here is what I found out and how I resolved it in the end:

Upgrade tool uses some snap package system which is currently not supported in WSL. I disabled its usage by commenting one line in upgrade script and then it went fine. I upgraded from 20.04 --> 20.10, but I presume it would be same for any other upgrades.

===============================

Run sudo do-release-upgrade

After it fails with abort - go to /tmp, there should be some subfolder something like /tmp/ubuntu-release-upgrader-49jp2ru6/ for example - where instance of upgrade tool is copied. Inside you will found out file called DistUpgradeQuirks.py.

Fine lines 128, 129 and comment them:

#        if cache['snapd'].is_installed:
#            self._checkStoreConnectivity()

Then inside that folder run this command to prompt upgrade again from this edited instance of upgrade tool:

sudo ./dist-upgrade.py --frontend=DistUpgradeViewText

It should run fine now. A bit complicated, but once the upgrades are done, there are done.

FWIW: this appears to work going from 21.04 -> 21.10, as well.

@Serendipity-luck
Copy link

I had similar issue, took me some time to debug it, but here is what I found out and how I resolved it in the end:

Upgrade tool uses some snap package system which is currently not supported in WSL. I disabled its usage by commenting one line in upgrade script and then it went fine. I upgraded from 20.04 --> 20.10, but I presume it would be same for any other upgrades.

===============================

Run sudo do-release-upgrade

After it fails with abort - go to /tmp, there should be some subfolder something like /tmp/ubuntu-release-upgrader-49jp2ru6/ for example - where instance of upgrade tool is copied. Inside you will found out file called DistUpgradeQuirks.py.

Fine lines 128, 129 and comment them:

#        if cache['snapd'].is_installed:
#            self._checkStoreConnectivity()

Then inside that folder run this command to prompt upgrade again from this edited instance of upgrade tool:

sudo ./dist-upgrade.py --frontend=DistUpgradeViewText

It should run fine now. A bit complicated, but once the upgrades are done, there are done.

Thanks, It works for me.

@iaamhg
Copy link

iaamhg commented Nov 26, 2021

sudo apt remove snapd

Thanks a lot as It works for my case, and how on earth did you find out it is related with snapd, I checked all the logs under /var/log/dist-upgrade/ and find nothing usefull🤣

@BilboTav
Copy link

sudo apt remove snapd

Thanks a lot as It works for my case, and how on earth did you find out it is related with snapd, I checked all the logs under /var/log/dist-upgrade/ and find nothing usefull🤣

I debugged the python scrips looking for a place, where it exits with error. Pain in d***, but glad it helped some people.

@amirse
Copy link

amirse commented Dec 11, 2021

sudo apt remove snapd

Thanks a lot as It works for my case, and how on earth did you find out it is related with snapd, I checked all the logs under /var/log/dist-upgrade/ and find nothing usefullrofl

I debugged the python scrips looking for a place, where it exits with error. Pain in d***, but glad it helped some people.

Helped me as well. Thanks a lot!

@michael-newsrx
Copy link

Under "groovy".

sudo apt remove snapd
sudo do-release-upgrade --allow-third-party

success.

@hyoretsu
Copy link

hyoretsu commented Jan 6, 2022

You don't need to remove Snap. It's better if you don't, so you don't lose things like Docker. You just need to make it work before updating.

@michael-newsrx
Copy link

You don't need to remove Snap. It's better if you don't, so you don't lose things like Docker. You just need to make it work before updating.

As snapd doesn't work, why keep it installed when its existence causes issues?

Also, the referenced method seems excessively convoluted.

One can always immediately reinstall snapd after the upgrade is finished.

@hyoretsu
Copy link

hyoretsu commented Jan 6, 2022

You don't need to remove Snap. It's better if you don't, so you don't lose things like Docker. You just need to make it work before updating.

As snapd doesn't work, why keep it installed when its existence causes issues?

Also, the referenced method seems excessively convoluted.

One can always immediately reinstall snapd after the upgrade is finished.

"The referenced method" is literally just installing/fixing some snapd dependencies, running a command and upgrading from 20.04->21.04, then running another command and upgrading from 21.04->21.10.

As snapd doesn't work, why reinstall it after the upgrade is finished when its existence causes issues? Said command makes Snapd work for that bash session.

@mattcargile
Copy link

mattcargile commented Jan 25, 2022

Just went from 20.04 to 21.10 on Windows v1909 using @BilboTav's method successfully. The one change was I had to run the below to restart the upgrade ( i.e. the .py was in another folder ). I also made sure to run apt update && apt upgrade && apt autoremove prior the upgrade.

sudo .DistroUpgrade/dist-upgrade.py --frontend=DistUpgradeViewText

I wonder what lurks underneath, so to speak, because I didn't use @telorand's method using sed and full-upgrade. Is it the microcode failures? I did see those failures in my output I think. Not sure of the impact that entails though.

EDIT: I tried @telorand's method and still received the below. I went from focal to impish. Not sure it is a problem. It seems to be working otherwise.

Scanning linux images...

Failed to retrieve available kernel versions.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

User sessions running outdated binaries:
 matt @ /dev/pts/0: bash[8]

@internationils
Copy link

I found a simpler method in a few threads that worked... just sudo apt remove snapd and then it ran just fine and got me from the initial 20.04 directly to impish.

@bviktor
Copy link

bviktor commented Feb 19, 2022

Wow. This means that if it is necessary to change the distribution (if it appears in the win store), I need to reconfigure the working environment every time. It is a pain. Are there any movements in this direction? Will WSL become more like real linux? The same systemd, etc. will ever appear?

upd It turned out that the store is still 20.04, which means that we can normally update only once every 2 years. This is ridiculous.

I'm not sure what you're talking about, the way @therealkenc explained is the way all Debian and Ubuntu releases were done, before update-notifier even existed. Which is just a wrapper around apt anyway. In the background, it's pretty much just

sed -i.orig 's/focal/impish/g' /etc/apt/sources.list
sed -i.orig 's/focal/impish/g' /etc/apt/sources.list.d/*
apt update
apt dist-upgrade

There's no magic involved here, do-release-upgrade would do the exact same thing. You don't have to "reconfigure everything all the time", it's a one-time upgrade. To me it asked 4 questions, all about config files I did modify under /etc. So I had to go through the "trouble" of pressing Return 4 times to keep my versions instead of using the package versions (but of course you could skip even those by doing apt dist-upgrade -y). And then:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:        21.10
Codename:       impish

That's about it. So you guys seem to overthink this issue a little, just because you need to use the original process instead of a fancy wrapper (do-release-upgrade). There's not much of an "issue" here.

@Mo01
Copy link

Mo01 commented Aug 18, 2022

sudo apt remove snapd
Worked for me I wasted a couple of hours before I came across your comment!!

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests