Hello,
For those who use debian pinning it would be nice to had a note in the README concerning the package release.
A pretty advanced search brought me to add the following lines to my apt/preferences:
Package: *
Pin: release o=Node source,l=Node source
Pin-Priority: 1001
The goal is to add the best score to releases from deb.nodesource.com repositories and download from there.
@bewam you can use origin=deb.nodesource.com too
Package: *
Pin: origin deb.nodesource.com
Pin-Priority: 1001
I'm going to add a new issue to have a different name than {DISTRO} so that one can use the apt-get -t SOURCE install nodejs type command.
@bewam
can you paste output of apt-cache policy nodejs before modifying priorities on an affected system?
@ncouture, I don't see why you're asking.
Nowdays, I don't need debian pinning as nodesource versions are largely advanced compared to distro ones and I almost nullified my PPAs(launchpad repos).
_I was asked for it:_
no pinning, ls /etc/apt/preferences gives a no such file and ls /etc/apt/preferences.d/ gives nothing.
apt-cache policy nodejs
nodejs:
Installed: 6.2.1-1nodesource1~xenial1
Candidate: 6.2.1-1nodesource1~xenial1
Version table:
*** 6.2.1-1nodesource1~xenial1 500
500 https://deb.nodesource.com/node_6.x xenial/main amd64 Packages
100 /var/lib/dpkg/status
4.2.6~dfsg-1ubuntu4 500
500 http://fr.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
EDIT: pasted twice, sorry
I think the @arthurlogilab's solution is the best. I didn't remember about 'origin' but this is really usefull as you don't have to search for the release name.
I tried to install Node.js 8.x on Debian Buster today (yes, I'm aware of the note of it being deprecated and plan to update it right away, but ran into this issue first so I figured I'd come update this to say it's still a problem :sweat_smile: :heart:).
I used the installer from https://deb.nodesource.com/setup_8.x, and followed the recommendation it spits out at the end (## Run `sudo apt-get install -y nodejs` to install Node.js 8.x LTS Carbon and npm), and honestly only noticed that what got installed was Node.js 10.x from Debian's packages because npm didn't get installed thanks to my use of --no-install-recommends.
Here's the output of apt-cache policy nodejs, for reference:
root@c29ff61f843b:/var/www/html# apt-cache policy nodejs
nodejs:
Installed: 10.21.0~dfsg-1~deb10u1
Candidate: 10.21.0~dfsg-1~deb10u1
Version table:
*** 10.21.0~dfsg-1~deb10u1 500
500 http://security.debian.org/debian-security buster/updates/main amd64 Packages
100 /var/lib/dpkg/status
10.19.0~dfsg1-1 500
500 http://deb.debian.org/debian buster/main amd64 Packages
8.17.0-1nodesource1 500
500 https://deb.nodesource.com/node_8.x buster/main amd64 Packages
It would probably be a really good idea for these install scripts to include some APT pinning to ensure nodejs packages only come from the newly added nodesource repo. :sweat_smile:
(Thanks for your work maintaining these!)
Most helpful comment
@bewam you can use origin=deb.nodesource.com too
I'm going to add a new issue to have a different name than {DISTRO} so that one can use the
apt-get -t SOURCE install nodejstype command.