{"id":26543,"date":"2024-05-03T05:24:25","date_gmt":"2024-05-03T05:24:25","guid":{"rendered":"https:\/\/linuxways.net\/?p=26543"},"modified":"2024-05-03T05:24:25","modified_gmt":"2024-05-03T05:24:25","slug":"install-yarn-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/install-yarn-ubuntu-24-04\/","title":{"rendered":"How to Install Yarn on Ubuntu 24.04"},"content":{"rendered":"<p>For building any web server or any other application that will require internet access to function mostly javascript is used as a scripting language along with Node.js runtime environment. Further to add any functionalities to such applications or web servers a package manager is required. There are two package managers named node package manager (npm) and yarn (yet another resource navigator) used for this purpose.<\/p>\n<p>Yarn is usually preferred by most of users for several reasons, it is supported on different operating systems including the newly released Ubuntu 24.04. This guide is about the installation of the yarn javascript package manager on Ubuntu 24.04.<\/p>\n<p><strong>Outline:<\/strong><\/p>\n<ul>\n<li><a href=\"#post-26543-_ynjmlua82hlo\">How to Install Yarn on Ubuntu 24.04<\/a>\n<ul>\n<li><a href=\"#post-26543-_mbzf5i7l8bm4\">Through Yarn Repository<\/a><\/li>\n<li><a href=\"#post-26543-_226wm1usmwv9\">Through Node Package Manager<\/a><\/li>\n<li><a href=\"#post-26543-_sr03y4eib7l6\">Through Corepack<\/a><\/li>\n<li><a href=\"#post-26543-_qsu4l864yvg5\">Through Installation Script<\/a><\/li>\n<li><a href=\"#post-26543-_agiadsb8bc0f\">How to Change the Yarn Version on Ubuntu 24.04<\/a><\/li>\n<li><a href=\"#post-26543-_hvbxwaam7pli\">How to Remove Yarn from Ubuntu 24.04<\/a><\/li>\n<li><a href=\"#post-26543-_lnawuojh6w61\">Conclusion<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><a id=\"post-26543-_ynjmlua82hlo\"><\/a>How to Install Yarn on Ubuntu 24.04<\/h2>\n<p>Yarn is an open-source package manager specifically used for managing javascript project dependencies. Just like the Ubuntu package manager, it serves the purpose of streamlining the process of installing, updating, configuring, and removing package dependencies.<\/p>\n<p>Yarn offers various features which include workspaces, offline caching, and parallel installs which result in improvements in speed, reliability, and security. These features make it preferable when compared with the node package manager, to Install yarn on Ubuntu 24.04 there are four ways:<\/p>\n<h2><a id=\"post-26543-_mbzf5i7l8bm4\"><\/a>1: Through Yarn Repository<\/h2>\n<p>Installing an application on Ubuntu 24.04 via the application repository is beneficial in two cases one if the application package is not present in apt or the version of the package in apt is old. For yarn, the second case is true so to install a relatively newer version use its official repository. Yarn comes with three types of versions which are:<\/p>\n<ul>\n<li><strong>Stable:<\/strong> This version comes with the least bugs and issues, it comes with reliable dependency management, checksum for installed packages, and fast installation due to cached packages.<\/li>\n<li><strong>Release Candidate<\/strong>: This is a pre-release version that will precede the stable version release, it is used for testing new features, and errors or bugs can be expected.<\/li>\n<li><strong>Nightly: <\/strong>This version is built from the latest yarn source code or in other words its the developmental version.<\/li>\n<\/ul>\n<p>To install any of the three using the add repository method you have to add the yarn repository for the respective yarn version. Here. for illustration, I have added the repository for the developmental version which is the nightly version. First, I have added the GPG key for yarn and the command for all of the versions will be the same:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-sS<\/span> https:<span class=\"sy0\">\/\/<\/span>dl.yarnpkg.com<span class=\"sy0\">\/<\/span>debian<span class=\"sy0\">\/<\/span>pubkey.gpg <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-key add<\/span> -<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"206\" class=\"wp-image-26554\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-1.png 762w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-1-300x81.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/p>\n<p>Now fetch the yarn repository and save it in sources.list directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb https:\/\/nightly.yarnpkg.com\/debian\/ nightly main&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>yarn.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"167\" class=\"wp-image-26574\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-2.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-2-300x66.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>To apply the changes or to successfully add the yarn repository in Ubuntu 24.04 update the packages list and then use apt to install yarn:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> yarn<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"235\" class=\"wp-image-26579\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-3.png 762w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-3-300x93.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/p>\n<p>Once the installation is complete you can verify it by checking its version. Further to install the stable version of yarn add the following repository:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb https:\/\/dl.yarnpkg.com\/debian\/ stable main&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>yarn.list<\/div><\/div>\n<p>Similarly, install the pre-release version of Yarn on Ubuntu 24.04 by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb https:\/\/dl.yarnpkg.com\/debian\/ rc main&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>yarn.list<\/div><\/div>\n<p><strong>Note: <\/strong>Yarn on Ubuntu 24.04 can be installed via the default package installer without adding the repository. However, the version in apt is quite old and you might get an error or encounter issues using it due to cmdtest utility.<\/p>\n<h2><a id=\"post-26543-_226wm1usmwv9\"><\/a>2: Through Node Package Manager<\/h2>\n<p>Since Yarn is the package manager for javascript projects that use Node.js as their runtime environment it can be installed on Ubuntu 24.04 by using the node package manager. However, first, the npm should be installed using Ubuntu&#8217;s default package installer:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> npm<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"191\" class=\"wp-image-26591\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-4.png 762w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-4-300x75.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/p>\n<p>Now install Yarn via npm, here g flag is used to install a global version of Yarn which provides the privilege of accessing it from any directory of the system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> npm <span class=\"kw2\">install<\/span> <span class=\"re5\">-g<\/span> yarn<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"191\" class=\"wp-image-26602\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-5.png 765w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-5-300x75.png 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/p>\n<h2><\/h2>\n<h2><a id=\"post-26543-_sr03y4eib7l6\"><\/a>3: Through Corepack<\/h2>\n<p>Correpack is a Node.js script that serves as a bridge between the Node.js projects and the package managers used during the server or app development. In other words, Corepack allows to use yarn package manager without installing it separately.<\/p>\n<p>If the Node.js or npm is already installed on Ubuntu 24.04 then Corepack may also be pre-installed you can check by using the version command. To install Corepack use the node package manager:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> npm <span class=\"kw2\">install<\/span> <span class=\"re5\">-g<\/span> corepack<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"174\" class=\"wp-image-26606\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-6.png 667w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-6-300x78.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/p>\n<p>After the installation enable this script:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">corepack <span class=\"kw3\">enable<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"141\" class=\"wp-image-26608\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-7.png 666w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-7-300x64.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/p>\n<p>Now prepare and activate the stable version of the Yarn package manager:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">corepack prepare yarn<span class=\"sy0\">@<\/span>stable <span class=\"re5\">--activate<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"663\" height=\"164\" class=\"wp-image-26616\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-8.png 663w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-8-300x74.png 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/p>\n<p>Now execute the yarn command and it asks to add the tar file for version 1.22.19 so prompt it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">yarn<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"322\" class=\"wp-image-26621\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-9.png 669w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-9-300x144.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\n<p>Now as you can see an older version is installed so if you want to update it to the latest version then use the up command along with Corepack:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> corepack up<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"298\" class=\"wp-image-26624\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-10.png 807w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-10-300x111.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-10-768x284.png 768w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/p>\n<h2><a id=\"post-26543-_qsu4l864yvg5\"><\/a>4: Through Installation Script<\/h2>\n<p>If you are looking for an easy way to install Yarn on Ubuntu 24.04 then try this method as this method bash script file for yarn is <a href=\"https:\/\/classic.yarnpkg.com\/lang\/en\/docs\/install\/#windows-stable\">downloaded from its official website<\/a>. The downloaded bash file is then executed using the bash command. So in other words the file Yarn package manager is installed directly from the internet:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-o-<\/span> <span class=\"re5\">-L<\/span> https:<span class=\"sy0\">\/\/<\/span>yarnpkg.com<span class=\"sy0\">\/<\/span>install.sh <span class=\"sy0\">|<\/span> <span class=\"kw2\">bash<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"341\" class=\"wp-image-26628\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-11.png 802w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-11-300x128.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-11-768x327.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/p>\n<p>On the completion of the command execution, there will be a completion message showing the version installed:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"255\" class=\"wp-image-26634\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-12.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-12-300x95.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-12-768x243.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>To make Yarn work properly you need to reboot the system. In the above image, I have installed the stable version of Yarn so to install the pre-release version execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-o-<\/span> <span class=\"re5\">-L<\/span> https:<span class=\"sy0\">\/\/<\/span>yarnpkg.com<span class=\"sy0\">\/<\/span>install.sh <span class=\"sy0\">|<\/span> <span class=\"kw2\">bash<\/span> <span class=\"re5\">-s<\/span> <span class=\"re5\">--<\/span> <span class=\"re5\">--rc<\/span><\/div><\/div>\n<p>On the other hand to install the development version execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-o-<\/span> <span class=\"re5\">-L<\/span> https:<span class=\"sy0\">\/\/<\/span>yarnpkg.com<span class=\"sy0\">\/<\/span>install.sh <span class=\"sy0\">|<\/span> <span class=\"kw2\">bash<\/span> <span class=\"re5\">-s<\/span> <span class=\"re5\">--<\/span> <span class=\"re5\">--nightly<\/span><\/div><\/div>\n<h2><a id=\"post-26543-_agiadsb8bc0f\"><\/a>How to Change the yarn Version on Ubuntu 24.04<\/h2>\n<p>Based on the usage and compatibility you might need to upgrade or downgrade the version of Yarn and for that you can use the set version command along with the version name:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> yarn <span class=\"kw1\">set<\/span> version stable<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"201\" class=\"wp-image-26637\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-13.png 709w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-13-300x85.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/p>\n<p>Or you can use the version number that you want to use:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> yarn <span class=\"kw1\">set<\/span> version <span class=\"sy0\">&lt;<\/span>version-number<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"252\" class=\"wp-image-26641\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-14.png 803w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-14-300x94.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-14-768x241.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-26543-_hvbxwaam7pli\"><\/a>How to Remove Yarn from Ubuntu 24.04<\/h2>\n<p>The process of removing Yarn on Ubuntu 24.04 varies since there are several different ways to install it. To remove Yarn from Ubuntu 24.04 if installed via Yarn repository then execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove <span class=\"re5\">--autoremove<\/span> yarn<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"301\" class=\"wp-image-26645\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-15.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-15-300x118.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>Next, remove the repository from the sources.list directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>yarn.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"167\" class=\"wp-image-26648\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-16.png 763w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-16-300x66.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<p>Also, remove the GPG key for yarn and for that first find its key number by listing all the keys:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-key list<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"286\" class=\"wp-image-26652\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-17.png 763w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-17-300x112.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<p>Now use the last four key combinations along with the del command ti remove the Yarn GPG key from Ubuntu 24.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-key del<\/span> B01B 86E5 0310<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"339\" class=\"wp-image-26656\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-18.png 766w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-18-300x133.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/p>\n<p>To uninstall Yarn if installed via the node version manager execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> npm uninstall <span class=\"re5\">-g<\/span> yarn<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"194\" class=\"wp-image-26660\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-19.png 704w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-19-300x83.png 300w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/p>\n<p>To remove the Yarn package manager through Corepack first disable it and then remove it using the node package manager:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> corepack disable<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> npm uninstall <span class=\"re5\">-g<\/span> corepack<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"181\" class=\"wp-image-26663\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-20.png 665w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-20-300x82.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/p>\n<p>In case Yarn is installed through a bash file then first locate the directory in which it is installed and for that execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">yarn global bin<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"173\" class=\"wp-image-26666\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-21.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-21-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-21-768x165.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>Now remove the directory which will result in Yarn uninstallation:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> <span class=\"re5\">-r<\/span> .yarn<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"804\" height=\"171\" class=\"wp-image-26668\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-22.png 804w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-22-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26543-22-768x163.png 768w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/p>\n<h2><a id=\"post-26543-_lnawuojh6w61\"><\/a>Conclusion<\/h2>\n<p>Yarn is a javascript project package manager used to add functionalities or features in the application or server under development. To install Yarn in Ubuntu 24.04, use the Yarn repository, node package manager, Corepack, or installation script from the official source. You can also select three versions for Yarn: stable, pre-released, and development version. Further, you can also switch between the Yarn version by using the <em>set version<\/em> command.<\/p>","protected":false},"excerpt":{"rendered":"<p>To install Yarn in Ubuntu 24.04, use the Yarn repository, node package manager, Corepack, or installation script from the official source.<\/p>","protected":false},"author":113,"featured_media":26681,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-26543","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/26543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=26543"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/26543\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/26681"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=26543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=26543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=26543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}