nodesource / distributions

NodeSource Node.js Binary Distributions
https://nodesource.com
MIT License
13.43k stars 3.07k forks source link

Can't install `npm` on Ubuntu 20.04 #1197

Closed kousu closed 2 years ago

kousu commented 3 years ago

Hi y'all. Hope you're doing well these days.

Following the install instructions on this page

$ curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash -
$ sudo apt-get install -y npm

produces for me

The following packages have unmet dependencies:
 npm : [...]

E: Unable to correct problems, you have held broken packages.
CI run showing the issue https://github.com/spine-generic/data-multi-subject/pull/79/checks?check_run_id=2325784102
docker run showing the issue ``` $ docker run --rm -it ubuntu:20.04 root@dab369b2aee4:/# apt-get update Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB] Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB] Get:3 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [197 kB] Get:4 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [682 kB] Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [718 kB] Get:6 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [21.6 kB] Get:7 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB] Get:9 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB] Get:10 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB] Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB] Get:12 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB] Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1152 kB] Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [248 kB] Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [29.6 kB] Get:16 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [949 kB] Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4305 B] Fetched 17.4 MB in 13s (1330 kB/s) Reading package lists... Done root@dab369b2aee4:/# apt-get install curl sudo Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: ca-certificates krb5-locales libasn1-8-heimdal libbrotli1 libcurl4 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common libnghttp2-14 libpsl5 libroken18-heimdal librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0 libssh-4 libssl1.1 libwind0-heimdal openssl publicsuffix Suggested packages: krb5-doc krb5-user libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql The following NEW packages will be installed: ca-certificates curl krb5-locales libasn1-8-heimdal libbrotli1 libcurl4 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common libnghttp2-14 libpsl5 libroken18-heimdal librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0 libssh-4 libssl1.1 libwind0-heimdal openssl publicsuffix sudo 0 upgraded, 33 newly installed, 0 to remove and 5 not upgraded. Need to get 5961 kB of archives. After this operation, 19.0 MB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.3 [1320 kB] Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 openssl amd64 1.1.1f-1ubuntu2.3 [620 kB] Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ca-certificates all 20210119~20.04.1 [146 kB] Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsqlite3-0 amd64 3.31.1-4ubuntu0.2 [549 kB] Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 sudo amd64 1.8.31-1ubuntu1.2 [514 kB] Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 krb5-locales all 1.17-6ubuntu4.1 [11.4 kB] Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libkrb5support0 amd64 1.17-6ubuntu4.1 [30.9 kB] Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libk5crypto3 amd64 1.17-6ubuntu4.1 [79.9 kB] Get:9 http://archive.ubuntu.com/ubuntu focal/main amd64 libkeyutils1 amd64 1.6-6ubuntu1 [10.2 kB] Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libkrb5-3 amd64 1.17-6ubuntu4.1 [330 kB] Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgssapi-krb5-2 amd64 1.17-6ubuntu4.1 [121 kB] Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 libpsl5 amd64 0.21.0-1ubuntu1 [51.5 kB] Get:13 http://archive.ubuntu.com/ubuntu focal/main amd64 publicsuffix all 20200303.0012-1 [111 kB] Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libbrotli1 amd64 1.0.7-6ubuntu0.1 [267 kB] Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 libroken18-heimdal amd64 7.7.0+dfsg-1ubuntu1 [41.8 kB] Get:16 http://archive.ubuntu.com/ubuntu focal/main amd64 libasn1-8-heimdal amd64 7.7.0+dfsg-1ubuntu1 [181 kB] Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 libheimbase1-heimdal amd64 7.7.0+dfsg-1ubuntu1 [29.7 kB] Get:18 http://archive.ubuntu.com/ubuntu focal/main amd64 libhcrypto4-heimdal amd64 7.7.0+dfsg-1ubuntu1 [87.9 kB] Get:19 http://archive.ubuntu.com/ubuntu focal/main amd64 libwind0-heimdal amd64 7.7.0+dfsg-1ubuntu1 [48.0 kB] Get:20 http://archive.ubuntu.com/ubuntu focal/main amd64 libhx509-5-heimdal amd64 7.7.0+dfsg-1ubuntu1 [107 kB] Get:21 http://archive.ubuntu.com/ubuntu focal/main amd64 libkrb5-26-heimdal amd64 7.7.0+dfsg-1ubuntu1 [208 kB] Get:22 http://archive.ubuntu.com/ubuntu focal/main amd64 libheimntlm0-heimdal amd64 7.7.0+dfsg-1ubuntu1 [15.1 kB] Get:23 http://archive.ubuntu.com/ubuntu focal/main amd64 libgssapi3-heimdal amd64 7.7.0+dfsg-1ubuntu1 [96.1 kB] Get:24 http://archive.ubuntu.com/ubuntu focal/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg-2 [14.9 kB] Get:25 http://archive.ubuntu.com/ubuntu focal/main amd64 libsasl2-2 amd64 2.1.27+dfsg-2 [49.3 kB] Get:26 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libldap-common all 2.4.49+dfsg-2ubuntu1.7 [17.1 kB] Get:27 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libldap-2.4-2 amd64 2.4.49+dfsg-2ubuntu1.7 [155 kB] Get:28 http://archive.ubuntu.com/ubuntu focal/main amd64 libnghttp2-14 amd64 1.40.0-1build1 [78.7 kB] Get:29 http://archive.ubuntu.com/ubuntu focal/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2build1 [54.9 kB] Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssh-4 amd64 0.9.3-2ubuntu2.1 [170 kB] Get:31 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4 amd64 7.68.0-1ubuntu2.5 [234 kB] Get:32 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.5 [161 kB] Get:33 http://archive.ubuntu.com/ubuntu focal/main amd64 libsasl2-modules amd64 2.1.27+dfsg-2 [49.1 kB] Fetched 5961 kB in 3s (2367 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libssl1.1:amd64. (Reading database ... 4121 files and directories currently installed.) Preparing to unpack .../00-libssl1.1_1.1.1f-1ubuntu2.3_amd64.deb ... Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.3) ... Selecting previously unselected package openssl. Preparing to unpack .../01-openssl_1.1.1f-1ubuntu2.3_amd64.deb ... Unpacking openssl (1.1.1f-1ubuntu2.3) ... Selecting previously unselected package ca-certificates. Preparing to unpack .../02-ca-certificates_20210119~20.04.1_all.deb ... Unpacking ca-certificates (20210119~20.04.1) ... Selecting previously unselected package libsqlite3-0:amd64. Preparing to unpack .../03-libsqlite3-0_3.31.1-4ubuntu0.2_amd64.deb ... Unpacking libsqlite3-0:amd64 (3.31.1-4ubuntu0.2) ... Selecting previously unselected package sudo. Preparing to unpack .../04-sudo_1.8.31-1ubuntu1.2_amd64.deb ... Unpacking sudo (1.8.31-1ubuntu1.2) ... Selecting previously unselected package krb5-locales. Preparing to unpack .../05-krb5-locales_1.17-6ubuntu4.1_all.deb ... Unpacking krb5-locales (1.17-6ubuntu4.1) ... Selecting previously unselected package libkrb5support0:amd64. Preparing to unpack .../06-libkrb5support0_1.17-6ubuntu4.1_amd64.deb ... Unpacking libkrb5support0:amd64 (1.17-6ubuntu4.1) ... Selecting previously unselected package libk5crypto3:amd64. Preparing to unpack .../07-libk5crypto3_1.17-6ubuntu4.1_amd64.deb ... Unpacking libk5crypto3:amd64 (1.17-6ubuntu4.1) ... Selecting previously unselected package libkeyutils1:amd64. Preparing to unpack .../08-libkeyutils1_1.6-6ubuntu1_amd64.deb ... Unpacking libkeyutils1:amd64 (1.6-6ubuntu1) ... Selecting previously unselected package libkrb5-3:amd64. Preparing to unpack .../09-libkrb5-3_1.17-6ubuntu4.1_amd64.deb ... Unpacking libkrb5-3:amd64 (1.17-6ubuntu4.1) ... Selecting previously unselected package libgssapi-krb5-2:amd64. Preparing to unpack .../10-libgssapi-krb5-2_1.17-6ubuntu4.1_amd64.deb ... Unpacking libgssapi-krb5-2:amd64 (1.17-6ubuntu4.1) ... Selecting previously unselected package libpsl5:amd64. Preparing to unpack .../11-libpsl5_0.21.0-1ubuntu1_amd64.deb ... Unpacking libpsl5:amd64 (0.21.0-1ubuntu1) ... Selecting previously unselected package publicsuffix. Preparing to unpack .../12-publicsuffix_20200303.0012-1_all.deb ... Unpacking publicsuffix (20200303.0012-1) ... Selecting previously unselected package libbrotli1:amd64. Preparing to unpack .../13-libbrotli1_1.0.7-6ubuntu0.1_amd64.deb ... Unpacking libbrotli1:amd64 (1.0.7-6ubuntu0.1) ... Selecting previously unselected package libroken18-heimdal:amd64. Preparing to unpack .../14-libroken18-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libroken18-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libasn1-8-heimdal:amd64. Preparing to unpack .../15-libasn1-8-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libasn1-8-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libheimbase1-heimdal:amd64. Preparing to unpack .../16-libheimbase1-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libheimbase1-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libhcrypto4-heimdal:amd64. Preparing to unpack .../17-libhcrypto4-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libhcrypto4-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libwind0-heimdal:amd64. Preparing to unpack .../18-libwind0-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libwind0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libhx509-5-heimdal:amd64. Preparing to unpack .../19-libhx509-5-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libhx509-5-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libkrb5-26-heimdal:amd64. Preparing to unpack .../20-libkrb5-26-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libkrb5-26-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libheimntlm0-heimdal:amd64. Preparing to unpack .../21-libheimntlm0-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libheimntlm0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libgssapi3-heimdal:amd64. Preparing to unpack .../22-libgssapi3-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ... Unpacking libgssapi3-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Selecting previously unselected package libsasl2-modules-db:amd64. Preparing to unpack .../23-libsasl2-modules-db_2.1.27+dfsg-2_amd64.deb ... Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ... Selecting previously unselected package libsasl2-2:amd64. Preparing to unpack .../24-libsasl2-2_2.1.27+dfsg-2_amd64.deb ... Unpacking libsasl2-2:amd64 (2.1.27+dfsg-2) ... Selecting previously unselected package libldap-common. Preparing to unpack .../25-libldap-common_2.4.49+dfsg-2ubuntu1.7_all.deb ... Unpacking libldap-common (2.4.49+dfsg-2ubuntu1.7) ... Selecting previously unselected package libldap-2.4-2:amd64. Preparing to unpack .../26-libldap-2.4-2_2.4.49+dfsg-2ubuntu1.7_amd64.deb ... Unpacking libldap-2.4-2:amd64 (2.4.49+dfsg-2ubuntu1.7) ... Selecting previously unselected package libnghttp2-14:amd64. Preparing to unpack .../27-libnghttp2-14_1.40.0-1build1_amd64.deb ... Unpacking libnghttp2-14:amd64 (1.40.0-1build1) ... Selecting previously unselected package librtmp1:amd64. Preparing to unpack .../28-librtmp1_2.4+20151223.gitfa8646d.1-2build1_amd64.deb ... Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2build1) ... Selecting previously unselected package libssh-4:amd64. Preparing to unpack .../29-libssh-4_0.9.3-2ubuntu2.1_amd64.deb ... Unpacking libssh-4:amd64 (0.9.3-2ubuntu2.1) ... Selecting previously unselected package libcurl4:amd64. Preparing to unpack .../30-libcurl4_7.68.0-1ubuntu2.5_amd64.deb ... Unpacking libcurl4:amd64 (7.68.0-1ubuntu2.5) ... Selecting previously unselected package curl. Preparing to unpack .../31-curl_7.68.0-1ubuntu2.5_amd64.deb ... Unpacking curl (7.68.0-1ubuntu2.5) ... Selecting previously unselected package libsasl2-modules:amd64. Preparing to unpack .../32-libsasl2-modules_2.1.27+dfsg-2_amd64.deb ... Unpacking libsasl2-modules:amd64 (2.1.27+dfsg-2) ... Setting up libkeyutils1:amd64 (1.6-6ubuntu1) ... Setting up libpsl5:amd64 (0.21.0-1ubuntu1) ... Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.3) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Setting up libbrotli1:amd64 (1.0.7-6ubuntu0.1) ... Setting up libsqlite3-0:amd64 (3.31.1-4ubuntu0.2) ... Setting up libsasl2-modules:amd64 (2.1.27+dfsg-2) ... Setting up libnghttp2-14:amd64 (1.40.0-1build1) ... Setting up krb5-locales (1.17-6ubuntu4.1) ... Setting up libldap-common (2.4.49+dfsg-2ubuntu1.7) ... Setting up libkrb5support0:amd64 (1.17-6ubuntu4.1) ... Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ... Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2build1) ... Setting up sudo (1.8.31-1ubuntu1.2) ... Setting up libk5crypto3:amd64 (1.17-6ubuntu4.1) ... Setting up libsasl2-2:amd64 (2.1.27+dfsg-2) ... Setting up libroken18-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libkrb5-3:amd64 (1.17-6ubuntu4.1) ... Setting up openssl (1.1.1f-1ubuntu2.3) ... Setting up publicsuffix (20200303.0012-1) ... Setting up libheimbase1-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libasn1-8-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libhcrypto4-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up ca-certificates (20210119~20.04.1) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Updating certificates in /etc/ssl/certs... 129 added, 0 removed; done. Setting up libwind0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libgssapi-krb5-2:amd64 (1.17-6ubuntu4.1) ... Setting up libssh-4:amd64 (0.9.3-2ubuntu2.1) ... Setting up libhx509-5-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libkrb5-26-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libheimntlm0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libgssapi3-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ... Setting up libldap-2.4-2:amd64 (2.4.49+dfsg-2ubuntu1.7) ... Setting up libcurl4:amd64 (7.68.0-1ubuntu2.5) ... Setting up curl (7.68.0-1ubuntu2.5) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... Processing triggers for ca-certificates (20210119~20.04.1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done root@dab369b2aee4:/# curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash - ## Installing the NodeSource Node.js 15.x repo... ## Populating apt-get cache... + apt-get update Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease Reading package lists... Done ## Installing packages required for setup: lsb-release gnupg... + apt-get install -y lsb-release gnupg > /dev/null 2>&1 ## Confirming "focal" is supported... + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_15.x/dists/focal/Release' ## Adding the NodeSource signing key to your keyring... + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null ## Creating apt sources list file for the NodeSource Node.js 15.x repo... + echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_15.x focal main' > /etc/apt/sources.list.d/nodesource.list + echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_15.x focal main' >> /etc/apt/sources.list.d/nodesource.list ## Running `apt-get update` for you... + apt-get update Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease Get:2 https://deb.nodesource.com/node_15.x focal InRelease [4583 B] Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease Get:6 https://deb.nodesource.com/node_15.x focal/main amd64 Packages [770 B] Fetched 5353 B in 1s (6239 B/s) Reading package lists... Done ## Run `sudo apt-get install -y nodejs` to install Node.js 15.x and npm ## You may also need development tools to build native addons: sudo apt-get install gcc g++ make ## To install the Yarn package manager, run: curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn root@dab369b2aee4:/# sudo apt-get install -y npm Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: npm : Depends: nodejs (>= 6.11~) Depends: node-abbrev (>= 1.1.1~) but it is not going to be installed Depends: node-ajv but it is not going to be installed Depends: node-ansi but it is not going to be installed Depends: node-ansi-regex (>= 3.0~) but it is not going to be installed Depends: node-ansi-styles but it is not going to be installed Depends: node-ansistyles but it is not going to be installed Depends: node-aproba but it is not going to be installed Depends: node-archy (>= 1.0~) but it is not going to be installed Depends: node-are-we-there-yet but it is not going to be installed Depends: node-asap but it is not going to be installed Depends: node-asn1 but it is not going to be installed Depends: node-assert-plus but it is not going to be installed Depends: node-asynckit but it is not going to be installed Depends: node-aws4 but it is not going to be installed Depends: node-aws-sign2 but it is not going to be installed Depends: node-balanced-match but it is not going to be installed Depends: node-bcrypt-pbkdf but it is not going to be installed Depends: node-bl but it is not going to be installed Depends: node-bluebird but it is not going to be installed Depends: node-boxen but it is not going to be installed Depends: node-brace-expansion but it is not going to be installed Depends: node-builtin-modules but it is not going to be installed Depends: node-builtins but it is not going to be installed Depends: node-cacache but it is not going to be installed Depends: node-call-limit but it is not going to be installed Depends: node-camelcase but it is not going to be installed Depends: node-caseless but it is not going to be installed Depends: node-chalk but it is not going to be installed Depends: node-chownr but it is not going to be installed Depends: node-ci-info but it is not going to be installed Depends: node-cli-boxes but it is not going to be installed Depends: node-cliui but it is not going to be installed Depends: node-clone but it is not going to be installed Depends: node-co but it is not going to be installed Depends: node-color-convert but it is not going to be installed Depends: node-color-name but it is not going to be installed Depends: node-colors but it is not going to be installed Depends: node-columnify but it is not going to be installed Depends: node-combined-stream but it is not going to be installed Depends: node-concat-map but it is not going to be installed Depends: node-concat-stream but it is not going to be installed Depends: node-config-chain but it is not going to be installed Depends: node-configstore but it is not going to be installed Depends: node-console-control-strings but it is not going to be installed Depends: node-copy-concurrently but it is not going to be installed Depends: node-core-util-is but it is not going to be installed Depends: node-cross-spawn but it is not going to be installed Depends: node-crypto-random-string but it is not going to be installed Depends: node-cyclist but it is not going to be installed Depends: node-dashdash but it is not going to be installed Depends: node-debug but it is not going to be installed Depends: node-decamelize but it is not going to be installed Depends: node-deep-extend but it is not going to be installed Depends: node-defaults but it is not going to be installed Depends: node-define-properties but it is not going to be installed Depends: node-delayed-stream but it is not going to be installed Depends: node-delegates but it is not going to be installed Depends: node-detect-indent but it is not going to be installed Depends: node-detect-newline but it is not going to be installed Depends: node-dot-prop but it is not going to be installed Depends: node-duplexer3 but it is not going to be installed Depends: node-duplexify but it is not going to be installed Depends: node-ecc-jsbn but it is not going to be installed Depends: node-editor but it is not going to be installed Depends: node-encoding but it is not going to be installed Depends: node-end-of-stream but it is not going to be installed Depends: node-err-code but it is not going to be installed Depends: node-errno but it is not going to be installed Depends: node-es6-promise but it is not going to be installed Depends: node-escape-string-regexp but it is not going to be installed Depends: node-execa but it is not going to be installed Depends: node-extend but it is not going to be installed Depends: node-extsprintf but it is not going to be installed Depends: node-fast-deep-equal but it is not going to be installed Depends: node-find-up but it is not going to be installed Depends: node-flush-write-stream but it is not going to be installed Depends: node-forever-agent but it is not going to be installed Depends: node-form-data but it is not going to be installed Depends: node-from2 but it is not going to be installed Depends: node-fs.realpath but it is not going to be installed Depends: node-fs-vacuum but it is not going to be installed Depends: node-fs-write-stream-atomic but it is not going to be installed Depends: node-function-bind but it is not going to be installed Depends: node-gauge but it is not going to be installed Depends: node-genfun but it is not going to be installed Depends: node-get-caller-file but it is not going to be installed Depends: node-getpass but it is not going to be installed Depends: node-glob (>= 7.1.2~) but it is not going to be installed Depends: node-got but it is not going to be installed Depends: node-graceful-fs (>= 4.1.11~) but it is not going to be installed Depends: node-gyp (>= 3.6.2~) but it is not going to be installed Depends: node-har-schema but it is not going to be installed Depends: node-har-validator but it is not going to be installed Depends: node-has-flag but it is not going to be installed Depends: node-has-unicode but it is not going to be installed Depends: node-hosted-git-info (>= 2.6~) but it is not going to be installed Depends: node-http-signature but it is not going to be installed Depends: node-iconv-lite but it is not going to be installed Depends: node-iferr but it is not going to be installed Depends: node-import-lazy but it is not going to be installed Depends: node-imurmurhash but it is not going to be installed Depends: node-inflight but it is not going to be installed Depends: node-inherits (>= 2.0.3~) but it is not going to be installed Depends: node-ini (>= 1.3.5~) but it is not going to be installed Depends: node-invert-kv but it is not going to be installed Depends: node-ip but it is not going to be installed Depends: node-ip-regex but it is not going to be installed Depends: node-isarray but it is not going to be installed Depends: node-isexe but it is not going to be installed Depends: node-is-npm but it is not going to be installed Depends: node-is-obj but it is not going to be installed Depends: node-is-path-inside but it is not going to be installed Depends: node-is-retry-allowed but it is not going to be installed Depends: node-is-stream but it is not going to be installed Depends: node-isstream but it is not going to be installed Depends: node-is-typedarray but it is not going to be installed Depends: node-jsbn but it is not going to be installed Depends: node-jsonparse but it is not going to be installed Depends: node-json-parse-better-errors but it is not going to be installed Depends: node-json-schema but it is not going to be installed Depends: node-json-schema-traverse but it is not going to be installed Depends: node-jsonstream (>= 1.3.2~) but it is not going to be installed Depends: node-json-stringify-safe but it is not going to be installed Depends: node-jsprim but it is not going to be installed Depends: node-latest-version but it is not going to be installed Depends: node-lazy-property but it is not going to be installed Depends: node-lcid but it is not going to be installed Depends: node-libnpx but it is not going to be installed Depends: node-locate-path but it is not going to be installed Depends: node-lodash but it is not going to be installed Depends: node-lockfile (>= 1.0.3~) but it is not going to be installed Depends: node-lowercase-keys but it is not going to be installed Depends: node-lru-cache (>= 4.1.1~) but it is not going to be installed Depends: node-make-dir but it is not going to be installed Depends: node-mem but it is not going to be installed Depends: node-mime but it is not going to be installed Depends: node-mime-types but it is not going to be installed Depends: node-mimic-fn but it is not going to be installed Depends: node-minimatch but it is not going to be installed Depends: node-minimist but it is not going to be installed Depends: node-mississippi but it is not going to be installed Depends: node-mkdirp (>= 0.5.1~) but it is not going to be installed Depends: node-move-concurrently but it is not going to be installed Depends: node-ms but it is not going to be installed Depends: node-mute-stream but it is not going to be installed Depends: node-nopt but it is not going to be installed Depends: node-normalize-package-data (>= 2.4~) but it is not going to be installed Depends: node-npm-bundled but it is not going to be installed Depends: node-npm-package-arg (>= 6.1.1) but it is not going to be installed Depends: node-npmlog (>= 4.1.2~) but it is not going to be installed Depends: node-number-is-nan but it is not going to be installed Depends: node-oauth-sign but it is not going to be installed Depends: node-object-assign but it is not going to be installed Depends: node-once (>= 1.4~) but it is not going to be installed Depends: node-opener but it is not going to be installed Depends: node-osenv (>= 0.1.5~) but it is not going to be installed Depends: node-os-locale but it is not going to be installed Depends: node-os-tmpdir but it is not going to be installed Depends: node-package-json but it is not going to be installed Depends: node-parallel-transform but it is not going to be installed Depends: node-path-exists but it is not going to be installed Depends: node-path-is-absolute but it is not going to be installed Depends: node-path-is-inside but it is not going to be installed Depends: node-promise-inflight but it is not going to be installed Depends: node-promise-retry but it is not going to be installed Depends: node-promzard but it is not going to be installed Depends: node-performance-now but it is not going to be installed Depends: node-p-finally but it is not going to be installed Depends: node-p-is-promise but it is not going to be installed Depends: node-pify but it is not going to be installed Depends: node-p-limit but it is not going to be installed Depends: node-p-locate but it is not going to be installed Depends: node-prepend-http but it is not going to be installed Depends: node-process-nextick-args but it is not going to be installed Depends: node-proto-list but it is not going to be installed Depends: node-prr but it is not going to be installed Depends: node-pseudomap but it is not going to be installed Depends: node-psl but it is not going to be installed Depends: node-pump but it is not going to be installed Depends: node-pumpify but it is not going to be installed Depends: node-punycode but it is not going to be installed Depends: node-qs but it is not going to be installed Depends: node-qw but it is not going to be installed Depends: node-rc but it is not going to be installed Depends: node-read (>= 1.0.7~) but it is not going to be installed Depends: node-readable-stream but it is not going to be installed Depends: node-read-package-json (>= 2.0.13~) but it is not going to be installed Depends: node-registry-auth-token but it is not going to be installed Depends: node-registry-url but it is not going to be installed Depends: node-request (>= 2.83~) but it is not going to be installed Depends: node-require-main-filename but it is not going to be installed Depends: node-require-directory but it is not going to be installed Depends: node-resolve-from (>= 4.0~) but it is not going to be installed Depends: node-retry (>= 0.10.1~) but it is not going to be installed Depends: node-rimraf (>= 2.6.2~) but it is not going to be installed Depends: node-run-queue but it is not going to be installed Depends: node-safe-buffer but it is not going to be installed Depends: node-semver (>= 5.5~) but it is not going to be installed Depends: node-set-blocking but it is not going to be installed Depends: node-sha (>= 2.0.1~) but it is not going to be installed Depends: node-shebang-command but it is not going to be installed Depends: node-shebang-regex but it is not going to be installed Depends: node-signal-exit but it is not going to be installed Depends: node-slide (>= 1.1.6~) but it is not going to be installed Depends: node-sorted-object but it is not going to be installed Depends: node-slash but it is not going to be installed Depends: node-semver-diff but it is not going to be installed Depends: node-spdx-correct but it is not going to be installed Depends: node-spdx-exceptions but it is not going to be installed Depends: node-spdx-expression-parse but it is not going to be installed Depends: node-spdx-license-ids but it is not going to be installed Depends: node-sshpk but it is not going to be installed Depends: node-ssri but it is not going to be installed Depends: node-stream-each but it is not going to be installed Depends: node-stream-iterate but it is not going to be installed Depends: node-stream-shift but it is not going to be installed Depends: node-strict-uri-encode but it is not going to be installed Depends: node-string-decoder but it is not going to be installed Depends: node-string-width but it is not going to be installed Depends: node-strip-ansi (>= 4.0~) but it is not going to be installed Depends: node-strip-json-comments but it is not going to be installed Depends: node-strip-eof but it is not going to be installed Depends: node-supports-color but it is not going to be installed Depends: node-tar (>= 4.4~) but it is not going to be installed Depends: node-term-size but it is not going to be installed Depends: node-text-table but it is not going to be installed Depends: node-through but it is not going to be installed Depends: node-through2 but it is not going to be installed Depends: node-timed-out but it is not going to be installed Depends: node-tough-cookie but it is not going to be installed Depends: node-tunnel-agent but it is not going to be installed Depends: node-tweetnacl but it is not going to be installed Depends: node-typedarray but it is not going to be installed Depends: node-uid-number but it is not going to be installed Depends: node-unique-filename but it is not going to be installed Depends: node-unique-string but it is not going to be installed Depends: node-unpipe but it is not going to be installed Depends: node-url-parse-lax but it is not going to be installed Depends: node-util-deprecate but it is not going to be installed Depends: node-uuid but it is not going to be installed Depends: node-validate-npm-package-name but it is not going to be installed Depends: node-verror but it is not going to be installed Depends: node-which (>= 1.3~) but it is not going to be installed Depends: node-which-module but it is not going to be installed Depends: node-wide-align but it is not going to be installed Depends: node-widest-line but it is not going to be installed Depends: node-wrap-ansi but it is not going to be installed Depends: node-wrappy but it is not going to be installed Depends: node-wcwidth.js but it is not going to be installed Depends: node-write-file-atomic but it is not going to be installed Depends: node-xdg-basedir but it is not going to be installed Depends: node-xtend but it is not going to be installed Depends: node-yargs but it is not going to be installed Depends: node-yargs-parser but it is not going to be installed Depends: node-yallist but it is not going to be installed Depends: node-y18n but it is not going to be installed E: Unable to correct problems, you have held broken packages. root@dab369b2aee4:/# ```

