• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install Yarn in Ubuntu 22.04

  • 00:52 lsb_release -a
  • 01:08 apt update
  • 01:52 curl --version
  • 02:09 curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  • 02:26 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  • 02:37 apt install yarn -y
  • 03:31 yarn --version
{{postValue.id}}

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.

Tags:
isaac
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Why do we use yarn?

A

Yarn is a package manager for your code. It allows you to use and share (e.g. JavaScript) code with other developers worldwide.

Q

Which Linux uses yarn?

A

It is recommended to install Yarn via our packages on common Linux distributions such as Debian, Ubuntu, and CentOS.

Q

What is the command to stop yarn?

A

The default directory is /opt/IBM/InformationServer/Server/DSEngine. On the same command line, stop YARN by running the stop-pxyarn.sh script.

Q

What is the yarn command used for?

A

yarn init : initializes the development of a package.

yarn install : installs all the dependencies defined in a package. json file.

yarn publish : publishes a package to a package manager.

Q

How do I remove a yarn module?

A

yarn remove
Running yarn remove foo will remove the package named foo from your direct dependencies updating your package. json and yarn. lock files in the process.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.