Install Yarn Ubuntu 16.04 (Linux Mint 18.1)
I have a new installation of Linux Mint 18.1 with Ubuntu 16.04. I have installed Node 6.10.0.
When doing the command that indicates the documentation of Yarn:
sudo apt-get update && sudo apt-get install yarn
It says "could not find yarn package"
I must do something else, because in the documentation I do not see anything about it.
Thank you.
On Ubuntu Linux, you can install Yarn via Debian package repository. You will first need to configure the repository:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Then you can simply:
sudo apt-get update && sudo apt-get install yarn
More information here
I was unable to install Yarn on Ubuntu 16.04 using the accepted answer but found it easy with npm:
npm install -g yarn
Then check install / version with
yarn --version
See on Installation | Yarn | Linux tab
There are instructions for several linux distributions
Here are more details about the official install instruction.
apt-key
command gets the public authentication key for software integration check.deb https://dl.yarnpkg.com/debian/ stable main
is the Ubuntu repository containingyarn
. Look at OP's screenshot, the top 10 lines list existing repositories to search for packages, but there is no yarn's one. So we need to add the repository by creating file/etc/apt/sources.list.d/yarn.list
.After the above two steps, issue
apt
/apt-get
command to addyarn
like usual Ubuntu packages.
Be careful when using &&
. I get the same error when running sudo apt-get update
, which prevents terminal from running sudo apt-get install yarn
. I was able to successfully install yarn on Ubuntu 16.04 by running these commands separately (without using &&
)