I've been using curl | bash && apt install npm with no problems for a while now so I don't know what's up with it today.

kousu commented 3 years ago

I figured out part of the problem: apt is detecting Ubuntu's npm, not yours:

root@d907e43d2a0b:/# apt-get update
Hit:1 https://deb.nodesource.com/node_15.x focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease                                        
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
root@d907e43d2a0b:/# apt show npm
Package: npm
Version: 6.14.4+ds-1ubuntu2
Priority: extra
Section: universe/web
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3468 kB
Depends: nodejs (>= 6.11~), ca-certificates, node-abbrev (>= 1.1.1~), node-ajv, node-ansi, node-ansi-regex (>= 3.0~), node-ansi-styles, node-ansistyles, node-aproba, node-archy (>= 1.0~), node-are-we-there-yet, node-asap, node-asn1, node-assert-plus, node-asynckit, node-aws4, node-aws-sign2, node-balanced-match, node-bcrypt-pbkdf, node-bl, node-bluebird, node-boxen, node-brace-expansion, node-builtin-modules, node-builtins, node-cacache, node-call-limit, node-camelcase, node-caseless, node-chalk, node-chownr, node-ci-info, node-cli-boxes, node-cliui, node-clone, node-co, node-color-convert, node-color-name, node-colors, node-columnify, node-combined-stream, node-concat-map, node-concat-stream, node-config-chain, node-configstore, node-console-control-strings, node-copy-concurrently, node-core-util-is, node-cross-spawn, node-crypto-random-string, node-cyclist, node-dashdash, node-debug, node-decamelize, node-deep-extend, node-defaults, node-define-properties, node-delayed-stream, node-delegates, node-detect-indent, node-detect-newline, node-dot-prop, node-duplexer3, node-duplexify, node-ecc-jsbn, node-editor, node-encoding, node-end-of-stream, node-err-code, node-errno, node-es6-promise, node-escape-string-regexp, node-execa, node-extend, node-extsprintf, node-fast-deep-equal, node-find-up, node-flush-write-stream, node-forever-agent, node-form-data, node-from2, node-fs.realpath, node-fs-vacuum, node-fs-write-stream-atomic, node-function-bind, node-gauge, node-genfun, node-get-caller-file, node-getpass, node-glob (>= 7.1.2~), node-got, node-graceful-fs (>= 4.1.11~), node-gyp (>= 3.6.2~), node-har-schema, node-har-validator, node-has-flag, node-has-unicode, node-hosted-git-info (>= 2.6~), node-http-signature, node-iconv-lite, node-iferr, node-import-lazy, node-imurmurhash, node-inflight, node-inherits (>= 2.0.3~), node-ini (>= 1.3.5~), node-invert-kv, node-ip, node-ip-regex, node-isarray, node-isexe, node-is-npm, node-is-obj, node-is-path-inside, node-is-retry-allowed, node-is-stream, node-isstream, node-is-typedarray, node-jsbn, node-jsonparse, node-json-parse-better-errors, node-json-schema, node-json-schema-traverse, node-jsonstream (>= 1.3.2~), node-json-stringify-safe, node-jsprim, node-latest-version, node-lazy-property, node-lcid, node-libnpx, node-locate-path, node-lodash, node-lockfile (>= 1.0.3~), node-lowercase-keys, node-lru-cache (>= 4.1.1~), node-make-dir, node-mem, node-mime, node-mime-types, node-mimic-fn, node-minimatch, node-minimist, node-mississippi, node-mkdirp (>= 0.5.1~), node-move-concurrently, node-ms, node-mute-stream, node-nopt, node-normalize-package-data (>= 2.4~), node-npm-bundled, node-npm-package-arg (>= 6.1.1), node-npmlog (>= 4.1.2~), node-number-is-nan, node-oauth-sign, node-object-assign, node-once (>= 1.4~), node-opener, node-osenv (>= 0.1.5~), node-os-locale, node-os-tmpdir, node-package-json, node-parallel-transform, node-path-exists, node-path-is-absolute, node-path-is-inside, node-promise-inflight, node-promise-retry, node-promzard, node-performance-now, node-p-finally, node-p-is-promise, node-pify, node-p-limit, node-p-locate, node-prepend-http, node-process-nextick-args, node-proto-list, node-prr, node-pseudomap, node-psl, node-pump, node-pumpify, node-punycode, node-qs, node-qw, node-rc, node-read (>= 1.0.7~), node-readable-stream, node-read-package-json (>= 2.0.13~), node-registry-auth-token, node-registry-url, node-request (>= 2.83~), node-require-main-filename, node-require-directory, node-resolve-from (>= 4.0~), node-retry (>= 0.10.1~), node-rimraf (>= 2.6.2~), node-run-queue, node-safe-buffer, node-semver (>= 5.5~), node-set-blocking, node-sha (>= 2.0.1~), node-shebang-command, node-shebang-regex, node-signal-exit, node-slide (>= 1.1.6~), node-sorted-object, node-slash, node-semver-diff, node-spdx-correct, node-spdx-exceptions, node-spdx-expression-parse, node-spdx-license-ids, node-sshpk, node-ssri, node-stream-each, node-stream-iterate, node-stream-shift, node-strict-uri-encode, node-string-decoder, node-string-width, node-strip-ansi (>= 4.0~), node-strip-json-comments, node-strip-eof, node-supports-color, node-tar (>= 4.4~), node-term-size, node-text-table, node-through, node-through2, node-timed-out, node-tough-cookie, node-tunnel-agent, node-tweetnacl, node-typedarray, node-uid-number, node-unique-filename, node-unique-string, node-unpipe, node-url-parse-lax, node-util-deprecate, node-uuid, node-validate-npm-package-name, node-verror, node-which (>= 1.3~), node-which-module, node-wide-align, node-widest-line, node-wrap-ansi, node-wrappy, node-wcwidth.js, node-write-file-atomic, node-xdg-basedir, node-xtend, node-yargs, node-yargs-parser, node-yallist, node-y18n
Homepage: https://docs.npmjs.com/
Download-Size: 583 kB
APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: package manager for Node.js

And the reason is that your nodejs package provides npm instead of having a separate package: https://deb.nodesource.com/node_15.x/dists/focal/main/binary-amd64/Packages

Package: nodejs
Version: 14.16.1-deb-1nodesource1
Architecture: amd64
Maintainer: Ivan Iguaran <ivan@nodesource.com>
Installed-Size: 116659
Depends: libc6 (>= 2.17), libgcc1 (>= 1:3.4), libstdc++6 (>= 4.8), python3-minimal, ca-certificates
Conflicts: nodejs-dev, nodejs-legacy, npm
Replaces: nodejs-dev (<= 0.8.22), nodejs-legacy, npm (<= 1.2.14)
Provides: nodejs-dev, nodejs-legacy, npm

Was it always like this? Have I been accidentally using the wrong npm all this time somehow without running into problems? Or did the packages recently get merged in your repos?