How to install Yarn in Ubuntu 22.04
To Install Yarn In Ubuntu 22.04
Introduction
Yarn is an open-source and freely available package manager that is used to manage JavaScript runtime environments. It provides an efficient package management experience. It simplifies the process of installing, updating, managing, and uninstalling npm packages through automation. With advanced features such as package caching and parallel processing, Yarn significantly speeds up the installation process.
procedure Step
Step 1: Check the OS version by using the below command
root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
Step 2: Before install the yarn, need to update the repository by using the below command
root@linuxhelp:~# apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1,303 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,519 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/main i386 Packages [436 kB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [233 kB]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1,616 kB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [271 kB]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [852 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [602 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [293 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1,648 kB]
Get:15 http://security.ubuntu.com/ubuntu jammy-security/universe i386 Packages [599 kB]
Get:16 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [163 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu jammy-updates/restricted i386 Packages [35.2 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [275 kB]
Get:19 http://in.archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [698 kB]
Get:20 http://in.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,060 kB]
Get:21 http://in.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [241 kB]
Get:22 http://in.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [49.6 kB]
Get:23 http://in.archive.ubuntu.com/ubuntu jammy-updates/multiverse i386 Packages [6,028 B]
Get:24 http://in.archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [12.0 kB]
Get:25 http://in.archive.ubuntu.com/ubuntu jammy-backports/main i386 Packages [59.2 kB]
Get:26 http://in.archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.1 kB]
Get:27 http://in.archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.0 kB]
Get:28 http://in.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.4 kB]
Get:29 http://in.archive.ubuntu.com/ubuntu jammy-backports/universe i386 Packages [17.2 kB]
Get:30 http://in.archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.2 kB]
Fetched 12.4 MB in 14s (918 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
276 packages can be upgraded. Run 'apt list --upgradable' to see them.
Step 3: Now check if the curl is installed or not by using the below command
root@linuxhelp:~# curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
Step 4: Now import the Yarn GPG key on Ubuntu machine by using the below command
root@linuxhelp:~# curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Step 5: After importing activate the Yarn repository on Ubuntu machine 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 6: Now simply run the apt install command to install yarn packet manager by using the below command
root@linuxhelp:~# apt install yarn -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'cmdtest' instead of 'yarn'
The following packages were automatically installed and are no longer required:
libflashrom1 libftdi1-2 libllvm13
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
python3-cliapp python3-markdown python3-pygments python3-ttystatus
Suggested packages:
python-markdown-doc python-pygments-doc ttf-bitstream-vera
The following NEW packages will be installed:
cmdtest python3-cliapp python3-markdown python3-pygments python3-ttystatus
0 upgraded, 5 newly installed, 0 to remove and 276 not upgraded.
Need to get 899 kB of archives.
After this operation, 4,875 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-cliapp all 1.20180812.1-4 [44.5 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 python3-markdown all 3.3.6-1 [68.5 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-ttystatus all 0.38-4 [14.7 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 cmdtest all 0.32.14.gcdfe14e-2 [21.9 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 python3-pygments all 2.11.2+dfsg-2 [750 kB]
Fetched 899 kB in 2s (371 kB/s)
Selecting previously unselected package python3-cliapp.
(Reading database ... 210545 files and directories currently installed.)
Preparing to unpack .../python3-cliapp_1.20180812.1-4_all.deb ...
Unpacking python3-cliapp (1.20180812.1-4) ...
Selecting previously unselected package python3-markdown.
Preparing to unpack .../python3-markdown_3.3.6-1_all.deb ...
Unpacking python3-markdown (3.3.6-1) ...
Selecting previously unselected package python3-ttystatus.
Preparing to unpack .../python3-ttystatus_0.38-4_all.deb ...
Unpacking python3-ttystatus (0.38-4) ...
Selecting previously unselected package cmdtest.
Preparing to unpack .../cmdtest_0.32.14.gcdfe14e-2_all.deb ...
Unpacking cmdtest (0.32.14.gcdfe14e-2) ...
Selecting previously unselected package python3-pygments.
Preparing to unpack .../python3-pygments_2.11.2+dfsg-2_all.deb ...
Unpacking python3-pygments (2.11.2+dfsg-2) ...
Setting up python3-ttystatus (0.38-4) ...
Setting up python3-cliapp (1.20180812.1-4) ...
Setting up python3-pygments (2.11.2+dfsg-2) ...
Setting up python3-markdown (3.3.6-1) ...
Setting up cmdtest (0.32.14.gcdfe14e-2) ...
Processing triggers for man-db (2.10.2-1) ...
Step 7: Now check the yarn version by using the below command
root@linuxhelp:~# yarn --version
0.32+git
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to installation of Yarn on Ubuntu 22.04. Your feedback is much welcome.
Comments ( 0 )
No comments available