0

I was trying to install node into wsl2 (ubuntu 18.04) using binary distribution command:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

enter image description here

But I was getting this error when I run the command and node is not installed on wsl.

possibly this content is related to the error:

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.

by the way I tried couple of commands such as:

sudo apt install libssl1.0-dev
sudo apt install nodejs-dev
sudo apt install node-gyp
sudo apt install npm

sudo apt install aptitude sudo aptitude install libnode-dev
sudo aptitude install libnode64 sudo aptitude install node-gyp sudo aptitude install npm

but none of them was able to solve the problem.

Damika
  • 101
  • 1
    Ubuntu 18.04 LTS reached End of Standard Support earlier this year, and is thus off-topic on this site. You can use ESM/Pro support options (cost maybe involved) if you wish but community support (such as this site) no longer exists, though SE Unix & Linux allow all Ubuntu questions too. Please see https://askubuntu.com/help/on-topic as Canonical provide ESM/Pro services. – guiverc Jan 03 '24 at 08:02
  • 1
    FYI: The oldest libc6 version used by Ubuntu in standard support is 2.31-0ubuntu9.14 currently (which meets the >2.28 requirement in your paste!); you're using a release which ended its five years of standard support last year – guiverc Jan 03 '24 at 08:05
  • I appreciate your help @guiverc. I think using the most recent version, such as Ubuntu 22.04 LTS, is preferable than sticking with Ubuntu 18.04 LTS, which offers support for the following five years. – Damika Jan 03 '24 at 08:52

0 Answers0