Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distribution package Amazon Linux 2022 not supported #1367

Closed
hodnett opened this issue Apr 13, 2022 · 22 comments
Closed

distribution package Amazon Linux 2022 not supported #1367

hodnett opened this issue Apr 13, 2022 · 22 comments
Assignees

Comments

@hodnett
Copy link

hodnett commented Apr 13, 2022

Please add support for Amazon Linux 2022.

Since there is support for Amazon Linux 2, I am hopeful we just need to add this new distribution to the same auto-detection "block" as earlier generations of Amazon Linux.

Github's page on AL2022 has additional info including a Docker image for testing. 2022 is a tag that's guaranteed to point to the latest image of this generation so I'm not certain the output of my uname -a will be the same as yours, but in case you need it, mine is:

Linux <DOCKER CONTAINER ID> 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

@JesusPaz
Copy link
Contributor

JesusPaz commented May 2, 2022

Hi @hodnett,

Can you show more information about the error you are having? I just created a vm on AWS and was able to install Gallium with no problems.

This is the output for uname -a:

Linux <ID> 5.10.109-104.500.amzn2.x86_64 #1 SMP Wed Apr 13 20:31:43 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

@JesusPaz JesusPaz closed this as completed May 2, 2022
@timd73
Copy link

timd73 commented May 3, 2022

@JesusPaz
That's not Amazon Linux 2022 - that's Amazon Linux 2.
This is what I get when I try on Amazon Linux 2022:

$ uname -a
Linux <ID> 5.10.75-82.359.amzn2022.x86_64 #1 SMP Mon Nov 15 18:04:59 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ bash setup_16.x.sh

## Installing the NodeSource Node.js 16.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## You don't appear to be running a supported version of Enterprise Linux. Please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your architecture to be considered for support. Include your 'distribution package' name: no package provides redhat-release
no package provides centos-release
no package provides cloudlinux-release
no package provides sl-release
no package provides fedora-release.

I spun up an EC2 instance from one of the al2022-ami AMIs.

In case this helps:

On Amazon Linux 2:

$ rpm -q system-release --provides
centos-release = 7.5
config(system-release) = 1:2-14.amzn2
redhat-release = 7.5
system-release = 1:2-14.amzn2
system-release(releasever) = 2
system-release(x86-64) = 1:2-14.amzn2

On Amazon Linux 2022:

$ rpm -q system-release --provides
config(system-release) = 2022.0.20220202-0.amzn2022
system-release = 2022.0.20220202-0.amzn2022
system-release(2022)

@hodnett
Copy link
Author

hodnett commented May 9, 2022

@JesusPaz - will you please reopen this issue?

As @timd73 mentioned, Amazon 2 is not the same thing as Amazon 2022. Amazon recently decided to switch to a year based versioning system and technically, Amazon 2022 is Amazon Linux major version 3.

@timd73
Copy link

timd73 commented May 11, 2022

+1 for re-opening the issue

@JesusPaz JesusPaz reopened this May 11, 2022
@okynos
Copy link

okynos commented May 24, 2022

Hello all,

I'm facing this issue too, there is some workaround? Thanks.

Edit: Distribution package system-release-2022.0.20220504-0.amzn2022.noarch
Edit2: Workaround replace this line:

DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)

with:

DISTRO_PKG=$(rpm -q --whatprovides system-release)

Edit3: After previous fix the nodesource package requires redhat-release, you will need to bypass adding --nodeps to the rpm -i command.
⚠️ I don't recommend to perform that force.

curl -sL http://rpm.nodesource.com/setup_8.x | sed 's|sleep 20||g' | sed 's|.*rpm -q --whatprovides fedora-release.*|DISTRO_PKG=$(rpm -q --whatprovides system-release)|g' | sed 's|rpm -i --nosignature --force|rpm -i --nosignature --force --nodeps|g' | bash -

Modified command.

@atsalolikhin-spokeo
Copy link

I ran into this as well.

[root@ip-172-20-92-18 ~]# wget -O /tmp/nodejs https://rpm.nodesource.com/setup_14.x
...
2022-05-25 17:29:08 (572 MB/s) - ‘/tmp/nodejs’ saved [13214/13214]

[root@ip-172-20-92-18 ~]# /tmp/nodejs

