[Bug 1871240] Re: Can't upgrade to Focal on WSL1 due to libc6 postinst

Balint Reczey 1871240 at bugs.launchpad.net
Fri Jul 31 20:42:46 UTC 2020


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 at 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 at ff-glibc:~# gcc test-nanosleep.c -o test-nanosleep
root at ff-glibc:~# time ./test-nanosleep 

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

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

real	0m6.095s
user	0m0.226s
sys	0m0.637s
root at ff-glibc:~# apt ^C
root at 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/universe amd64 Packages [3096 B]
Get:30 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [1448 B]
Get:31 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [224 B]                     
Get:32 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]                   
Fetched 15.5 MB in 7s (2197 kB/s)                                                                                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
root at ff-glibc:~# add-apt-repository ppa:rbalint/scratch2
 
 More info: https://launchpad.net/~rbalint/+archive/ubuntu/scratch2
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease    
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease    
Get:5 http://ppa.launchpad.net/rbalint/scratch2/ubuntu focal InRelease [18.1 kB]
Get:6 http://ppa.launchpad.net/rbalint/scratch2/ubuntu focal/main amd64 Packages [3396 B]
Get:7 http://ppa.launchpad.net/rbalint/scratch2/ubuntu focal/main Translation-en [2076 B]
Fetched 23.5 kB in 1s (15.9 kB/s)         
Reading package lists... Done
root at ff-glibc:~# time ./test-nanosleep 

real	0m6.080s
user	0m0.229s
sys	0m0.614s
root at ff-glibc:~# for i in $(seq 3); do time ./test-nanosleep ; done

real	0m6.456s
user	0m0.145s
sys	0m0.413s

real	0m5.934s
user	0m0.131s
sys	0m0.377s

real	0m5.689s
user	0m0.141s
sys	0m0.273s
root at ff-glibc:~# 
root at ff-glibc:~# 
root at ff-glibc:~# for i in $(seq 3); do time ./test-nanosleep ; done
^C
real	0m3.682s
user	0m0.142s
sys	0m0.387s

root at ff-glibc:~# for i in $(seq 5); do time ./test-nanosleep ; done

real	0m6.091s
user	0m0.281s
sys	0m0.596s

real	0m6.059s
user	0m0.245s
sys	0m0.599s

real	0m6.066s
user	0m0.226s
sys	0m0.581s

real	0m6.065s
user	0m0.284s
sys	0m0.574s

real	0m6.101s
user	0m0.287s
sys	0m0.587s

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1871240

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

Status in Ubuntu WSL:
  In Progress
Status in glibc package in Ubuntu:
  Invalid

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

  "
  rafaeldtinoco at 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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntuwsl/+bug/1871240/+subscriptions



More information about the foundations-bugs mailing list