In this article you will learn how to install Yarn on Ubuntu 20.04 Focal Fossa Linux

In this tutorial you will learn:
  • How to add Yarn repository
  • How to install Yarn
Yarn on Ubuntu 20.04 Focal Fossa Linux
Yarn on Ubuntu 20.04 Focal Fossa Linux

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed or upgraded Ubuntu 20.04 Focal Fossa
Software Yarn
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

Install Yarn on Ubuntu 20.04 step by step instructions

  1. Add Yarn repository by executing the below commands:
    $ sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    $ sudo sh -c "echo 'deb https://dl.yarnpkg.com/debian/ stable main' >> /etc/apt/sources.list"
    
  2. Install Yarn on your system. In case you have already installed Node.js on your Ubuntu 20.04 system you can avoid its installation by:
    $ sudo apt --no-install-recommends install yarn
    
    Otherwise simply executing the below command:
    $ sudo apt install yarn
    
    which will install yarn as well as Node.js from a standard Ubuntu repository.
  3. Check the yarn version:
    $ yarn -v
    
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.