• 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 Package Manager on Rocky Linux 9.2

  • 00:30 Cat /etc/os-release
  • 00:47 curl -sL https://rpm.nodesource.com/setup_16.x | bash -
  • 01:05 dnf install nodejs
  • 01:44 node -v
  • 01:55 npm -v
  • 02:12 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
  • 02:23 sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
  • 02:23 sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
  • 02:23 sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
  • 02:32 dnf install yarn
  • 02:53 yarn -v
{{postValue.id}}

To Install Yarn Package Manager On Rocky Linux 9.2

Introduction:

YARN, short for Yet Another Resource Navigator, is a fast, stable, and reliable Javascript package manager that is compatible with npm ( Node Package Manager). Yarn helps with the management of npm packages which includes installation, updating, configuration, and removal of packages.

Installation Steps:

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

[root@Linuxhelp ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"

Step 2: Add the NodeSource repository by using the below command.

[root@Linuxhelp ~]# curl -sL https://rpm.nodesource.com/setup_16.x | bash -

================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================

                          SCRIPT DEPRECATION WARNING                    
 The NodeSource Node.js Linux distributions GitHub repository contains
 information about which versions of Node.js and which Linux distributions
 are supported and how to install it.
 https://github.com/nodesource/distributions

                         SCRIPT DEPRECATION WARNING

TO AVOID THIS WAIT MIGRATE THE SCRIPT
Continuing in 60 seconds (press Ctrl-C to abort) ...


## Installing the NodeSource Node.js 16.x repo...


## Inspecting system...

+ uname -m
rocky-release-9.2-1.6.el9.noarch
exec redhat-release
Release package: rocky-release-9.2-1.6.el9.noarch

## Confirming "el9-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_16.x/el/9/x86_64/nodesource-release-el9-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.jCLolm22K2' 'https://rpm.nodesource.com/pub_16.x/el/9/x86_64/nodesource-release-el9-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.jCLolm22K2'

## Cleaning up...

+ rm -f '/tmp/tmp.jCLolm22K2'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 16.x and npm.
## You may run dnf if yum is not available:
    sudo dnf install -y nodejs
## You may also need development tools to build native addons:
    sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
    curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
    sudo yum install yarn

Step 3: Next, install the latest Node.js version by using the below command

[root@Linuxhelp ~]# dnf install nodejs
Node.js Packages for Enterprise Linux 9 - x86_64                                   452 kB/s | 280 kB     00:00    
Rocky Linux 9 - BaseOS                                                             4.4 kB/s | 4.1 kB     00:00    
Rocky Linux 9 - AppStream                                                          4.8 kB/s | 4.5 kB     00:00    
Rocky Linux 9 - Extras                                                             3.9 kB/s | 2.9 kB     00:00    
Dependencies resolved.
===================================================================================================================
Package               Architecture          Version                               Repository                 Size
===================================================================================================================
Installing:
nodejs                x86_64                2:16.20.2-1nodesource                 nodesource                 32 M

Transaction Summary
===================================================================================================================
Install  1 Package

Total download size: 32 M
Installed size: 89 M
Is this ok [y/N]: y
Downloading Packages:
nodejs-16.20.2-1nodesource.x86_64.rpm                                               20 MB/s |  32 MB     00:01    
-------------------------------------------------------------------------------------------------------------------
Total                                                                               20 MB/s |  32 MB     00:01     
Node.js Packages for Enterprise Linux 9 - x86_64                                   1.6 MB/s | 1.6 kB     00:00    
Importing GPG key 0x34FA74DD:
Userid     : "NodeSource <gpg-rpm@nodesource.com>"
Fingerprint: 2E55 207A 95D9 944B 0CC9 3261 5DDB E8D4 34FA 74DD
From       : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Is this ok [y/N]: y
Key imported successfully
Transaction test succeeded.
Running transaction
 Preparing        :                                                                                           1/1 
 Running scriptlet: nodejs-2:16.20.2-1nodesource.x86_64                                                       1/1 
 Installing       : nodejs-2:16.20.2-1nodesource.x86_64                                                       1/1 
 Running scriptlet: nodejs-2:16.20.2-1nodesource.x86_64                                                       1/1 
 Verifying        : nodejs-2:16.20.2-1nodesource.x86_64                                                       1/1 

Installed:
 nodejs-2:16.20.2-1nodesource.x86_64                                                                              

Complete!

Step 4: Verify the installed Node.js version by using the below command

[root@Linuxhelp ~]# node -v
v16.20.2

Step 5: To verify the NPM version, by using the below command

[root@Linuxhelp ~]# npm -v
8.19.4

Step 6: By default, Yarn is not available on Rocky Linux 9 base repository. Now run the below command to add the Yarn repository to your system.

[root@Linuxhelp ~]# curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
[yarn]
name=Yarn Repository
baseurl=https://dl.yarnpkg.com/rpm/
enabled=1
gpgcheck=1
gpgkey=https://dl.yarnpkg.com/rpm/pubkey.gpg
[root@Linuxhelp ~]# rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg

Step 7: After the repository has been successfully added, we can install Yarn by using the below command

[root@Linuxhelp ~]# dnf install yarn
Yarn Repository                                                                    436 kB/s | 316 kB     00:00    
Dependencies resolved.
===================================================================================================================
 Package                  Architecture               Version                        Repository                Size
===================================================================================================================
Installing:
 yarn                     noarch                     1.22.19-1                      yarn                     1.2 M

Transaction Summary
===================================================================================================================
Install  1 Package

Total download size: 1.2 M
Installed size: 5.1 M
Is this ok [y/N]: y
Downloading Packages:
yarn-1.22.19-1.noarch.rpm                                                          1.9 MB/s | 1.2 MB     00:00    
-------------------------------------------------------------------------------------------------------------------
Total                                                                              1.9 MB/s | 1.2 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                           1/1 
  Installing       : yarn-1.22.19-1.noarch                                                                     1/1 
  Verifying        : yarn-1.22.19-1.noarch                                                                     1/1 
Installed:
  yarn-1.22.19-1.noarch                                                                                            
Complete!

Step 8: Now we can check the Yarn version 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 Package Manager on Rocky Linux Debian 9.2. Your feedback is much welcome.

Tags:
michael
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is Yarn Package Manager?

A

Yarn is a JavaScript package manager that serves as an alternative to npm (Node Package Manager). It was developed by Facebook, Google, Exponent, and Tilde. Yarn is designed to be fast, reliable, and secure when installing and managing JavaScript packages.

Q

How do I check if Yarn is installed?

A

After installing Yarn, you can check the version to confirm the installation. Open a terminal and run:
yarn –version

Q

How do I use Yarn to install packages?

A

Once you have installed Yarn, you can use it to install packages by running the following command:
yarn add

Q

How do I create a new project with Yarn?

A

To create a new project, navigate to the desired directory in your terminal and run:
yarn init

Q

How do I remove a package with Yarn?

A

To remove a package from your project, you can run the following command:
yarn remove

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 Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

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.