Yarn: Cannot install previous version of yarn using apt-get/apt-cache

Created on 15 Nov 2016  路  4Comments  路  Source: yarnpkg/yarn

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

Bug?

What is the current behavior?

If I list all existing version of yarn using apt-get policy, I only see latest version

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

  # Repo for newer Node.js versions
  - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  # Repo for Yarn
  - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
  - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  - sudo apt-get update -qq
  # trying 0.16.1 because https://github.com/yarnpkg/yarn/issues/1838
  - sudo apt-cache policy yarn
yarn:
  Installed: (none)
  Candidate: 0.17.0-1
  Version table:
     0.17.0-1 0
        500 http://dl.yarnpkg.com/debian/ stable/main amd64 Packages

What is the expected behavior?

I would expect to see 0.16.1-1.

Note: I am not a comfortable with apt-get/apt-cache so maybe I am doing something wrong, but find on the net that apt-cache policy command should give all available version.

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

$ node --version

v6.9.1

$ npm --version

3.10.8

$ nvm --version

0.32.0

yarn 0.17.0

Most helpful comment

This has been fixed!

% apt-cache policy yarn
yarn:
  Installed: 0.16.1-1
  Candidate: 0.16.1-1
  Version table:
 *** 0.16.1-1 500
        500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
        500 http://dl.yarnpkg.com/debian stable/main all Packages
        100 /var/lib/dpkg/status
     0.16.0-1 500
        500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
        500 http://dl.yarnpkg.com/debian stable/main all Packages
     0.15.0-1 500
        500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
        500 http://dl.yarnpkg.com/debian stable/main all Packages

You can specify an old version like this:

sudo apt-get install yarn=0.16.0-1

All 4 comments

Sorry about that :( The issue is that we're using reprepro for the main repo, which only allows a single version per package.

Two workarounds:
1 - Grab the package for the version you want and install it directly:

wget https://yarnpkg.com/downloads/0.16.1/yarn_0.16.1_all.deb
sudo dpkg -i yarn_0.16.1_all.deb

2 - Use the nightly repo (see https://yarnpkg.com/en/docs/nightly), which is using Aptly instead of reprepro and currently keeps releases indefinitely. Note that this repo has every build of Yarn, not just 'stable' builds.

Thanks for the fast response. Meanwhile I am using npm i -g [email protected] :)

This has been fixed!

% apt-cache policy yarn
yarn:
  Installed: 0.16.1-1
  Candidate: 0.16.1-1
  Version table:
 *** 0.16.1-1 500
        500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
        500 http://dl.yarnpkg.com/debian stable/main all Packages
        100 /var/lib/dpkg/status
     0.16.0-1 500
        500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
        500 http://dl.yarnpkg.com/debian stable/main all Packages
     0.15.0-1 500
        500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
        500 http://dl.yarnpkg.com/debian stable/main all Packages

You can specify an old version like this:

sudo apt-get install yarn=0.16.0-1

Well done! Thank you.

Was this page helpful?
0 / 5 - 0 ratings