Distributions: Ubuntu 18.04 installs 8.x from main repos instead of 6.x from nodesource

Created on 4 May 2018  路  3Comments  路  Source: nodesource/distributions

When I setup the 6.x nodesource repo it installs the 8.x "latest" from the main repos. While not a huge problem, I expected nodesource's node which includes npm.

I can't install node 6.x without specifying the version, which isn't horrible (I'm using salt and it's easy), but it's not what I expected.

Most helpful comment

If you add the following to your /etc/apt/preferences file you can prioritize whatever nodesource repos you have setup over the existing main ubuntu ones

Package: *
Pin: origin deb.nodesource.com
Pin-Priority: 600

Verify it's picking the right nodejs by using apt-cache policy nodejs.

If you already have a newer version installed from the Ubuntu repo apt-get remove it first and then just try to apt-get install nodejs.

All 3 comments

If you add the following to your /etc/apt/preferences file you can prioritize whatever nodesource repos you have setup over the existing main ubuntu ones

Package: *
Pin: origin deb.nodesource.com
Pin-Priority: 600

Verify it's picking the right nodejs by using apt-cache policy nodejs.

If you already have a newer version installed from the Ubuntu repo apt-get remove it first and then just try to apt-get install nodejs.

Yeah, there's really no way around that, that's just how apt works. We actually didn't mean to ever make 6.x packages for 18.04 but it looks like we did by accident. The pinning solution @0xCMP recommends is the best way to handle this that I know of.

Two minor suggestions: Limit the pinning to the nodejs package and create a separate file.

For example, in /etc/apt/preferences.d/nodesource:

Package: nodejs
Pin: origin deb.nodesource.com
Pin-Priority: 600

I鈥檝e also opened pull request https://github.com/nodesource/distributions/pull/684 to add an FAQ entry regarding this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xNarkon picture xNarkon  路  3Comments

thameemk612 picture thameemk612  路  3Comments

SammariAhmed picture SammariAhmed  路  5Comments

alexcleu picture alexcleu  路  3Comments

AJCStriker picture AJCStriker  路  5Comments