Title: Retrofitting Node 20 in Ubuntu 18 LTS
Author: Immanuel Raj
Published: April 17, 2024
Last modified: February 15, 2025

---

![Install Node Ubuntu](https://immanuelraj.dev/wp-content/uploads/2024/04/Retrofitting-
Node-20-in-Ubuntu-18-LTS.avif)

# Retrofitting Node 20 in Ubuntu 18 LTS

[April 17, 2024](https://immanuelraj.dev/retrofitting-node-v20-12-2-and-npm-v10-5-0-in-ubuntu-18-04-3-lts/)

—

by

[Immanuel Raj](https://immanuelraj.dev/author/iamimmanuelraj/)

in [Linux](https://immanuelraj.dev/category/linux/)

Read Time

2–3 minutes

One of the hardest parts of system administration is keeping systems updated and
secure. However, when an upgrade is not feasible but application support is needed,
there’s often no choice but to retrofit the necessary dependencies. This may involve
tinkering with the system, patching, or using custom configurations to ensure the
application works without breaking other systems or the OS itself.

In this guide, we will explore how to install Node.js 20 on Ubuntu 18.04 LTS, along
with npm 10, using Node Version Manager (NVM) to streamline the process. By retrofitting
Node.js 20 on an older version of Ubuntu, we can ensure compatibility without the
need for a full OS upgrade, which may not always be practical in production environments.

To ease up things and to have less headache we will be using [NVM (Node Version Manager](https://github.com/nvm-sh/nvm))
to make it easier to install node and npm.

To ease things up, NVM will help manage the Node.js and npm versions required, making
the installation smoother and reducing the potential for conflicts.

## Why on Ubuntu 18.04?

As applications evolve, newer versions of tools like Node.js introduce better performance,
enhanced security features, and new functionality. However, upgrading the entire
operating system to support the latest versions isn’t always an option, especially
in cases where legacy applications or system constraints exist. Ubuntu 18.04 LTS,
being a stable and widely-used release, may still be part of many production systems.
This guide helps maintain compatibility by retrofitting Node.js 20 into your environment
without breaking other dependencies.

Now, let’s dive into retrofitting on Ubuntu 18.04.3 LTS.

**What You Need**

Before we get started, here are a few things you will need

 * Root access on your system
 * Node
 * NPM
 * Some essential build tools like make, gcc, and bison

Run the following commands to install the necessary build tools and dependencies

    ```wp-block-code
    sudo apt-get install g++ make gcc bison patchelf
    ```

    ```wp-block-code
    wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
    ```

    ```wp-block-code
    tar -zxf glibc-2.28.tar.gz
    ```

    ```wp-block-code
    cd glibc-2.28
    ```

    ```wp-block-code
    mkdir glibc-build && cd glibc-build
    ```

    ```wp-block-code
    ../configure --prefix=/opt/glibc-2.28
    ```

    ```wp-block-code
    make && make install
    ```

    ```wp-block-code
    patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-x86-64.so.2 --set-rpath /opt/glibc-2.28/lib/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/ /root/.nvm/versions/node/v20.12.2/bin/node
    ```

**This will fix the following issue **

> `node: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.28' not found (required
> by node)`

## Conclusion

By following these steps, you can successfully retrofit . Using NVM simplifies managing
versions, and the manual GLIBC patch ensures compatibility without the need for 
a full OS upgrade. This approach allows you to keep your system stable while still
using the latest version of Node.js for your applications.

[Node](https://immanuelraj.dev/tags/node/)

[Previous:  Fail2Ban – SSH, WordPress[ee] and Cloudflare](https://immanuelraj.dev/fail2ban-ssh-wordpressee-and-cloudflare/)

[Next:  Automating Flask Deployment Using Docker and Github Actions](https://immanuelraj.dev/automating-flask-deployment-using-docker-and-github-actions/)

![Immanuel Raj Avatar](https://secure.gravatar.com/avatar/88db6e1fa27cf854075acbaa156189ace30cf3701b2d8640cd774280ead1d4d3?
s=80&d=mm&r=g)

## About the author

Software Developer & Technology Consultant

---

## Popular Categories

 * [Bible](https://immanuelraj.dev/category/bible/) (1)
 * [Cloudflare](https://immanuelraj.dev/category/cloudflare/) (1)
 * [Databases](https://immanuelraj.dev/category/databases/) (1)
 * [Docker](https://immanuelraj.dev/category/docker/) (1)
 * [Email](https://immanuelraj.dev/category/email/) (1)
 * [ERPNext](https://immanuelraj.dev/category/erpnext/) (3)
 * [Frappe](https://immanuelraj.dev/category/frappe/) (2)
 * [Github Actins](https://immanuelraj.dev/category/github-actins/) (1)
 * [God](https://immanuelraj.dev/category/god/) (1)
 * [Google Cloud](https://immanuelraj.dev/category/gcp/) (1)
 * [Hosting](https://immanuelraj.dev/category/hosting/) (2)
 * [Life](https://immanuelraj.dev/category/life/) (1)
 * [Linux](https://immanuelraj.dev/category/linux/) (13)
 * [ML](https://immanuelraj.dev/category/ml/) (1)
 * [Networking](https://immanuelraj.dev/category/networking/) (2)
 * [Security](https://immanuelraj.dev/category/security/) (2)
 * [Self Hosting](https://immanuelraj.dev/category/self-hosting/) (7)
 * [SSL](https://immanuelraj.dev/category/ssl/) (3)
 * [Terminal](https://immanuelraj.dev/category/terminal/) (1)
 * [Tools](https://immanuelraj.dev/category/tools/) (2)
 * [Uncategorized](https://immanuelraj.dev/category/uncategorized/) (8)
 * [Web](https://immanuelraj.dev/category/web/) (2)
 * [WordPress](https://immanuelraj.dev/category/wordpress/) (1)

---

## Useful Links

Links I found useful and wanted to share.

 * [Sponsor Me](https://github.com/sponsors/iamimmanuelraj)

---

## Search the website

Search