Install Yarn on Linux Mint 20 - A step by step guide ?

Linux Users needs an automated tool to manage the project or application dependencies. Yarn is the most popular secure and reliable JavaScript package and dependency management tool. It is an open-source and fast package manager that keeps the cache of each downloaded package and you can again use this package when it is required without downloading the package again.  Yarn checks the integrity of each package before its code execution. The main feature of yarn is its efficiency so that this tool works offline as well as in the network.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Linux application queries.

In this context, we shall look into how to install the Yarn dependency package manager on Linux Mint 20 distribution. 

If you need to perform this Installation on Ubuntu, then have a look at our guide on how to install Yarn on Ubuntu 20.04 system.


Steps to Install Yarn on Linux Mint 20 

Yarn is not available in the default official Linux Mint repository. However, this package manager can install it by including an external official yarn repository to your system. For yarn installation using its official repository, perform the below-given steps. 


1. Install Curl

To begin, open the terminal from your system's taskbar. Now, by running the following command update the apt-cache:

$ sudo apt update

Curl comes pre-installed on Linux Mint 20 distribution. However, if curl utility is not installed on your LinuxMint system then, you can easily install by executing the below-mentioned command:

$ sudo apt install curl


2. Import the official yarn repository's GPG key

Now, import or add the Yarn repository's GPG key on your system by running the below-given command:

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

In case of successful completion, the 'OK' message will display on the terminal its meaning that the key is imported successfully.


3. Add Yarn repository

Enable and add the official yarn repository by using the below-mentioned command:

$ echo "deb https://dl.yarnpkg.com/debian/ stable main" |
sudo tee /etc/apt/sources.list.d/yarn.list


4. Install Yarn

Again, update the apt packages cache and type the following command to install the yarn on Linux Mint 20:

$ sudo apt update
$ sudo apt install yarn

Now, the user confirmation dialog prompts you to enter 'y' and then press 'Enter' to confirm the installation of yarn packages on your system. The yarn packages including NodeJS will install on your system. If you don't need to install the NodeJS package then, install yarn using an alternate command as follows:

$ sudo apt install --no-install-recommends yarn

This command will install the all yarn packages without installing NodeJS on your system.


5. Verify yarn Installation

Run the below command to Verify the yarn installation by displaying the installed version on the terminal window:

$ yarn --version

This will display the yarn version installed on this system.


How to Uninstall Yarn packages from Linux Mint 20 ?

If You don't need the yarn application on your system and want to uninstall it from your system then, using the following command can completely remove the yarn packages from your Linux Mint or Ubuntu system:

$ sudo apt purge --remove yarn

To complete the uninstallation process, simply press 'Y' and then hit 'Enter'.


[Need assistance in fixing missing Linux Software packages ? We can help you. ]

This article covers how to install yarn on Linux Mint 20 distribution using the command line method. In fact, Yarn is a JavaScript package and dependency management tool that helps users to automate the tasks of installing, updating, removing, and configuring NPM packages. It is a good dependency package manager that is very helpful for experienced developers as well as for learners. 


How to Remove Yarn from Linux Mint 20 ?

If you no longer require Yarn and want to remove it from your Linux Mint 20 system, then it is very easy and straightforward to remove.

Issue the following command in the terminal to remove Yarn completely from your system:

$ sudo apt remove--autoremove yarn

Related Posts