Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 18.04 installs 8.x from main repos instead of 6.x from nodesource #657

Closed
chrisportela opened this issue May 4, 2018 · 3 comments

Comments

@chrisportela
Copy link

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.

@chrisportela chrisportela changed the title Ubuntu installs 8.x from main repos instead of 6.x from nodesource Ubuntu 18.04 installs 8.x from main repos instead of 6.x from nodesource May 4, 2018
@chrisportela
Copy link
Author

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.

@chrislea
Copy link
Contributor

chrislea commented May 4, 2018

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.

@sonicdoe
Copy link
Contributor

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’ve also opened pull request #684 to add an FAQ entry regarding this issue.

chrislea added a commit that referenced this issue Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants