Distributions: Installation fails with "distribution version" error on CentOS 8

Created on 7 Dec 2020  路  5Comments  路  Source: nodesource/distributions

Attempting to install NodeJS 12 with NodeSource Node.js 12.x results in the following error:

## Could not determine your distribution version, you may not be running a supported version of Enterprise Linux. Please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect. Include your 'distribution package' name: centos-linux-release-8.3-1.2011.el8.noarch.

I'd appreciate any guidance you could offer with regards to this 馃檹馃徑

Most helpful comment

Might as well just install the repo directly.

dnf -y module disable nodejs
rpm -Uvh https://rpm.nodesource.com/pub_12.x/el/8/x86_64/nodesource-release-el8-1.noarch.rpm

All 5 comments

The RPM file that the setup.bash script use to check the OS version changed in name with the latest CentOS 8 release, it was centos-release-8.2-2.2004.0.2.el8.x86_64 but is now centos-linux-release-8.3-1.2011.el8.noarch

Its also referenced in the upgrade dialog:
image

The place to change it is in line 233 of the setup.bash, here:
DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+(-stream)?-release(-server|-workstation|-client|-common)?-([0-9]+).*$/\3/')

If you want to get it working, one simple hack is to just replace it with this line:
DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+(-linux)?-release(-server|-workstation|-client|-common)?-([0-9]+).*$/\3/')

The true solution depends on what CentOS 8 renames the centos-stream-release to: 1) centos-linux-stream-release or 2) centos-stream-linux-release; or 3) keep it the same. That would would dictate how the regex is is fixed/updated. I don't have a CentOS server to test this.

If its case 1 or 3, the regex would be:
DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+(-linux)?(-stream)?-release(-server|-workstation|-client|-common)?-([0-9]+).*$/\3/')

If its case 2 or 3, the regex would be:
DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+(-stream)?(-linux)?-release(-server|-workstation|-client|-common)?-([0-9]+).*$/\3/')

Might as well just install the repo directly.

dnf -y module disable nodejs
rpm -Uvh https://rpm.nodesource.com/pub_12.x/el/8/x86_64/nodesource-release-el8-1.noarch.rpm

As of #1147 this has been fixed.
@SingerWang the new regex looks like this:

DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+(-stream|-linux)?-release(-server|-workstation|-client|-common)?-([0-9]+).*$/\3/')

Thanks all for the help and the quick resolution!

I guess the package for centos-stream didn't change their name (or yet).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jtyr picture jtyr  路  4Comments

ErisDS picture ErisDS  路  5Comments

christalk picture christalk  路  5Comments

bewam picture bewam  路  4Comments

MichaelBitard picture MichaelBitard  路  4Comments