1

I follow the instructions and run:

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

And I get:

...
Hit http://archive.ubuntu.com precise-backports/restricted Translation-en                                                  
Hit http://archive.ubuntu.com precise-backports/universe Translation-en                                                    
Err http://toolbelt.heroku.com ./ Packages                                                                                 
  407  Proxy Authentication Required
Ign http://apt-corp.mirror.corp.google.com goobuntu-backports-precise-stable/main Translation-en_US
...      
Ign http://apt-corp.mirror.corp.google.com ubiquity-precise-stable/main Translation-en
Ign http://apt-corp.mirror.corp.google.com vmware-precise-stable/main Translation-en_US
Ign http://apt-corp.mirror.corp.google.com vmware-precise-stable/main Translation-en
Fetched 2,313 kB in 18s (123 kB/s)
W: Failed to fetch http://toolbelt.heroku.com/ubuntu/./Packages  407  Proxy Authentication Required

Any idea how to solve this?

Itay Maman
  • 30,277
  • 10
  • 88
  • 118

1 Answers1

3

What This Usually Means

Usually a 407 Proxy Authentication Required error while attempting to install a package with APT means:

  1. You use an HTTP proxy.
  2. APT is not properly configured to use it.

If that is the case here, then you can solve the problem by adding the line

Acquire::http::Proxy "http://user:pass@proxy:port/";

to the file /etc/apt/apt.conf (give user, pass, proxy, and port the correct values).

Source: jaseem's answer to 407 Proxy Authentication Required (on Ask Ubuntu).

A Curious Situation

