Yarn: Name conflict with Apache Hadoop Yarn

Created on 24 Dec 2016  ·  16Comments  ·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

Bug. When trying to install Yarn pkg manager there is a name conflict with Apache Hadoop Yarn.

What is the current behavior?

% brew install yarn
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/yarn-0.18.1.el_capitan.bottle.tar.gz
Already downloaded: /Users/jspooner/Library/Caches/Homebrew/yarn-0.18.1.el_capitan.bottle.tar.gz
==> Pouring yarn-0.18.1.el_capitan.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/yarn
Target /usr/local/bin/yarn
is a symlink belonging to hadoop. You can unlink it:
  brew unlink hadoop

To force the link and overwrite all conflicting files:
  brew link --overwrite yarn

To list all files that would be deleted:
  brew link --overwrite --dry-run yarn

Possible conflicting files are:
/usr/local/bin/yarn -> /usr/local/Cellar/hadoop/2.7.2/bin/yarn
==> Summary
🍺  /usr/local/Cellar/yarn/0.18.1: 5,639 files, 18.2M

If the current behavior is a bug, please provide the steps to reproduce.

brew install hadoop
brew install yarn

What is the expected behavior?

The the yarn binary should not conflict with the Hadoop yarn.

Please mention your node.js, yarn and operating system version.

NPM: 3.10.3
OSX: 10.11

Most helpful comment

Change the name

All 16 comments

We run into the same issue, and decided to use yarnpkg instead.

@UnrememberMe I can't even install it from apt-get

sudo apt-get install yarn
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  golang-go-linux-amd64 golang-src rlwrap
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  yarn
0 upgraded, 1 newly installed, 0 to remove and 153 not upgraded.
Need to get 0 B/1,743 kB of archives.
After this operation, 26.1 MB of additional disk space will be used.
(Reading database ... 125365 files and directories currently installed.)
Preparing to unpack .../archives/yarn_0.19.1-1_all.deb ...
Unpacking yarn (0.19.1-1) ...
dpkg: error processing archive /var/cache/apt/archives/yarn_0.19.1-1_all.deb (--unpack):
 trying to overwrite '/usr/bin/yarn', which is also in package hadoop-yarn 2.5.0+cdh5.3.0+781-1.cdh5.3.0.p0.54~trusty-cdh5.3.0
Errors were encountered while processing:
 /var/cache/apt/archives/yarn_0.19.1-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

yarnpkg binary not installed. Is there any workaround for Linux?

Hi, any workaround for this?

same for me

Workaround - alias hadoop yarn to '''yarn-hadoop''' before installing this yarn

@UnrememberMe, any advice on how you got yarnpkg working with Hadoop YARN already installed? Trying to automate installing yarnpkg through yum where hadoop-yarn is already installed as yarn … can't move/alias it away (as @enw suggests) because it might be in use/running at the time.

Would love to just sudo yum install yarnpkg … any chance this package could be published under 2 names? Like, just create a yarnpkg.repo akin to yarn.repo? Is that … bad?

We use yarnpkg as command line entry point instead since what yarn command line client does make no difference for my environment setup (all Linux machines).

From another dev, here is a workaround (untested by me):

  • brew link --overwrite yarn to install yarnpkg
  • create a script to put hadoop yarn earlier in your path, and execute that initialization script before you do any hadoop yarn work

same problem !

If someone can propose a solution that Yarn can adopt, I'd be more than happy try implementing that. Otherwise I'm not sure if we should keep this issue open since it won't be actionable by yarn unless we change the name and that's certainly not happening :D

Any workaround for this?

The easiest way for me to fix was to not use a package manager for installing yarn. Just used the tarball to install and made aliases.

Quickstart: Install from Tarball to avoid Hadoop Yarn conflict

Download the tarball

cd /opt
wget https://yarnpkg.com/latest.tar.gz

It is recommended that you verify the tarball before extracting

wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import
wget https://yarnpkg.com/latest.tar.gz.asc
gpg --verify latest.tar.gz.asc    
# Look for "Good signature from 'Yarn Packaging'" in the output

Extract tarball

tar zvxf latest.tar.gz    
# Yarn is now in /opt/yarn-[version]/

Remove conflicting Yarn binary

rm yarn-[version]/bin/yarn

Make yarnpkg binary accessible

Add this to your profile:

export PATH="$PATH:/opt/yarn-[version]/bin"

(the path may vary depending on where you extracted Yarn to)

source ~/.bash_profile    # or .bashrc or .profile depending on your OS

(this is just a compilation of existing documentation and the comments above)

Change the name

@8a8aleo who do you want to change which name? This is confounding. Is this some sort of turf war?

Another option (both MacOS and others):

  1. npm install -g yarn
  2. npx yarn
Was this page helpful?
0 / 5 - 0 ratings