I've seen this question: How to only install updates from a specific repository? but it doesn't help.
I want to install NPM using this script: https://deb.nodesource.com/setup_10.x (not my idea, this is a requirement). This script uses a particular Launchpad PPA: ppa:chris-lea/node.js
. Here's the problem:
- If I run
apt-get install --no-install-recommends nodejs
I get Node.js installed from Canonical's PPA. This package lacks NPM, and is very far behind Node's last stable release (3 major versions behind). - If I run
apt-get install nodejs
, I do get Node fromcris-lea
PPA, and it has NPM... but it also installs a ton of unnecessary garbage.
Looking into documentation for apt-get install
I cannot find a way to specify a PPA to install from. Maybe I've missed it?
PS. This should happen during CI run, so, no GUI, and, please, no editing of /etc/apt/sources
and friends, please.
sh
instead of Bash, and mypipefail
settings didn't work, and some other thing prevented this PPA from being added. So, I got original Node.js both times, except when it didn't have recommends, there was no NPM either. – wvxvw Jul 08 '19 at 11:22sudo apt-get install package=version
see https://askubuntu.com/questions/92019/how-to-install-specific-ubuntu-packages-with-exact-version – doug Jul 08 '19 at 22:52