How to update Heroku cli?



Seems everything I have tried failed to update Heroku to the latest version


heroku update returns:

! To update this version of the Heroku client please use
! apt-get install heroku-toolbelt

And if I do that as per the C9 documentation (

wget -O- | sh

it updates to:

heroku-toolbelt/3.43.16 (x86_64-linux) ruby/2.3.0
heroku-cli/5.2.20-9d094b0 (linux-amd64) go1.6.2

And I’m told the latest version of Heroku Cli should be:


Any ideas ?


This is an odd one. I had a bit of a look in to this.

The TL;DR is that heroku only vends an older version via their deb packages and the update process requires writing things over the top of the packages, which they do in a way that doesn’t support layered filesystems. (namely assuming you can do a hard link across what may be different filesystems via an atomic rename instead of trying to copy the file as a fallback)

You should have gotten 5.4.8 not 5.2.20 however.

I just made another new workspace and I have this by default:

heroku-toolbelt/3.43.13 (x86_64-linux) ruby/2.3.0
heroku-cli/5.4.8-eee5ec9 (linux-amd64) go1.7.1

Running sudo apt-get update; sudo apt-get install heroku-toolbelt heroku gets me:

heroku-toolbelt/3.43.16 (x86_64-linux) ruby/2.3.0
heroku-cli/5.4.8-eee5ec9 (linux-amd64) go1.7.1

Getting beyond that version does not appear to work when using the install-ubuntu script provided by Heroku at this time (it just adds the apt repo for heroku-toolbelt and heroku)

Sadly there doesn’t appear to be a way to fix this within a Cloud9 workspace at this time, Heroku should (eventually) release a newer version via apt at which point doing apt-get install heroku-toolbelt as they suggest will work normally.

Fun fact: the warning to only use apt-get to manage upgrades is always printed after it tries to run the update.


I believe I should just uninstall and reinstall. Would you suggest doing so, because I wouldn’t want to run into more troubles ?


This is frustrating. How do you uninstall and reinstall Heroku Cli, because the suggested way in Heroku Docs does nothing:

$ sudo apt-get remove heroku-toolbelt
$ sudo rm /etc/apt/sources.list.d/heroku.list

Say it’s uninstalled yet heroku --version returns:

heroku-toolbelt/3.43.16 (x86_64-linux) ruby/2.3.0
heroku-cli/5.2.20-9d094b0 (linux-amd64) go1.6.2

Can someone list the commands or point me in the right direction ?


Try running sudo apt-get purge heroku-toolbelt, should completely remove it.


That gives me this error:

E: Unable to locate package heroku-toolbelt


ok, so I manage to remove it with:

 sudo apt-get --purge remove heroku
 sudo apt-get --purge remove heroku-toolbelt

But when reinstalling it reinstall the presumably same old version, either I install as per Heroku Docs:

sudo add-apt-repository "deb ./"
curl -L | sudo apt-key add -
sudo apt-get install heroku

Or with:

wget -qO- | sh


So, the solution is this, via Heroku support team:

remove the directory ~/.local/share/heroku/ and then run heroku update or in my case wget -qO- | sh

(Removing this directory will cause the CLI to download the latest version)


I’m having this same problem. But the solution listed in the last comment here gives me a message that heroku-toolbelt is already in the latest version. Alas, my toolbelt version is 5.4.8.

Any new developments on this problem?


(I’m the maintainer of the Heroku CLI)

Cloud9 is using the legacy toolbelt which is a few major revisions behind our current CLI. Use our apt-get script to update the CLI:

$ wget -qO- | sh


@dickeyxxx using that script breaks apt on cloud9, because apt refuses to do anything, when there is something using https in sources.list.d and apt-transport-https is not installed Installing apt-transport-https issue


sudo apt-get update
sudo  apt-get install -y apt-transport-https

before echo "deb ./" > /etc/apt/sources.list.d/heroku.list, works.

Installing apt-transport-https issue

thanks for letting me know, I’ll update the script. Probably see if I can have it first check if apt-transport-https is installed


this is now updated with the fixed transport


This has been a while and I found that the issue still exists.

I tried the script you guys mentioned to do the update. The results is

E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

Then I tried manually to update heroku. I got messages below:

The following packages have unmet dependencies:
apt-transport-https : Depends: libapt-pkg4.12 (>= but 1.0.1ubuntu2.10 is to be installed
Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04.3 is to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
These two packages have a huge dependent relationship and I could not simply remove them.

Can anyone suggest what to do as I cannot push my app from C9 to Heroku?


try using the standalone tarball


Does C9 provide a way to upgrade the Heroku CLI to a supported version?

Reading this thread leads me to believe that the answer is no.

If there is a way to upgrade, can C9 support list the steps or reference a document that does?


Just a quick follow-up note: I successfully upgraded using the instructions from dickeyxxx:

$ wget -qO- | sh


The command provided by dickeyxxx seems to have worked fine for me as well.

$ wget -qO- | sh


My rails console stopped working due to the deprecated CLI. I updated per the instructions above, but now I can’t run any rails commands. What do I need to do to? See output below:

heroku run rails console
Refreshing plugins… !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins… done
Refreshing plugins… !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins… done
▸ run is not a heroku command.
▸ Perhaps you meant plugins:uninstall
▸ Run heroku help for a list of available commands.

My version is:
heroku-cli/6.15.11-5cba33c (linux-x64) node-v9.3.0

Thanks in advance for any help!


I updated and now I’m getting this message:

$ heroku console
Running console on ⬢ feedback-rebates… !
▸ Invalid credentials provided.
heroku: Press any key to open up the browser to login or q to exit:
heroku: Waiting for login… ⢿

No browser opens and nothing else happens. How do I login now? I’ve been using automatic login for years and now it just not working.