6

I am trying to install heroku and for that it says i need to run this:

sudo snap install heroku --classic

but when i run that i get snap: command not found. when i looked up how to solve this it said i had to do this:

sudo apt update
sudo apt install snapd

but this does not work as well because it gives this:

apt: invalid flag: update

What do i do? How do i install heroku on aws cloud 9 linux?

saltedalmond
  • 89
  • 1
  • 1
  • 6

5 Answers5

12

To install heroku on ubuntu,

curl https://cli-assets.heroku.com/install-ubuntu.sh | sh

But, this version does not autoupdate and must be updated manully via apt-get.

Otherwise, to install snap, follow this link:
https://askubuntu.com/questions/1050388/ubuntu-16-04-install-snapd-problem

Chanran Kim
  • 439
  • 3
  • 8
  • The first curl command returns sh: line 4: /etc/apt/sources.list.d/heroku.list: No such file or directory – saltedalmond Sep 03 '19 at 07:05
  • How about just `sudo apt-get update; sudo apt-get install heroku-toolbelt heroku` without snap – Chanran Kim Sep 03 '19 at 07:15
  • it says No package heroku-toolbelt available.No package heroku available. I found another way to do it. but im not sure if this works. heroku --version returns heroku/7.29.0 linux-x64 node-v10.16.2 i am working on ruby is this okay? – saltedalmond Sep 03 '19 at 07:18
  • Yeah, I think you did it :) – Chanran Kim Sep 03 '19 at 07:21
  • but it shouldnt it say ruby instead okay of node? will this still function accurately since i am working in ruby environment? thanks for your help! – saltedalmond Sep 03 '19 at 07:23
  • No. The Node.js referred to in that message is the version used to build [the Heroku CLI Itself](https://github.com/heroku/cli). It has nothing to do with the language to use in your app. – ChrisGPT was on strike Sep 03 '19 at 10:44
5

you are placing the flag "--classic" on the wrong side.

Try this:

$ sudo snap install --classic heroku

Then check the version using:

$ heroku --version
Al Jaber Nishad
  • 111
  • 2
  • 2
4

To install heroku on ubuntu

sudo wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

To confirm Horuku is installed, and setup it with your credentials

heroku apps

dipenparmar12
  • 3,042
  • 1
  • 29
  • 39
3

You can simply install using npm:

npm install -g heroku
blackgreen
  • 34,072
  • 23
  • 111
  • 129
dt_emmy
  • 71
  • 4
0

Installation instructions can change over time so my recommendation is always consult the official documentation, especially for a security sensitive app like this one.

Note that you probably want to install their Standalone Installation that will auto update to latest version which will ensure you keep up to date with security patches.

Tony O'Hagan
  • 21,638
  • 3
  • 67
  • 78