Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facing issue to install node js

I am facing an issue when trying to install nodejs. When checking the error it requires to upgrade libc6 but I cannot find any way to upgrade libc6 for Ubuntu 18.04.

The old nodejs version I have already uninstalled it with the following commands

sudo apt-get remove nodejs
sudo apt-get remove npm

Issue

    sudo apt-get install -y nodejs
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     nodejs : Depends: libc6 (>= 2.28) but 2.27-3ubuntu1.6 is to be installed
    E: Unable to correct problems, you have held broken packages.

I have gone through these link & link2 & link3 but I didn't get any help

like image 579
Aniket Tiwari Avatar asked May 15 '26 06:05

Aniket Tiwari


1 Answers

I have fixed the issue by using an older version of the node. To fix the issue permanently it requires Ubuntu upgrade

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs 
like image 56
Aniket Tiwari Avatar answered May 18 '26 04:05

Aniket Tiwari