Squashed 'nodesource/' changes from ba48c1f..33e0d2a
33e0d2a CI: add NSOLID to the CI tests a9dab9a CI: add NSOLID to the CI tests b84e562 Update scripts to support new NSOLID version 7925aa5 Add node25 scripts 612077e Merge pull request #1890 from nodesource/alejo/fix-distributions 2e44c74 ci(rocky): use official Rocky mirrorlist and tolerate unavailable mirrors 904ee90 fix: update apt 3.0.0 (amd64) [#1874] (#1875) 044f89b doc: update docs git-subtree-dir: nodesource git-subtree-split: 33e0d2ac2a5421d45bfd9b9fdf04c1fcab35246b
This commit is contained in:
+197
-7
@@ -16,7 +16,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
version: [18, 20, 22, 23, 24]
|
version: [ 18, 20, 22, 23, 24, 25 ]
|
||||||
os: [ "ubuntu:24.04", "ubuntu:22.04", "debian:10" ]
|
os: [ "ubuntu:24.04", "ubuntu:22.04", "debian:10" ]
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.os }}
|
image: ${{ matrix.os }}
|
||||||
@@ -27,28 +27,72 @@ jobs:
|
|||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run Istallation Script
|
- name: Fix sources.list for Debian 10
|
||||||
|
if: contains(matrix.os, 'debian:10')
|
||||||
|
run: |
|
||||||
|
echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
|
||||||
|
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true update
|
||||||
|
|
||||||
|
- name: Run Installation Script
|
||||||
run: ./scripts/deb/setup_${{ matrix.version }}.x
|
run: ./scripts/deb/setup_${{ matrix.version }}.x
|
||||||
|
|
||||||
- name: Install Nodejs
|
- name: Install Nodejs
|
||||||
run: |
|
run: apt install nodejs -y
|
||||||
apt-get install nodejs -y
|
|
||||||
|
|
||||||
- name: Validate Node Version
|
- name: Validate Node Version
|
||||||
run: |
|
run: |
|
||||||
node -e "console.log(process.version)"
|
node -e "console.log(process.version)"
|
||||||
NODE_VERSION=$(node -e "console.log((process.version).split('.')[0])")
|
NODE_VERSION=$(node -e "console.log(process.version.split('.')[0])")
|
||||||
|
|
||||||
if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then
|
if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then
|
||||||
echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION"
|
echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
nsolid-deb:
|
||||||
|
name: "NSolid ${{ matrix.version }}(${{ matrix.os }})"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version: [ 18, 20, 22, 24 ]
|
||||||
|
os: [ "ubuntu:24.04", "ubuntu:22.04", "debian:10" ]
|
||||||
|
container:
|
||||||
|
image: ${{ matrix.os }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Fix sources.list for Debian 10
|
||||||
|
if: contains(matrix.os, 'debian:10')
|
||||||
|
run: |
|
||||||
|
echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
|
||||||
|
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true update
|
||||||
|
|
||||||
|
- name: Run Installation Script
|
||||||
|
run: ./scripts/deb/setup_${{ matrix.version }}.x
|
||||||
|
|
||||||
|
- name: Install NSolid
|
||||||
|
run: apt install nsolid -y
|
||||||
|
|
||||||
|
- name: Validate NSolid Version
|
||||||
|
run: |
|
||||||
|
nsolid -e "console.log(process.version)"
|
||||||
|
NSOLID_VERSION=$(nsolid -e "console.log(process.version.split('.')[0])")
|
||||||
|
|
||||||
|
if [[ ${NSOLID_VERSION} != "v${{ matrix.version }}" ]]; then
|
||||||
|
echo "NSolid version is not ${{ matrix.version }}. It is $NSOLID_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})"
|
name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
version: [18, 20, 22, 23, 24]
|
version: [ 18, 20, 22, 23, 24, 25 ]
|
||||||
os: [ "fedora:36", "amazonlinux:2023", "rockylinux:9", "redhat/ubi9:latest" ]
|
os: [ "fedora:36", "amazonlinux:2023", "rockylinux:9", "redhat/ubi9:latest" ]
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.os }}
|
image: ${{ matrix.os }}
|
||||||
@@ -56,6 +100,24 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
|
- name: Patch Rocky repos (avoid broken mirror)
|
||||||
|
if: contains(matrix.os, 'rocky')
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
for f in /etc/yum.repos.d/Rocky-*.repo; do
|
||||||
|
[ -f "$f" ] || continue
|
||||||
|
sed -i 's|^baseurl=.*|# baseurl disabled by CI|' "$f" || true
|
||||||
|
if grep -q '^mirrorlist=' "$f"; then
|
||||||
|
sed -i 's|^mirrorlist=.*|mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever|g' "$f" || true
|
||||||
|
else
|
||||||
|
echo 'mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever' >> "$f" || true
|
||||||
|
fi
|
||||||
|
if ! grep -qi '^skip_if_unavailable=' "$f"; then
|
||||||
|
echo 'skip_if_unavailable=True' >> "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
(dnf clean all || microdnf clean all || true)
|
||||||
|
(dnf -y makecache || microdnf -y makecache || true)
|
||||||
- name: install git
|
- name: install git
|
||||||
run: |
|
run: |
|
||||||
dnf update -y
|
dnf update -y
|
||||||
@@ -80,12 +142,67 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
nsolid-rpm:
|
||||||
|
name: "NSolid ${{ matrix.version }}(${{ matrix.os }})"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version: [ 18, 20, 22, 24 ]
|
||||||
|
os: [ "fedora:36", "amazonlinux:2023", "rockylinux:9", "redhat/ubi9:latest" ]
|
||||||
|
container:
|
||||||
|
image: ${{ matrix.os }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
steps:
|
||||||
|
- name: Patch Rocky repos (avoid broken mirror)
|
||||||
|
if: contains(matrix.os, 'rocky')
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
for f in /etc/yum.repos.d/Rocky-*.repo; do
|
||||||
|
[ -f "$f" ] || continue
|
||||||
|
sed -i 's|^baseurl=.*|# baseurl disabled by CI|' "$f" || true
|
||||||
|
if grep -q '^mirrorlist=' "$f"; then
|
||||||
|
sed -i 's|^mirrorlist=.*|mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever|g' "$f" || true
|
||||||
|
else
|
||||||
|
echo 'mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever' >> "$f" || true
|
||||||
|
fi
|
||||||
|
if ! grep -qi '^skip_if_unavailable=' "$f"; then
|
||||||
|
echo 'skip_if_unavailable=True' >> "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
(dnf clean all || microdnf clean all || true)
|
||||||
|
(dnf -y makecache || microdnf -y makecache || true)
|
||||||
|
- name: install git
|
||||||
|
run: |
|
||||||
|
dnf update -y
|
||||||
|
dnf install git -y
|
||||||
|
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Installation Script
|
||||||
|
run: ./scripts/rpm/setup_${{ matrix.version }}.x
|
||||||
|
|
||||||
|
- name: Install NSolid
|
||||||
|
run: |
|
||||||
|
dnf install nsolid -y
|
||||||
|
|
||||||
|
- name: Validate NSolid Version
|
||||||
|
run: |
|
||||||
|
nsolid -e "console.log(process.version)"
|
||||||
|
NSOLID_VERSION=$(nsolid -e "console.log((process.version).split('.')[0])")
|
||||||
|
if [[ ${NSOLID_VERSION} != "v${{ matrix.version }}" ]]; then
|
||||||
|
echo "NSolid version is not ${{ matrix.version }}. It is $NSOLID_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
rpm-minimal:
|
rpm-minimal:
|
||||||
name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})"
|
name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
version: [18, 20, 22, 23, 24]
|
version: [ 18, 20, 22, 23, 24, 25]
|
||||||
os: [ "rockylinux:9-minimal", "redhat/ubi9-minimal:latest" ]
|
os: [ "rockylinux:9-minimal", "redhat/ubi9-minimal:latest" ]
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.os }}
|
image: ${{ matrix.os }}
|
||||||
@@ -93,6 +210,24 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
|
- name: Patch Rocky repos (avoid broken mirror)
|
||||||
|
if: contains(matrix.os, 'rocky')
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
for f in /etc/yum.repos.d/Rocky-*.repo; do
|
||||||
|
[ -f "$f" ] || continue
|
||||||
|
sed -i 's|^baseurl=.*|# baseurl disabled by CI|' "$f" || true
|
||||||
|
if grep -q '^mirrorlist=' "$f"; then
|
||||||
|
sed -i 's|^mirrorlist=.*|mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever|g' "$f" || true
|
||||||
|
else
|
||||||
|
echo 'mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever' >> "$f" || true
|
||||||
|
fi
|
||||||
|
if ! grep -qi '^skip_if_unavailable=' "$f"; then
|
||||||
|
echo 'skip_if_unavailable=True' >> "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
(dnf clean all || microdnf clean all || true)
|
||||||
|
(dnf -y makecache || microdnf -y makecache || true)
|
||||||
- name: install git
|
- name: install git
|
||||||
run: |
|
run: |
|
||||||
microdnf update -y
|
microdnf update -y
|
||||||
@@ -116,3 +251,58 @@ jobs:
|
|||||||
echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION"
|
echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
nsolid-rpm-minimal:
|
||||||
|
name: "NSolid ${{ matrix.version }}(${{ matrix.os }})"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version: [ 18, 20, 22, 24 ]
|
||||||
|
os: [ "rockylinux:9-minimal", "redhat/ubi9-minimal:latest" ]
|
||||||
|
container:
|
||||||
|
image: ${{ matrix.os }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
steps:
|
||||||
|
- name: Patch Rocky repos (avoid broken mirror)
|
||||||
|
if: contains(matrix.os, 'rocky')
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
for f in /etc/yum.repos.d/Rocky-*.repo; do
|
||||||
|
[ -f "$f" ] || continue
|
||||||
|
sed -i 's|^baseurl=.*|# baseurl disabled by CI|' "$f" || true
|
||||||
|
if grep -q '^mirrorlist=' "$f"; then
|
||||||
|
sed -i 's|^mirrorlist=.*|mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever|g' "$f" || true
|
||||||
|
else
|
||||||
|
echo 'mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=$repo&release=$releasever' >> "$f" || true
|
||||||
|
fi
|
||||||
|
if ! grep -qi '^skip_if_unavailable=' "$f"; then
|
||||||
|
echo 'skip_if_unavailable=True' >> "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
(dnf clean all || microdnf clean all || true)
|
||||||
|
(dnf -y makecache || microdnf -y makecache || true)
|
||||||
|
- name: install git
|
||||||
|
run: |
|
||||||
|
microdnf update -y
|
||||||
|
microdnf install git -y
|
||||||
|
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Installation Script
|
||||||
|
run: ./scripts/rpm/setup_${{ matrix.version }}.x
|
||||||
|
|
||||||
|
- name: Install NSolid
|
||||||
|
run: |
|
||||||
|
microdnf install nsolid -y
|
||||||
|
|
||||||
|
- name: Validate NSolid Version
|
||||||
|
run: |
|
||||||
|
nsolid -e "console.log(process.version)"
|
||||||
|
NSOLID_VERSION=$(nsolid -e "console.log((process.version).split('.')[0])")
|
||||||
|
if [[ ${NSOLID_VERSION} != "v${{ matrix.version }}" ]]; then
|
||||||
|
echo "NSolid version is not ${{ matrix.version }}. It is $NSOLID_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -27,22 +27,27 @@ jobs:
|
|||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run Istallation Script
|
- name: Fix sources.list for Debian 10
|
||||||
|
if: contains(matrix.os, 'debian:10')
|
||||||
|
run: |
|
||||||
|
echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
|
||||||
|
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true update
|
||||||
|
|
||||||
|
- name: Run Installation Script
|
||||||
run: ./scripts/deb/setup_${{ matrix.version }}.x
|
run: ./scripts/deb/setup_${{ matrix.version }}.x
|
||||||
|
|
||||||
- name: Install Nodejs
|
- name: Install Nodejs
|
||||||
run: |
|
run: |
|
||||||
apt-get install nodejs -y
|
apt install nodejs -y
|
||||||
|
|
||||||
- name: Validate Node Version
|
- name: Validate Node Version
|
||||||
run: |
|
run: |
|
||||||
node -e "console.log(process.version)"
|
node -e "console.log(process.version)"
|
||||||
NODE_VERSION=$(node -e "console.log((process.version).split('.')[0])")
|
NODE_VERSION=$(node -e "console.log(process.version.split('.')[0])")
|
||||||
if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then
|
if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then
|
||||||
echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION"
|
echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})"
|
name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
+1365
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -19,18 +19,18 @@ The relevant bits of our build scripts to install the needed compilers looks lik
|
|||||||
|
|
||||||
if [ "x${DIST}" == "xprecise" ]; then
|
if [ "x${DIST}" == "xprecise" ]; then
|
||||||
echo "Calling $0"
|
echo "Calling $0"
|
||||||
apt-get update
|
apt update
|
||||||
apt-get install -y clang-3.4
|
apt install -y clang-3.4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x${DIST}" == "xwheezy" ]; then
|
if [ "x${DIST}" == "xwheezy" ]; then
|
||||||
echo "Calling $0"
|
echo "Calling $0"
|
||||||
apt-get update
|
apt update
|
||||||
apt-get -y install curl apt-transport-https ca-certificates
|
apt -y install curl apt-transport-https ca-certificates
|
||||||
echo "deb https://deb.nodesource.com/clang-3.4 wheezy main" >> /etc/apt/sources.list
|
echo "deb https://deb.nodesource.com/clang-3.4 wheezy main" >> /etc/apt/sources.list
|
||||||
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
|
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
|
||||||
apt-get update
|
apt update
|
||||||
apt-get install -y clang-3.4
|
apt install -y clang-3.4
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -163,14 +163,14 @@ NodeSource will maintain support for stable, testing and unstable releases of De
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
|
||||||
sudo apt-get install -y nodejs
|
sudo apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using Debian, as root
|
##### Using Debian, as root
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\
|
||||||
apt-get install -y nodejs
|
apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Node.js v19.x**:
|
**Node.js v19.x**:
|
||||||
@@ -179,14 +179,14 @@ apt-get install -y nodejs
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
|
||||||
sudo apt-get install -y nodejs
|
sudo apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using Debian, as root
|
##### Using Debian, as root
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
|
||||||
apt-get install -y nodejs
|
apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Node.js v18.x**:
|
**Node.js v18.x**:
|
||||||
@@ -195,14 +195,14 @@ apt-get install -y nodejs
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
|
||||||
sudo apt-get install -y nodejs
|
sudo apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using Debian, as root
|
##### Using Debian, as root
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\
|
||||||
apt-get install -y nodejs
|
apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Node.js v16.x**:
|
**Node.js v16.x**:
|
||||||
@@ -211,14 +211,14 @@ apt-get install -y nodejs
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\
|
||||||
sudo apt-get install -y nodejs
|
sudo apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using Debian, as root
|
##### Using Debian, as root
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\
|
||||||
apt-get install -y nodejs
|
apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Node.js LTS (v18.x)**:
|
**Node.js LTS (v18.x)**:
|
||||||
@@ -227,14 +227,14 @@ apt-get install -y nodejs
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
|
||||||
sudo apt-get install -y nodejs
|
sudo apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using Debian, as root
|
##### Using Debian, as root
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
|
||||||
apt-get install -y nodejs
|
apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Node.js Current (v20.x)**:
|
**Node.js Current (v20.x)**:
|
||||||
@@ -243,14 +243,14 @@ apt-get install -y nodejs
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - &&\
|
||||||
sudo apt-get install -y nodejs
|
sudo apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using Debian, as root
|
##### Using Debian, as root
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://deb.nodesource.com/setup_current.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_current.x | bash - &&\
|
||||||
apt-get install -y nodejs
|
apt install -y nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
***Optional***: install build tools
|
***Optional***: install build tools
|
||||||
@@ -260,7 +260,7 @@ To compile and install native addons from npm you may also need to install build
|
|||||||
##### use `sudo` on Ubuntu or run this as root on debian
|
##### use `sudo` on Ubuntu or run this as root on debian
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
apt-get install -y build-essential
|
apt install -y build-essential
|
||||||
```
|
```
|
||||||
|
|
||||||
`<a name="debuninstall"></a>`
|
`<a name="debuninstall"></a>`
|
||||||
@@ -272,7 +272,7 @@ To completely remove Node.js installed from the deb.nodesource.com package metho
|
|||||||
##### use `sudo` on Ubuntu or run this as root on debian
|
##### use `sudo` on Ubuntu or run this as root on debian
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
apt-get purge nodejs &&\
|
apt purge nodejs &&\
|
||||||
rm -r /etc/apt/sources.list.d/nodesource.list
|
rm -r /etc/apt/sources.list.d/nodesource.list
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ This step is only required if you previously used Chris Lea's Node.js PPA.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# add-apt-repository may not be present on some Ubuntu releases:
|
# add-apt-repository may not be present on some Ubuntu releases:
|
||||||
# sudo apt-get install python-software-properties
|
# sudo apt install python-software-properties
|
||||||
sudo add-apt-repository -y -r ppa:chris-lea/node.js &&\
|
sudo add-apt-repository -y -r ppa:chris-lea/node.js &&\
|
||||||
sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list &&\
|
sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list &&\
|
||||||
sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list.save
|
sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list.save
|
||||||
@@ -329,8 +329,8 @@ echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO m
|
|||||||
**4. Update package lists and install Node.js**
|
**4. Update package lists and install Node.js**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get update
|
sudo apt update
|
||||||
sudo apt-get install nodejs
|
sudo apt install nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
`<a name="rpm"></a>`
|
`<a name="rpm"></a>`
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px"
|
||||||
|
y="0px"
|
||||||
viewBox="0 0 728 216" style="enable-background:new 0 0 728 216;" xml:space="preserve">
|
viewBox="0 0 728 216" style="enable-background:new 0 0 728 216;" xml:space="preserve">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.st0{fill:#A80030;}
|
.st0{fill:#A80030;}
|
||||||
@@ -129,7 +130,8 @@
|
|||||||
c0,0.5-0.4,0.8-0.8,0.8h-1.5v1.9l0,0c0,2-1.6,3.5-3.5,3.5c-0.3,0-0.5,0-0.8-0.1c-0.4-0.1-0.7-0.4-0.7-0.8c0-0.5,0.3-0.8,0.8-0.8
|
c0,0.5-0.4,0.8-0.8,0.8h-1.5v1.9l0,0c0,2-1.6,3.5-3.5,3.5c-0.3,0-0.5,0-0.8-0.1c-0.4-0.1-0.7-0.4-0.7-0.8c0-0.5,0.3-0.8,0.8-0.8
|
||||||
c0.2,0,0.3,0,0.7,0c1,0,1.9-0.8,1.9-1.9v-1.6c0-0.1-0.1-0.3-0.3-0.3l0,0h-1.2c-0.5,0-0.8-0.4-0.8-0.8c0-0.5,0.4-0.8,0.8-0.8
|
c0.2,0,0.3,0,0.7,0c1,0,1.9-0.8,1.9-1.9v-1.6c0-0.1-0.1-0.3-0.3-0.3l0,0h-1.2c-0.5,0-0.8-0.4-0.8-0.8c0-0.5,0.4-0.8,0.8-0.8
|
||||||
L654.6,148.3"/>
|
L654.6,148.3"/>
|
||||||
<path class="st0" d="M91.9,154.4c-0.5,0,0.1,0.2,0.7,0.3c0.2-0.1,0.3-0.3,0.4-0.4C92.6,154.4,92.3,154.4,91.9,154.4"/>
|
<path class="st0"
|
||||||
|
d="M91.9,154.4c-0.5,0,0.1,0.2,0.7,0.3c0.2-0.1,0.3-0.3,0.4-0.4C92.6,154.4,92.3,154.4,91.9,154.4"/>
|
||||||
<path class="st0" d="M94.3,153.8c0.3-0.4,0.5-0.8,0.5-1.2c-0.1,0.3-0.2,0.6-0.4,0.8c-0.9,0.5-0.1-0.3,0-0.6
|
<path class="st0" d="M94.3,153.8c0.3-0.4,0.5-0.8,0.5-1.2c-0.1,0.3-0.2,0.6-0.4,0.8c-0.9,0.5-0.1-0.3,0-0.6
|
||||||
C93.6,153.9,94.4,153.5,94.3,153.8"/>
|
C93.6,153.9,94.4,153.5,94.3,153.8"/>
|
||||||
<path class="st0" d="M95.2,151.4c0.1-0.8-0.2-0.6-0.2-0.2C95.1,151.2,95.2,151.8,95.2,151.4"/>
|
<path class="st0" d="M95.2,151.4c0.1-0.8-0.2-0.6-0.2-0.2C95.1,151.2,95.2,151.8,95.2,151.4"/>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@@ -24,7 +24,7 @@ Each script in this repository performs the following steps:
|
|||||||
|
|
||||||
1. Checks if the system is an Debian based Linux distribution.
|
1. Checks if the system is an Debian based Linux distribution.
|
||||||
2. Configures the NodeSource Node.js DEB repository for the specified version of Node.js.
|
2. Configures the NodeSource Node.js DEB repository for the specified version of Node.js.
|
||||||
3. Logs a message indicating that the repository is configured and updated, and instructs the user to run `apt-get install nodejs -y` to complete the installation.
|
3. Logs a message indicating that the repository is configured and updated, and instructs the user to run `apt install nodejs -y` to complete the installation.
|
||||||
|
|
||||||
The `setup_current` and `setup_latest` scripts are special scripts that install the current and latest versions of Node.js, respectively. The current version is 20.x and the latest version is 21.x.
|
The `setup_current` and `setup_latest` scripts are special scripts that install the current and latest versions of Node.js, respectively. The current version is 20.x and the latest version is 21.x.
|
||||||
|
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ configure_repo() {
|
|||||||
local node_version=$1
|
local node_version=$1
|
||||||
|
|
||||||
arch=$(dpkg --print-architecture)
|
arch=$(dpkg --print-architecture)
|
||||||
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then
|
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
|
||||||
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported."
|
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
||||||
@@ -91,14 +91,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if [ ! -f "$base_script" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# List of versions
|
# List of versions
|
||||||
versions=("18" "20" "22" "23" "24")
|
versions=("23" "24" "25")
|
||||||
|
|
||||||
# Iterate over the versions and create scripts
|
# Iterate over the versions and create scripts
|
||||||
for version in "${versions[@]}"; do
|
for version in "${versions[@]}"; do
|
||||||
@@ -33,8 +33,8 @@ for version in "${versions[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Define LTS and current Node.js versions
|
# Define LTS and current Node.js versions
|
||||||
lts_version="22"
|
lts_version="24"
|
||||||
current_version="24"
|
current_version="25"
|
||||||
|
|
||||||
# Create setup_lts and setup_current scripts
|
# Create setup_lts and setup_current scripts
|
||||||
create_script "$lts_version" "lts"
|
create_script "$lts_version" "lts"
|
||||||
|
|||||||
@@ -113,13 +113,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -152,11 +152,11 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully. To install Node.js, run: apt-get install nodejs -y" "success"
|
log "Repository configured successfully. To install Node.js, run: apt install nodejs -y" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+37
-10
@@ -1,5 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Send deprecation Warning
|
||||||
|
node_deprecation_warning() {
|
||||||
|
log "
|
||||||
|
===============================================================================
|
||||||
|
DEPRECATION WARNING
|
||||||
|
===============================================================================
|
||||||
|
Node.js 18.x is no longer actively supported!
|
||||||
|
You will not receive security or critical stability updates for this version.
|
||||||
|
|
||||||
|
You should migrate to a supported version of Node.js as soon as possible.
|
||||||
|
|
||||||
|
Please see https://nodesource.com/products/distributions for details about which
|
||||||
|
version may be appropriate for you.
|
||||||
|
|
||||||
|
The NodeSource Node.js distributions site contains
|
||||||
|
information both about supported versions of Node.js and N|Solid supported Linux
|
||||||
|
distributions. To learn more about usage, see:
|
||||||
|
https://nodesource.com/products/distributions
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
Continuing in 10 seconds ...
|
||||||
|
" "error"
|
||||||
|
sleep 10
|
||||||
|
}
|
||||||
|
|
||||||
# Logger Function
|
# Logger Function
|
||||||
log() {
|
log() {
|
||||||
local message="$1"
|
local message="$1"
|
||||||
@@ -42,13 +68,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -91,14 +117,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,5 +135,6 @@ NODE_VERSION="18.x"
|
|||||||
check_os
|
check_os
|
||||||
|
|
||||||
# Main execution
|
# Main execution
|
||||||
|
node_deprecation_warning
|
||||||
install_pre_reqs || handle_error $? "Failed installing pre-requisites"
|
install_pre_reqs || handle_error $? "Failed installing pre-requisites"
|
||||||
configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository"
|
configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository"
|
||||||
|
|||||||
+10
-10
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -91,14 +91,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -91,14 +91,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -91,14 +91,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ configure_repo() {
|
|||||||
local node_version=$1
|
local node_version=$1
|
||||||
|
|
||||||
arch=$(dpkg --print-architecture)
|
arch=$(dpkg --print-architecture)
|
||||||
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then
|
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
|
||||||
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported."
|
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
||||||
@@ -91,14 +91,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ configure_repo() {
|
|||||||
local node_version=$1
|
local node_version=$1
|
||||||
|
|
||||||
arch=$(dpkg --print-architecture)
|
arch=$(dpkg --print-architecture)
|
||||||
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then
|
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
|
||||||
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported."
|
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
||||||
@@ -91,14 +91,14 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Executable
+113
@@ -0,0 +1,113 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Logger Function
|
||||||
|
log() {
|
||||||
|
local message="$1"
|
||||||
|
local type="$2"
|
||||||
|
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
local color
|
||||||
|
local endcolor="\033[0m"
|
||||||
|
|
||||||
|
case "$type" in
|
||||||
|
"info") color="\033[38;5;79m" ;;
|
||||||
|
"success") color="\033[1;32m" ;;
|
||||||
|
"error") color="\033[1;31m" ;;
|
||||||
|
*) color="\033[1;34m" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo -e "${color}${timestamp} - ${message}${endcolor}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Error handler function
|
||||||
|
handle_error() {
|
||||||
|
local exit_code=$1
|
||||||
|
local error_message="$2"
|
||||||
|
log "Error: $error_message (Exit Code: $exit_code)" "error"
|
||||||
|
exit $exit_code
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to check for command availability
|
||||||
|
command_exists() {
|
||||||
|
command -v "$1" &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
check_os() {
|
||||||
|
if ! [ -f "/etc/debian_version" ]; then
|
||||||
|
echo "Error: This script is only supported on Debian-based systems."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to Install the script pre-requisites
|
||||||
|
install_pre_reqs() {
|
||||||
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
|
# Run 'apt update'
|
||||||
|
if ! apt update -y; then
|
||||||
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run 'apt install'
|
||||||
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
|
handle_error "$?" "Failed to install packages"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! mkdir -p /usr/share/keyrings; then
|
||||||
|
handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f /usr/share/keyrings/nodesource.gpg || true
|
||||||
|
rm -f /etc/apt/sources.list.d/nodesource.list || true
|
||||||
|
|
||||||
|
# Run 'curl' and 'gpg' to download and import the NodeSource signing key
|
||||||
|
if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then
|
||||||
|
handle_error "$?" "Failed to download and import the NodeSource signing key"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Explicitly set the permissions to ensure the file is readable by all
|
||||||
|
if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then
|
||||||
|
handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to configure the Repo
|
||||||
|
configure_repo() {
|
||||||
|
local node_version=$1
|
||||||
|
|
||||||
|
arch=$(dpkg --print-architecture)
|
||||||
|
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
|
||||||
|
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
||||||
|
|
||||||
|
# N|solid Config
|
||||||
|
echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null
|
||||||
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null
|
||||||
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null
|
||||||
|
|
||||||
|
# Nodejs Config
|
||||||
|
echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
|
# Run 'apt update'
|
||||||
|
if ! apt update -y; then
|
||||||
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
|
else
|
||||||
|
log "Repository configured successfully."
|
||||||
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Define Node.js version
|
||||||
|
NODE_VERSION="25.x"
|
||||||
|
|
||||||
|
# Check OS
|
||||||
|
check_os
|
||||||
|
|
||||||
|
# Main execution
|
||||||
|
install_pre_reqs || handle_error $? "Failed installing pre-requisites"
|
||||||
|
configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository"
|
||||||
+13
-13
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ configure_repo() {
|
|||||||
local node_version=$1
|
local node_version=$1
|
||||||
|
|
||||||
arch=$(dpkg --print-architecture)
|
arch=$(dpkg --print-architecture)
|
||||||
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then
|
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
|
||||||
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported."
|
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
||||||
@@ -91,19 +91,19 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Define Node.js version
|
# Define Node.js version
|
||||||
NODE_VERSION="24.x"
|
NODE_VERSION="25.x"
|
||||||
|
|
||||||
# Check OS
|
# Check OS
|
||||||
check_os
|
check_os
|
||||||
|
|||||||
+13
-13
@@ -42,13 +42,13 @@ check_os() {
|
|||||||
install_pre_reqs() {
|
install_pre_reqs() {
|
||||||
log "Installing pre-requisites" "info"
|
log "Installing pre-requisites" "info"
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run 'apt-get install'
|
# Run 'apt install'
|
||||||
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
|
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
|
||||||
handle_error "$?" "Failed to install packages"
|
handle_error "$?" "Failed to install packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ configure_repo() {
|
|||||||
local node_version=$1
|
local node_version=$1
|
||||||
|
|
||||||
arch=$(dpkg --print-architecture)
|
arch=$(dpkg --print-architecture)
|
||||||
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then
|
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
|
||||||
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported."
|
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
|
||||||
@@ -91,19 +91,19 @@ configure_repo() {
|
|||||||
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null
|
||||||
|
|
||||||
# Run 'apt-get update'
|
# Run 'apt update'
|
||||||
if ! apt-get update -y; then
|
if ! apt update -y; then
|
||||||
handle_error "$?" "Failed to run 'apt-get update'"
|
handle_error "$?" "Failed to run 'apt update'"
|
||||||
else
|
else
|
||||||
log "Repository configured successfully."
|
log "Repository configured successfully."
|
||||||
log "To install Node.js, run: apt-get install nodejs -y" "info"
|
log "To install Node.js, run: apt install nodejs -y" "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success"
|
log "To install N|solid Runtime, run: apt install nsolid -y \n" "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Define Node.js version
|
# Define Node.js version
|
||||||
NODE_VERSION="22.x"
|
NODE_VERSION="24.x"
|
||||||
|
|
||||||
# Check OS
|
# Check OS
|
||||||
check_os
|
check_os
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module_hotfixes=1"
|
|||||||
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
||||||
|
|
||||||
# Check if Node.js version is an LTS version
|
# Check if Node.js version is an LTS version
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
# Repository content for N|Solid
|
# Repository content for N|Solid
|
||||||
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
||||||
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
@@ -88,7 +88,7 @@ if command_exists dnf; then
|
|||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -104,7 +104,7 @@ elif command_exists yum; then
|
|||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -119,7 +119,7 @@ elif command_exists microdnf; then
|
|||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if [ ! -f "$base_script" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# List of versions
|
# List of versions
|
||||||
versions=("18" "20" "22" "23" "24")
|
versions=("23" "24" "25")
|
||||||
|
|
||||||
# Iterate over the versions and create scripts
|
# Iterate over the versions and create scripts
|
||||||
for version in "${versions[@]}"; do
|
for version in "${versions[@]}"; do
|
||||||
@@ -33,8 +33,8 @@ for version in "${versions[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Define LTS and current Node.js versions
|
# Define LTS and current Node.js versions
|
||||||
lts_version="22"
|
lts_version="24"
|
||||||
current_version="24"
|
current_version="25"
|
||||||
|
|
||||||
# Create setup_lts and setup_current scripts
|
# Create setup_lts and setup_current scripts
|
||||||
create_script "$lts_version" "lts"
|
create_script "$lts_version" "lts"
|
||||||
|
|||||||
@@ -1,5 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Send deprecation Warning
|
||||||
|
node_deprecation_warning() {
|
||||||
|
log "
|
||||||
|
===============================================================================
|
||||||
|
DEPRECATION WARNING
|
||||||
|
===============================================================================
|
||||||
|
Node.js 18.x is no longer actively supported!
|
||||||
|
You will not receive security or critical stability updates for this version.
|
||||||
|
|
||||||
|
You should migrate to a supported version of Node.js as soon as possible.
|
||||||
|
|
||||||
|
Please see https://nodesource.com/products/distributions for details about which
|
||||||
|
version may be appropriate for you.
|
||||||
|
|
||||||
|
The NodeSource Node.js distributions site contains
|
||||||
|
information both about supported versions of Node.js and N|Solid supported Linux
|
||||||
|
distributions. To learn more about usage, see:
|
||||||
|
https://nodesource.com/products/distributions
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
Continuing in 10 seconds ...
|
||||||
|
" "error"
|
||||||
|
sleep 10
|
||||||
|
}
|
||||||
|
|
||||||
# Logger Function
|
# Logger Function
|
||||||
log() {
|
log() {
|
||||||
local message="$1"
|
local message="$1"
|
||||||
@@ -36,6 +62,9 @@ if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release
|
|||||||
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
|
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Send deprecation Warning
|
||||||
|
node_deprecation_warning
|
||||||
|
|
||||||
log "Cleaning up old repositories..." "info"
|
log "Cleaning up old repositories..." "info"
|
||||||
rm -f /etc/yum.repos.d/nodesource*.repo
|
rm -f /etc/yum.repos.d/nodesource*.repo
|
||||||
log "Old repositories removed" "info"
|
log "Old repositories removed" "info"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module_hotfixes=1"
|
|||||||
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
||||||
|
|
||||||
# Check if Node.js version is an LTS version
|
# Check if Node.js version is an LTS version
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
# Repository content for N|Solid
|
# Repository content for N|Solid
|
||||||
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
||||||
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
@@ -88,7 +88,7 @@ if command_exists dnf; then
|
|||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -104,7 +104,7 @@ elif command_exists yum; then
|
|||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -119,7 +119,7 @@ elif command_exists microdnf; then
|
|||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module_hotfixes=1"
|
|||||||
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
||||||
|
|
||||||
# Check if Node.js version is an LTS version
|
# Check if Node.js version is an LTS version
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
# Repository content for N|Solid
|
# Repository content for N|Solid
|
||||||
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
||||||
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
@@ -88,7 +88,7 @@ if command_exists dnf; then
|
|||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -104,7 +104,7 @@ elif command_exists yum; then
|
|||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -119,7 +119,7 @@ elif command_exists microdnf; then
|
|||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
||||||
else
|
else
|
||||||
|
|||||||
Executable
+132
@@ -0,0 +1,132 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Logger Function
|
||||||
|
log() {
|
||||||
|
local message="$1"
|
||||||
|
local type="$2"
|
||||||
|
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
local color
|
||||||
|
local endcolor="\033[0m"
|
||||||
|
|
||||||
|
case "$type" in
|
||||||
|
"info") color="\033[38;5;79m" ;;
|
||||||
|
"success") color="\033[1;32m" ;;
|
||||||
|
"error") color="\033[1;31m" ;;
|
||||||
|
*) color="\033[1;34m" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo -e "${color}${timestamp} - ${message}${endcolor}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Error handler function
|
||||||
|
handle_error() {
|
||||||
|
local exit_code=$1
|
||||||
|
local error_message="$2"
|
||||||
|
log "Error: $error_message (Exit Code: $exit_code)" "error"
|
||||||
|
exit $exit_code
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to check for command availability
|
||||||
|
command_exists() {
|
||||||
|
command -v "$1" &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if we are on an RPM-based system
|
||||||
|
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
|
||||||
|
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Cleaning up old repositories..." "info"
|
||||||
|
rm -f /etc/yum.repos.d/nodesource*.repo
|
||||||
|
log "Old repositories removed" "info"
|
||||||
|
|
||||||
|
# Define Node.js version
|
||||||
|
NODE_VERSION="25.x"
|
||||||
|
|
||||||
|
# Get system architecture
|
||||||
|
SYS_ARCH=$(uname -m)
|
||||||
|
|
||||||
|
# Validate system architecture
|
||||||
|
case "$SYS_ARCH" in
|
||||||
|
aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;;
|
||||||
|
*) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Repository content for Node.js
|
||||||
|
NODEJS_REPO_CONTENT="[nodesource-nodejs]
|
||||||
|
name=Node.js Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
|
baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH
|
||||||
|
priority=9
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key
|
||||||
|
module_hotfixes=1"
|
||||||
|
|
||||||
|
# Write Node.js repository content
|
||||||
|
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
||||||
|
|
||||||
|
# Check if Node.js version is an LTS version
|
||||||
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
|
# Repository content for N|Solid
|
||||||
|
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
||||||
|
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
|
baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH
|
||||||
|
priority=9
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key
|
||||||
|
module_hotfixes=1"
|
||||||
|
|
||||||
|
# Write N|Solid repository content
|
||||||
|
echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null
|
||||||
|
log "Added N|Solid repository for LTS version: $NODE_VERSION" "info"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for availability of dnf, yum or microdnf
|
||||||
|
if command_exists dnf; then
|
||||||
|
log "dnf available, updating..." "info"
|
||||||
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
|
# Update N|Solid repository if it's LTS
|
||||||
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
|
log "Repository is configured and updated." "info"
|
||||||
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
|
log "To install N|solid Runtime, run: dnf install nsolid -y" "success"
|
||||||
|
else
|
||||||
|
log "Repository is configured and updated." "info"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Run 'dnf install nodejs -y' to complete the installation." "info"
|
||||||
|
exit 0
|
||||||
|
elif command_exists yum; then
|
||||||
|
log "yum available, updating..." "info"
|
||||||
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
|
# Update N|Solid repository if it's LTS
|
||||||
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
|
log "Repository is configured and updated." "info"
|
||||||
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
|
log "Run 'yum install nsolid -y' to complete the installation." "success"
|
||||||
|
else
|
||||||
|
log "Repository is configured and updated." "info"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Run 'yum install nodejs -y' to complete the installation." "info"
|
||||||
|
elif command_exists microdnf; then
|
||||||
|
log "microdnf available, updating..." "info"
|
||||||
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
|
# Update N|Solid repository if it's LTS
|
||||||
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
|
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
||||||
|
else
|
||||||
|
log "Repository is configured and updated." "info"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Run 'microdnf install nodejs -y' to complete the installation." "info"
|
||||||
|
else
|
||||||
|
handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager."
|
||||||
|
fi
|
||||||
@@ -41,7 +41,7 @@ rm -f /etc/yum.repos.d/nodesource*.repo
|
|||||||
log "Old repositories removed" "info"
|
log "Old repositories removed" "info"
|
||||||
|
|
||||||
# Define Node.js version
|
# Define Node.js version
|
||||||
NODE_VERSION="24.x"
|
NODE_VERSION="25.x"
|
||||||
|
|
||||||
# Get system architecture
|
# Get system architecture
|
||||||
SYS_ARCH=$(uname -m)
|
SYS_ARCH=$(uname -m)
|
||||||
@@ -66,7 +66,7 @@ module_hotfixes=1"
|
|||||||
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
||||||
|
|
||||||
# Check if Node.js version is an LTS version
|
# Check if Node.js version is an LTS version
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
# Repository content for N|Solid
|
# Repository content for N|Solid
|
||||||
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
||||||
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
@@ -88,7 +88,7 @@ if command_exists dnf; then
|
|||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -104,7 +104,7 @@ elif command_exists yum; then
|
|||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -119,7 +119,7 @@ elif command_exists microdnf; then
|
|||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ rm -f /etc/yum.repos.d/nodesource*.repo
|
|||||||
log "Old repositories removed" "info"
|
log "Old repositories removed" "info"
|
||||||
|
|
||||||
# Define Node.js version
|
# Define Node.js version
|
||||||
NODE_VERSION="22.x"
|
NODE_VERSION="24.x"
|
||||||
|
|
||||||
# Get system architecture
|
# Get system architecture
|
||||||
SYS_ARCH=$(uname -m)
|
SYS_ARCH=$(uname -m)
|
||||||
@@ -66,7 +66,7 @@ module_hotfixes=1"
|
|||||||
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null
|
||||||
|
|
||||||
# Check if Node.js version is an LTS version
|
# Check if Node.js version is an LTS version
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
# Repository content for N|Solid
|
# Repository content for N|Solid
|
||||||
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
NSOLID_REPO_CONTENT="[nodesource-nsolid]
|
||||||
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH
|
||||||
@@ -88,7 +88,7 @@ if command_exists dnf; then
|
|||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -104,7 +104,7 @@ elif command_exists yum; then
|
|||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated." "info"
|
log "Repository is configured and updated." "info"
|
||||||
log "You can use N|solid Runtime as a node.js alternative" "info"
|
log "You can use N|solid Runtime as a node.js alternative" "info"
|
||||||
@@ -119,7 +119,7 @@ elif command_exists microdnf; then
|
|||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs"
|
||||||
|
|
||||||
# Update N|Solid repository if it's LTS
|
# Update N|Solid repository if it's LTS
|
||||||
if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then
|
if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then
|
||||||
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid"
|
||||||
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user