Install via npm
It is recommended to install Yarn through the npm package manager, which comes bundled with Node.js when you install it on your system.
Once you have npm installed you can run the following both to install and upgrade Yarn:
[root@us-common-sre-jenkins-1 ~]# npm install --global yarn changed 1 package, and audited 2 packages in 490ms found 0 vulnerabilities
[root@us-common-sre-jenkins-1 ~]# yarn --version 1.22.19