Here, it appears other software sources work. apt-get is able to read data from archive.ubuntu.com, and presumably is able to do more (as you would've noticed if the package manager on your Ubuntu box were thoroughly broken).

So while the problem seems proxy-related, it may not be a consequence of misconfiguration on your machine.

One interesting thing about the http://toolbelt.heroku.com software source is that navigating to that URL forwards you to the HTTPS site. APT fully supports HTTPS software sources, but this software source is not HTTPS.

Examining the configuration for the software source the script enabled reveals:

$ cat /etc/apt/sources.list.d/heroku.list 
deb http://toolbelt.heroku.com/ubuntu ./

http://toolbelt.heroku.com/ubuntu goes to an HTTPS 404 page, too, but with a trailing slash, it does not. When ended in /, it redirects to http://heroku-toolbelt.s3.amazonaws.com/apt/ (which, conveniently though perhaps irrelevantly, behaves correctly whether or not you have the trailing /).

Maybe Ubuntu or your proxy is having a hard time figuring out what is HTTP and HTTPS, for proxy purposes. This is just a guess...but one that I think is worth checking out.

A Possible Solution

Edit /etc/apt/sources.list.d/heroku.list and change its contents to:

deb http://toolbelt.heroku.com/ubuntu/ ./

(That is, add a trailing slash to the URL.)

Then run sudo apt-get update and see if the error goes away. If it does, try installing Heroku.

  • The script you download would've automatically installed it, but it didn't get to that point. So manually run: sudo apt-get install heroku

Why not just change it to the amazonaws domain name?

When I suggested to add a trailing slash, you probably wondered why I didn't just say to change the line to:

deb http://heroku-toolbelt.s3.amazonaws.com/apt ./

The reason is that, even though a Packages file (listing packages the repository offers) exists in http://heroku-toolbelt.s3.amazonaws.com/apt and can be downloaded with

wget http://heroku-toolbelt.s3.amazonaws.com/apt/./Packages

...nonetheless, somehow apt-get update is unable to download the file:

W: Failed to fetch http://heroku-toolbelt.s3.amazonaws.com/apt/./Packages  404  Not Found

aptitude has the same problem, suggesting it's not an apt-get bug. Moreover, the ./ syntax works fine for other files besides Packages that are retrieved by apt-get update and aptitude update.

Therefore, unless this is enough information that you (or someone) can figure out what I cannot, it's not likely changing it to the amazonaws domain name will work either.

Manually Download and Install the .deb Packages

If your proxy settings are correct and there is no problem with your proxy itself, and adding the trailing slash to the URL did not work, then the only solution I can think of is the workaround of manually downloading and installing the .deb packages.

First, disable the Heroku repository that's causing errors:

cd /etc/apt/sources.list.d && sudo mv heroku.list heroku.list.save

The Packages file (in case you're not able to download it at all) says:

Package: foreman
Priority: standard
Section: main
Maintainer: Heroku
Architecture: all
Version: 0.60.0
Depends: ruby1.9.1
Filename: ./foreman-0.60.0.deb
Size: 89486
MD5sum: 83c614451545d98a09d0bb55e939cc03
SHA1: afd5d9d6ede750cb42bce1ab938dd9ac7bebe100
SHA256: a41532cb9ed60226ca9b4388842215c5ba94f8f5c32d832519858f66d5b19ebe
SHA512: c9327af190b12cb4d7f33cf2480c15c1249b400c4605ea5405ba3e3ddd433789a94471946ef4be452ed1669f1b63bf7150dba03c0e76a0d6f9c9ff981890490a
Description: Manage Procfile-based applications.
 Foreman is a manager for Procfile-based applications. Its aim is to
 abstract away the details of the Procfile format, and allow you to
 either run your application directly or export it to some other
 process management format.

Package: heroku-toolbelt
Priority: standard
Section: main
Installed-Size:
Maintainer: Heroku
Architecture: all
Version: 2.34.0
Depends: git-core, foreman, heroku (= 2.34.0)
Filename: ./heroku-toolbelt-2.34.0.deb
Size: 628
MD5sum: e81597804c537e93f85b89720ae2ebfd
SHA1: ebbb60c1479364f112ea386b5f6199de54dfcf5f
SHA256: c204b87691a5fdd8e0b750512e557ac5c494d4d561ecafb1e6d2c04b078b4bf8
SHA512: 8622e839f4748878a3c3083b09d1a84a16fb0c8c6cd3ac0885e5960810e8116c785e63027ccf87bfd1618be53736dabbcfc47c9c83e072776e9099c5443a64f9
Description: A metapackage for working with the Heroku platform.

Package: heroku
Priority: standard
Section: main
Maintainer: Heroku
Architecture: all
Version: 2.34.0
Depends: ruby1.9.1, libopenssl-ruby1.9.1, libreadline-ruby1.9.1, libssl0.9.8 (>= 0.9.8k) | libssl1.0.0
Filename: ./heroku-2.34.0.deb
Size: 639186
MD5sum: 474461b8217d45a954fc0eeab007b53d
SHA1: 50f2ca475d78d480a47dcc56353707c69209dbb9
SHA256: 7caf91c66e6c439b210b338a06313218b8a38ce5458467771f51df770832c476
SHA512: d009fb299232dc65ce586fe185670d96c1cf30bf15e7dada1f11000e7753951dc77b872caca0897e856a88fe3142f2da9f63b90adaeca213bacdb73455c8c1f1
Description: Client library and CLI to deploy apps on Heroku.

So, make an empty directory, grab the debs, and install them and their dependencies:

mkdir ~/heroku-debs
cd ~/heroku-debs
wget http://toolbelt.heroku.com/ubuntu/foreman-0.60.0.deb
wget http://toolbelt.heroku.com/ubuntu/heroku-toolbelt-2.34.0.deb
wget http://toolbelt.heroku.com/ubuntu/heroku-2.34.0.deb
# You may want to verify hashes now. Ideally, download the Packages file
# yourself, rather than assuming the authenticity of what I've quoted here.
sudo dpkg -i *.deb
sudo apt-get update && sudo apt-get -f install

Remember they won't be updated automatically when your other software is. However, assuming you're able to download the Packages file, you can use that to check for updates from time to time.

I hope one of the earlier solutions I've presented worked for you. If not, this should, and hopefully a less ugly solution will be found soon.

Community
  • 1
  • 1
Eliah Kagan
  • 1,704
  • 3
  • 22
  • 38