## Installing the NodeSource Node.js 14.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## You don't appear to be running a supported version of Enterprise Linux. Please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your architecture to be considered for support. Include your 'distribution package' name: no package provides redhat-release
no package provides centos-release
no package provides cloudlinux-release
no package provides sl-release
no package provides fedora-release.

[root@ip-172-20-92-18 ~]#

The release version package on Amazon Linux 2022 is called system-release:

[root@ip-172-20-92-18 ~]# rpm -qi system-release
Name        : system-release
Version     : 2022.0.20220504
Release     : 0.amzn2022
Architecture: noarch
Install Date: Mon 09 May 2022 05:29:43 PM UTC
Group       : Unspecified
Size        : 15591
License     : MIT
Signature   : RSA/SHA512, Thu 01 Jan 1970 12:00:00 AM UTC, Key ID f59904d8afaa0026
Source RPM  : system-release-2022.0.20220504-0.amzn2022.src.rpm
Build Date  : Tue 03 May 2022 10:34:14 PM UTC
Build Host  : ip-10-0-42-29.us-west-2.compute.internal
Packager    : Amazon Linux
Vendor      : Amazon Linux
URL         : https://amazonlinux.com/
Summary     : Amazon Linux release files
Description :
Amazon Linux release files
[root@ip-172-20-92-18 ~]#

I was able to install the "nodesource" repo RPM by patching the installation script:

[root@ip-172-20-92-18 ~]# diff /tmp/nodejs.orig /tmp/nodejs
183,184c183,185
< echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
< DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
---
> echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release || rpm -q --whatprovides system-release"
> DISTRO_PKG=$(rpm -qa | egrep '(centos|cloudlinux|sl|fedora|system)-release')
> echo DISTRO_PKG=${DISTRO_PKG}
231a233,237
>   # Amazon Linux 2022
>   if uname -r | grep -F .amzn2022.; then
>     DIST_VERSION=8
>   fi
>
348c354
< exec_cmd "rpm -i --nosignature --force '${RPM_TMP}'"
---
> exec_cmd "rpm -i --nodeps --nosignature --force '${RPM_TMP}'"
[root@ip-172-20-92-18 ~]#

Ta-da!

[root@ip-172-20-92-18 ~]# dnf repolist
repo id                                              repo name
amazonlinux                                          Amazon Linux 2022 repository
nodesource                                           Node.js Packages for Enterprise Linux 8 - x86_64
[root@ip-172-20-92-18 ~]#

I don't know what this comment refers to, so I'm not sure if my change is completely proper, I didn't change it the same way in the echo statement as I did in the for loop:

## Annotated section for auto extraction in test.sh

@atsalolikhin-spokeo
Copy link

I am not sure which file(s) I would patch if I wanted to open a pull request:

[~/git/nodesource/distributions] [py-3.9.7] master ± git grep -l system-release
rpm/setup
rpm/setup_0.10
rpm/setup_0.12
rpm/setup_10.x
rpm/setup_11.x
rpm/setup_12.x
rpm/setup_13.x
rpm/setup_14.x
rpm/setup_15.x
rpm/setup_16.x
rpm/setup_17.x
rpm/setup_18.x
rpm/setup_4.x
rpm/setup_5.x
rpm/setup_6.x
rpm/setup_7.x
rpm/setup_8.x
rpm/setup_9.x
rpm/setup_current.x
rpm/setup_iojs_1.x
rpm/setup_iojs_2.x
rpm/setup_iojs_3.x
rpm/setup_lts.x
rpm/src/_setup.sh
[~/git/nodesource/distributions] [py-3.9.7] master ±

And what about adding system-release to the RPM build process? I don't see the RPM spec file:

[~/git/nodesource/distributions] [py-3.9.7] master ± find . | grep spec
[~/git/nodesource/distributions] [py-3.9.7] master ±

@riosje riosje assigned riosje and unassigned JesusPaz May 27, 2022
@riosje
Copy link
Contributor

riosje commented May 30, 2022

Hello @atsalolikhin-spokeo it looks like you already have a patch for the installation script.

do you mind help us to support this distribution?
here are some examples of pull request #1231 - #1195. If you have any problems let us know.

@atsalolikhin-spokeo
Copy link

atsalolikhin-spokeo commented May 31, 2022

