website icon indicating copy to clipboard operation
website copied to clipboard

Installation doc for ubuntu/debian is still unclear about cmdtest conflict issue

Open rgarrigue opened this issue 6 years ago • 0 comments

Hi

I hitted the issue discussed in https://github.com/yarnpkg/yarn/issues/2821. It's been closed but still the solution is unclear, uninstalling cmdtest doesn't work : apt install yarn does install cmdtest. Here's an example from a debian stretch

+ apt-get install -y yarn
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  file libmagic-mgc libmagic1 libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib mime-support python python-chardet python-cliapp
  python-markdown python-minimal python-pkg-resources python-pygments
  python-ttystatus python-yaml python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk libjs-jquery libjs-underscore python-xdg
  python-markdown-doc python-setuptools ttf-bitstream-vera python2.7-doc
  binfmt-support
The following NEW packages will be installed:
  cmdtest file libmagic-mgc libmagic1 libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib mime-support python python-chardet python-cliapp
  python-markdown python-minimal python-pkg-resources python-pygments
  python-ttystatus python-yaml python2.7 python2.7-minimal
0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded.

There's a simple solution : pin yarnpkg repository with a higher priority. Here's the script

cat <<EOF | sudo tee /etc/apt/preferences.d/yarn
Package: yarn
Pin: origin dl.yarnpkg.com
Pin-Priority: 750
EOF
sudo apt update
sudo apt-cache policy # just to display the pinned packages to confirm

Here's the result

root@4cd6b570e17e:/apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://dl.yarnpkg.com/debian stable/main all Packages
     release o=yarn,a=stable,n=stable,l=yarn-stable,c=main,b=all
     origin dl.yarnpkg.com
 500 https://dl.yarnpkg.com/debian stable/main amd64 Packages
     release o=yarn,a=stable,n=stable,l=yarn-stable,c=main,b=amd64
     origin dl.yarnpkg.com
 500 http://deb.debian.org/debian stretch-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
     origin deb.debian.org
 500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://deb.debian.org/debian stretch/main amd64 Packages
     release v=9.6,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
     origin deb.debian.org
Pinned packages:
     yarn -> 1.13.0-1 with priority 750
     yarn -> 1.12.3-1 with priority 750
     yarn -> 1.12.1-1 with priority 750
     yarn -> 1.10.1-1 with priority 750
     yarn -> 1.10.0-1 with priority 750
     yarn -> 1.9.4-1 with priority 750
     yarn -> 1.9.2-1 with priority 750
     yarn -> 1.7.0-1 with priority 750
     yarn -> 1.6.0-1 with priority 750
     yarn -> 1.5.1-1 with priority 750
     yarn -> 1.3.2-1 with priority 750
     yarn -> 1.2.1-1 with priority 750
     yarn -> 1.2.0-1 with priority 750
     yarn -> 1.1.0-1 with priority 750
     yarn -> 1.0.2-1 with priority 750
     yarn -> 1.0.1-1 with priority 750
     yarn -> 0.27.5-1 with priority 750
     yarn -> 0.27.4-1 with priority 750
     yarn -> 0.27.3-1 with priority 750
     yarn -> 0.27.2-1 with priority 750
     yarn -> 0.24.6-1 with priority 750
     yarn -> 0.24.5-1 with priority 750
     yarn -> 0.24.4-1 with priority 750
     yarn -> 0.24.3-1 with priority 750
     yarn -> 0.23.4-1 with priority 750
     yarn -> 0.23.3-1 with priority 750
     yarn -> 0.23.2-1 with priority 750
     yarn -> 0.22.0-1 with priority 750
     yarn -> 0.21.3-1 with priority 750
     yarn -> 0.20.3-1 with priority 750
     yarn -> 0.19.1-1 with priority 750
     yarn -> 0.18.1-1 with priority 750
     yarn -> 0.17.10-1 with priority 750
     yarn -> 0.17.9-1 with priority 750
     yarn -> 0.17.8-1 with priority 750
     yarn -> 0.17.6-1 with priority 750
     yarn -> 0.17.5-1 with priority 750
     yarn -> 0.17.4-1 with priority 750
     yarn -> 0.17.3-1 with priority 750
     yarn -> 0.17.2-1 with priority 750
     yarn -> 0.17.0-1 with priority 750
     yarn -> 0.16.1-1 with priority 750
     yarn -> 0.16.0-1 with priority 750
     yarn -> 0.15.0-1 with priority 750

root@4cd6b570e17e:/# apt install -y yarn
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libicu57 libuv1 nodejs
The following NEW packages will be installed:
  libicu57 libuv1 nodejs yarn

rgarrigue avatar Jan 23 '19 09:01 rgarrigue