Install Yarn on Ubuntu 20.04 step-by-step instructions
Yarn Installation using the Ubuntu repository
- Install the
yarnpkg
package:$ sudo apt install yarnpkg
- Check the yarn version:
$ yarnpkg --version 1.22.4
Yarn Installation using the official Yarn repository
- Add Yarn repository by executing the below commands:
$ sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - $ sudo sh -c "echo 'deb https://dl.yarnpkg.com/debian/ stable main' >> /etc/apt/sources.list" $ sudo apt update
- Install Yarn on your system. In case you have already installed Node.js on your Ubuntu 20.04 system you can avoid its installation by:
$ sudo apt --no-install-recommends install yarn
Otherwise, simply execute the below command:
$ sudo apt install yarn
which will install
yarn
as well as Node.js from the standard Ubuntu repository. - Check the
yarn
version:$ yarn --version