I don't feel it's clean to force rpm --nodeps. Where do you all build the RPM? The spec file needs to be updated for Amazon Linux 2022.

The release version package on Amazon Linux 2022 is called system-release.

@riosje
Copy link
Contributor

riosje commented Jul 4, 2022

Hello guys, Amazon Linux 2022 is still in preview, we will be able to support this version after the GA release.

https://aws.amazon.com/linux/amazon-linux-2022/faqs/
https://docs.aws.amazon.com/linux/al2022/ug/release-cadence.html
image

@atsalolikhin-spokeo
Copy link

Thanks @riosje that totally makes sense.

@riosje riosje closed this as completed Jul 5, 2022
@lifeofguenter
Copy link

@riosje I do not think this ticket should be closed when its not fixed.

@jlarmstrongiv
Copy link

@atsalolikhin-spokeo thank you so much! Lifesaver

I created a github gist of the changes for setup_16.x:

  • gist https://gist.github.com/jlarmstrongiv/d6c4dbeeccc43a592e5f5a580e51359f
  • install curl --silent --location https://gist.githubusercontent.com/jlarmstrongiv/d6c4dbeeccc43a592e5f5a580e51359f/raw/ce59c2247752f5dbb0e8f42c5fd980e9690c6f66/nodejs | bash -

Feel free to git diff to see the changes, as they are similar to the original.

To install the latest nodejs16.x version, use yum install -y nodejs-2:16.*


@riosje while amazonlinux2022 is still in preview, I think it’s beneficial to support so that users and library authors can prepare for the transition.

@timd73
Copy link

timd73 commented Sep 15, 2022

Hi - between issue #1381 and this issue, it appears that I am in a catch-22, and unable to start testing the move to node18 on amazon linux:

  1. I cannot upgrade to node18 on "amazon linux 2" because of Can not install node 18 on amazonlinux2 #1381 - it appears that "glibc 2.28 or later" will not be available on amazon linux 2.
  2. I'd like to upgrade to "amazon linux 2022" (yes, even though it's still at RC and not GA) but then I can't install any node due to this ticket (distribution package Amazon Linux 2022 not supported #1367)

So.... I need either this or #1381 (or both?) fixed. And yet both issues are "CLOSED"!

Anyone else in this quandary and have a way out?

@JesusPaz @riosje

@atsalolikhin-spokeo
Copy link

@timd73 See #1367 (comment) for a workaround

@santialbo
Copy link

Hello guys, Amazon Linux 2022 is still in preview, we will be able to support this version after the GA release.

https://aws.amazon.com/linux/amazon-linux-2022/faqs/ https://docs.aws.amazon.com/linux/al2022/ug/release-cadence.html image

Amazon Linux 2023 is now GA. Can we reopen this ticket?

@lifeofguenter
Copy link

What is not working with AL2023 @santialbo ?

@santialbo
Copy link

What is not working with AL2023 @santialbo ?

$ curl -sL https://rpm.nodesource.com/setup_18.x | sudo bash -

## Installing the NodeSource Node.js 18.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## You don't appear to be running a supported version of Enterprise Linux. Please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your architecture to be considered for support. Include your 'distribution package' name: no package provides redhat-release
no package provides centos-release
no package provides cloudlinux-release
no package provides sl-release
no package provides fedora-release.

@Nic128
Copy link

Nic128 commented Mar 20, 2023

People have been told to use the above workaround. Example I have been using. https://gist.githubusercontent.com/Nic128/f7af8ce96a75632f83f8fa104090b3ac/raw/dba52c45d93a4c24f2081a14353dcf8749d1cd06/setup_18.x (Gist does not support 2023)

It's really just adding a detection for AL2022 / AL2023.

# That's a tiny part of the code addition
# Amazon Linux 2023
  if grep -q '"Amazon Linux 2023"' /etc/os-release; then
    DIST_VERSION=8
  fi

@tivanov-qb
Copy link

@riosje can you review this ? it's reproducible with amazonlinux:latest

@riosje
Copy link
Contributor

riosje commented Apr 28, 2023

@riosje can you review this ? it's reproducible with amazonlinux:latest

The next nodejs releases will be available for AL2023.

@matiasmasca
Copy link

For us, it is still a problem with the AWS AL2 on Workers

Your distribution, identified as "system-release-2-16.amzn2.x86_64", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests