How to install Yarn on Linux Debian 11.3

To Install Yarn On Linux Debian 11.3

Introduction:

The yarn is an advanced package management software for Node.js applications that is a fast, secure, and reliable alternative to any other Node.js package managers.

Installation Procedure:

Step 1: Check the version of the OS by using the below command

root@linuxhelp:~# lsb_release –a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
No LSB modules are available.

Step 2: Check the IP address by using the below command

root@linuxhelp:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:f2:4d:6c brd ff:ff:ff:ff:ff:ff
    altname enp2s1
    inet 192.168.6.133/23 brd 192.168.7.255 scope global noprefixroute ens33
       valid_lft forever preferred_lft forever

Step 3: Install the Yarn, then enable the Yarn repository by using the below command

root@LinuxHelp:~# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
OK

Step 4: Once the repository is enabled. Add the yarn repository to the system repository by using the below command

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

Step 5: The repository is added now update and install the yarn by using the below command

root@LinuxHelp:~# sudo apt-get update && sudo apt-get install yarn
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 https://packages.sury.org/php bullseye InRelease
Get:3 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
Hit:4 http://deb.debian.org/debian bullseye InRelease                   
Hit:5 http://deb.debian.org/debian bullseye-updates InRelease
Get:6 https://dl.yarnpkg.com/debian stable/main amd64 Packages [10.9 kB]
Get:7 https://dl.yarnpkg.com/debian stable/main all Packages [10.9 kB]
Fetched 38.9 kB in 2s (23.8 kB/s)     
Reading package lists... Done

Step 6: The yarn is installed then install the packages of the yarn by using the below command

root@LinuxHelp:~# curl -o- -L https://yarnpkg.com/install.sh | bash

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    53  100    53    0     0     91      0 --:--:-- --:--:-- --:--:--    91
100  7152  100  7152    0     0   8627      0 --:--:-- --:--:-- --:--:--  8627
Installing Yarn!
> Downloading tarball...
[1/2]: https://yarnpkg.com/latest.tar.gz --> /tmp/yarn.tar.gz.AwCSX4OIU1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    56  100    56    0     0    513      0 --:--:-- --:--:-- --:--:--   518
100    94  100    94    0     0    267      0 --:--:-- --:--:-- --:--:--   525
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1215k  100 1215k    0     0   571k      0  0:00:02  0:00:02 --:--:-- 9492k

[2/2]: https://yarnpkg.com/latest.tar.gz.asc --> /tmp/yarn.tar.gz.AwCSX4OIU1.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    60  100    60    0     0    909      0 --:--:-- --:--:-- --:--:--   967
100    98  100    98    0     0    899      0 --:--:-- --:--:-- --:--:--   899
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   833  100   833    0     0    505      0  0:00:01  0:00:01 --:--:--  3266
> Verifying integrity...
> Successfully installed Yarn 1.22.19! Please open another terminal where the `yarn` command will

Step 7: Once the package is installed. Now check the version of yarn by using the below command

root@LinuxHelp:~# yarn -v
1.22.19

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Install Yarn on Linux Debian 11.3. Your feedback is much welcome.

FAQ
Q
What is the command to check the version of Yarn?
A
The command is # yarn -v
Q
How do you install Yarn packages on Linux mint?
A
The command is # curl -o- -L https://yarnpkg.com/install.sh | bash
Q
How do you add the yarn repository to the system repository?
A
The command is # echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Q
How do you enable the Yarn Repository?
A
To enable the Yarn Repositor command use # curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Q
What is Yarn software?
A
The yarn is an advanced package management software for Node.js applications. It is a fast, secure, and reliable alternative that any other Nodejs package manager.