Unable to download deb package from repository
I am writing offline installer for my software that relies on Node.js. In order to be able to install Node.js I am trying to download deb packages with all dependencies recursively from remote repository the following way:
$ mkdir nodejs
$ cd nodejs
$ curl -sL | sudo bash -
$ apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends nodejs=14.17.0-deb-1nodesource1 | grep "^\w" | sort -u)Unfortunatelly this one fails with the following error messages:
E: Can't find a source to download version '2.31-0ubuntu9.3' of 'libc6:amd64'
E: Can't find a source to download version '2.31-0ubuntu9.3' of 'libc6:i386'I tried to narrow down the problem by downloading specific deb package, still no luck:
$ apt download libc6
E: Can't find a source to download version '2.31-0ubuntu9.3' of 'libc6:amd64'The most interesting thing that libc6 is already installed:
$ sudo apt install libc6
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6 is already the newest version (2.31-0ubuntu9.3).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.If I specify exact version of the package then everything works like a charm:
$ apt-cache madison libc6 libc6 | 2.31-0ubuntu9.2 | focal-updates/main amd64 Packages libc6 | 2.31-0ubuntu9 | focal/main amd64 Packages
$ apt download libc6=2.31-0ubuntu9.2I don't understand why it doesn't work without specifying the version. I'd expected that it should choose the one by default as it's done for all other packages.
I also tried to make steps to download Node.js on two fresh virtual machines with Ubuntu 20.04.2 LTS and Kubuntu 20.04.2 LTS, and everything works there. I have Kubuntu 20.04.02 LTS on my local development machine. Is anything broken in it? What else can I check to figure out? apt-cache madison libc6 shows equal results on all of them.
UPDATE
Here is output of apt-cache policy libc6 libc6:i386 requested by @N0rbert:
on local machine:
libc6: Installed: 2.31-0ubuntu9.3 Candidate: 2.31-0ubuntu9.3 Version table: *** 2.31-0ubuntu9.3 100 100 /var/lib/dpkg/status 2.31-0ubuntu9.2 500 500 focal-updates/main amd64 Packages 2.31-0ubuntu9 500 500 focal/main amd64 Packages libc6:i386: Installed: 2.31-0ubuntu9.3 Candidate: 2.31-0ubuntu9.3 Version table: *** 2.31-0ubuntu9.3 100 100 /var/lib/dpkg/status 2.31-0ubuntu9.2 500 500 focal-updates/main i386 Packages 2.31-0ubuntu9 500 500 focal/main i386 Packageson virtual machine:
Installed: 2.31-0ubuntu9.2 Candidate: 2.31-0ubuntu9.2 Version table: *** 2.31-0ubuntu9.2 500 500 focal-updates/main amd64 Packages 100 /var/lib/dpkg/status 2.31-0ubuntu9 500 500 focal/main amd64 Packages libc6:i386: Installed: (none) Candidate: 2.31-0ubuntu9.2 Version table: 2.31-0ubuntu9.2 500 500 focal-updates/main i386 Packages 2.31-0ubuntu9 500 500 focal/main i386 Packages
1 Answer
For some reason you have locally installed versions of libc6 with higher versions.
You have to downgrade them to official versions with
sudo apt-get install --reinstall libc6=2.31-0ubuntu9.2 libc6:i386=2.31-0ubuntu9.2