Merge commit 'af2e9d27dfe18a95554879982b11e2f6c421b4b8' into debian

This commit is contained in:
2025-12-07 18:15:02 -05:00
29 changed files with 2140 additions and 1635 deletions
@@ -24,7 +24,7 @@ Each script in this repository performs the following steps:
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.
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.
@@ -42,13 +42,13 @@ check_os() {
install_pre_reqs() {
log "Installing pre-requisites" "info"
# Run 'apt-get update'
if ! apt-get update -y; then
handle_error "$?" "Failed to run 'apt-get update'"
# Run 'apt update'
if ! apt update -y; then
handle_error "$?" "Failed to run 'apt update'"
fi
# Run 'apt-get install'
if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then
# Run 'apt install'
if ! apt install -y apt-transport-https ca-certificates curl gnupg; then
handle_error "$?" "Failed to install packages"
fi
@@ -75,8 +75,8 @@ configure_repo() {
local node_version=$1
arch=$(dpkg --print-architecture)
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then
handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported."
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
@@ -91,14 +91,14 @@ configure_repo() {
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-get update'
if ! apt-get update -y; then
handle_error "$?" "Failed to run 'apt-get update'"
# 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-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 "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
}
@@ -25,7 +25,7 @@ if [ ! -f "$base_script" ]; then
fi
# List of versions
versions=("18" "20" "22" "23" "24")
versions=("23" "24" "25")
# Iterate over the versions and create scripts
for version in "${versions[@]}"; do
@@ -33,8 +33,8 @@ for version in "${versions[@]}"; do
done
# Define LTS and current Node.js versions
lts_version="22"
current_version="24"
lts_version="24"
current_version="25"
# Create setup_lts and setup_current scripts
create_script "$lts_version" "lts"