Can't upgrade to Focal on WSL1 due to libc6 postinst

Bug #1871240 reported by Rafael David Tinoco
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Ubuntu WSL
In Progress
Medium
Unassigned
glibc (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

When trying to upgrade from Eoan to Focal in a WSL1 environment I got:

"
rafaeldtinoco@lenovo:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  console-setup keyboard-configuration libc-bin libc6-dbg
The following packages will be upgraded:
  console-setup keyboard-configuration libc-bin libc6-dbg
4 upgraded, 0 newly installed, 0 to remove and 915 not upgraded.
15 not fully installed or removed.
Need to get 0 B/6,599 kB of archives.
After this operation, 2,348 kB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory
Setting up libc6:amd64 (2.31-0ubuntu7) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
"

And I could only mitigate that by editing:

/var/lib/dpkg/info/libc6\:amd64.postinst

and commented the line

# set -e

so $ apt-get -f install

could continue.

That happens because wsl does not have ubuntu kernel and directory structure is different.

Changed in glibc (Ubuntu):
status: New → Triaged
Changed in wsl (Ubuntu):
status: New → Triaged
Changed in glibc (Ubuntu):
importance: Undecided → Low
Changed in wsl (Ubuntu):
importance: Undecided → Medium
Changed in glibc (Ubuntu):
importance: Low → Medium
tags: added: rls-ff-incoming
Patrick Wu (callmepk)
affects: wsl (Ubuntu) → ubuntuwsl
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

sleep: cannot read realtime clock: Invalid argument

Please escalate to WSL upstream, as the Windows kernel is not providing the kernel interface that is needed to run focal.

In practice this means that focal is not yet supported on wsl1.

I expect things to work in wsl2.

tags: removed: rls-ff-incoming
Changed in glibc (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Hayden Barnes (haydenb) wrote :

This is a known issue and is being tracked upstream in WSL: https://github.com/microsoft/WSL/issues/4898

We have guidance on this: https://discourse.ubuntu.com/t/ubuntu-20-04-and-wsl-1/15291

Changed in ubuntuwsl:
status: Triaged → In Progress
Hayden Barnes (haydenb)
summary: - [focal][wsl] can't upgrade from eoan to focal due to libc6 postinst
+ Can't upgrade to Focal on WSL1 due to libc6 postinst
Revision history for this message
Balint Reczey (rbalint) wrote :
Download full text (5.2 KiB)

Latest upload to Groovy has the fix.

Testing the backported version does not show notable regression in clock_nanosleep's CPU utilization (on a Lenovo Yoga X1 Gen 2 laptop):

root@ff-glibc:~# cat > test-nanosleep.c
#include <time.h>
void main() {
 struct timespec req = {0, 0};
 for (int i = 0; i < 100000; i++){
  clock_nanosleep(CLOCK_REALTIME, 0, &req, NULL);
 }
}
root@ff-glibc:~# gcc test-nanosleep.c -o test-nanosleep
root@ff-glibc:~# time ./test-nanosleep

real 0m6.110s
user 0m0.291s
sys 0m0.567s
root@ff-glibc:~# time ./test-nanosleep

real 0m6.078s
user 0m0.243s
sys 0m0.614s
root@ff-glibc:~# time ./test-nanosleep

real 0m6.095s
user 0m0.226s
sys 0m0.637s
root@ff-glibc:~# apt ^C
root@ff-glibc:~# apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [148 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [44.4 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [23.6 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [1832 B]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [315 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [1172 B]
Get:17 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [540 B]
Get:18 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [116 B]
Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [118 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [7964 B]
Get:21 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [146 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [73.9 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [4920 B]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [11.6 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [3892 B]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [480 B]
Get:27 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [112 B]
Get:28 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:29 http://archive.ubuntu.com/ubuntu focal-backports/univ...

Read more...

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Yes! Sorry, I forgot to update this, I had provided a temporary PPA:

https://github.com/microsoft/WSL/issues/5125#issuecomment-619350931

and it seems that people were using it for some time now. Mentioning in this bug so people can google this.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glibc - 2.31-0ubuntu11

---------------
glibc (2.31-0ubuntu11) groovy; urgency=medium

  [ Michael Hudson-Doyle ]
  * Mark tst-getpw as XFAIL on arm64. (LP: #1869364)

  [ Balint Reczey ]
  * debian/control: Add Vcs-* pointing to Ubuntu packaging repository
  * debian/gbp.conf: Add initial configuration
  * debian/debhelper.in/libc.preinst: Fix setting LDCONFIG_NOTRIGGER
  * debian/control.in/main: Add Vcs-* pointing to Ubuntu packaging repository
  * Fall back to calling nanosleep syscall when __clock_nanosleep returns EINVAL
    (LP: #1871240)
  * debian/testsuite-xfail-debian.mk: XFAIL stdlib/tst-strtod-round on riscv64
  * debian/testsuite-xfail-debian.mk: XFAIL tst-getpw on armhf, too
  * debian/watch: Use HTTPS and download xz-compressed tarball
  * debian/watch: Use upstream's signing key to verify the tarball
  * XFAIL stdlib/tst-getrandom (LP: #1891403)

  [ Dimitri John Ledkov ]
  * debian/patches/powerpc: Cherrypick upstream patches to support POWER10
    optimized library loading. (LP: #1887989)

  [ Aurelien Jarno ]
  * debian/patches/any/submitted-selinux-deprecations.diff: proposed patch to
    ignore the selinux deprecations introduced in libselinux (>= 3.1), fixing
    an FTBFS. (Closes: #965941)

 -- Balint Reczey <email address hidden> Thu, 27 Aug 2020 23:36:39 +0200

Changed in glibc (Ubuntu):
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.