Score:1

Installing latest NodeJS on Ubuntu 22.04 via WSL on Windows 11

bl flag

I am in Ubuntu 22.04 via WSL on Windows 11.

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

is returning :

## Installing the NodeSource Node.js 18.x repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 https://apt.releases.hashicorp.com jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:4 https://packages.redis.io/deb jammy InRelease
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Reading package lists... Done
E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 5h 27min 34s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 5h 27min 59s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease is not valid yet (invalid for another 5h 28min 40s). Updates for this repository will not be applied.
Error executing command, exiting
$ sudo head /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_InRelease
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Origin: Ubuntu
Label: Ubuntu
Suite: jammy
Version: 22.04
Codename: jammy
Date: Thu, 21 Apr 2022 17:16:08 UTC
Architectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x

What am I to do ?

$date
Fri Feb 24 04:12:40 IST 2023
Score:0
vn flag

This looks like a clock or timezone issue, similar to this question.

Fri Feb 24 04:12:40 IST 2023

Google tells me that it is currently about 5 pm IST now. Given the time that you posted this (currently 5 hours ago), it should have been around noon your time?

At this point, the issue may have resolved itself (via a WSL<->Windows clock sync) already, but if not, for WSL, try:

  • Confirm that your Windows clock and timezone are correctly set
  • In Ubuntu, sudo hwclock -s
  • Try again

If that doesn't work:

  • From PowerShell, wsl --shutdown
  • Reboot the Windows host
  • Try again

Also see WSL2 Clock is out of sync with Windows on Stack Overflow for some historical information on this.

anjanesh avatar
bl flag
`sudo hwclock -s` solved the problem.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.