How to Install Yarn on Ubuntu 22.04 LTS

Yarn is a package manager for Node. js that focuses on speed, security, and consistency. It was originally created to address some issues with the popular NPM package manager

In this tutorial, i am going to show you how to install yarn and configure yarn in ubuntu 22.04 machine.

How to Install Yarn on Ubuntu 22.04 LTS

Follow the below given steps to install yarn on ubuntu 22.04 machine:

  • Step 1: Update system repositories
  • Step 2: Install CURL on Ubuntu 22.04
  • Step 3: Import Yarn GPG key
  • Step 4: Enable Yarn repository
  • Step 5: Install Yarn on Ubuntu 22.04
  • Step 6: Check Yarn version

Step 1: Update system repositories

Press “CTRL+ALT+T” to open the terminal of the Ubuntu 22.04.

After that, run the following command to update system repositories:

sudo apt update<span id="more-59779"></span>

Step 2: Install CURL on Ubuntu 22.04

Run the following command for CURL installation; as follow:

sudo apt install curl

Step 3: Import Yarn GPG key

Run the following command to importing the Yarn GPG key to Ubuntu system repositories:

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

Step 4: Enable Yarn repository

Run the following command to enable the Yarn repository on Ubuntu 22.04 system:

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Step 5: Install Yarn on Ubuntu 22.04

Run the following command to install Yarn installation; as follow:

sudo apt install yarn

Step 6: Check Yarn version

Run the following command to check its installed version on your Ubuntu 22.04 system:

yarn --version

Conclusion

In this tutorial, i have shown to you how to install yarn and configure yarn in ubuntu 22.04 machine.

More Tutorials

Leave a Comment