What is the recommended way of getting command-line Amazon EC2 tools on Debian? So, basically the same as this question, but for EC2 instead of S3.

Ubuntu has ec2-ami-tools and ec2-api-tools, but I couldn't find equivalent packages for Debian. A blog post titled "Install EC2 AMI & API tools in Debian" talks about installing Amazon's packages outside package management, but that seems a little clumsy.


Solution 1:

Ah, seems that you can use the Ubuntu .deb packages on Debian without problems! At least for the Debian stable (5.0.4) system that I'm working on, ec2-api-tools from Ubuntu Jaunty apparently works fine...

What I did:

  1. Download the .deb package (for amd64 in my case) of ec2-api-tools
  2. sudo dpkg -i ec2-api-tools_1.3.34128-0ubuntu2_amd64.deb

Edit: As pointed out in comments, you might want the package from latest Ubuntu version instead. (I can't say anything about compatibility with specific Debian versions though.)

As for ec2-ami-tools, I got that also installed quite smoothly, but only after fulfilling some missing dependencies: sudo apt-get install ruby libopenssl-ruby curl. (I had to dpkg -r ec2-ami-tools before that worked.)

Now, the obvious question of course is: why no official Debian packages? It turns out that Amazon's EC2 tools are not available for Debian because of some DFSG compliance reasons. :-(

Solution 2:

Here is a 'free' implementation euca2ools in Debian stable

Tools list for the package

Adding 'use limitation' clause 3.3 to EC2 tools (like Amazon did) was I think a misguided measure

Solution 3:

A little script to download ubuntu packages:

(getdeb-ub.sh) Assuming you have ubuntu sources list file in /etc/apt/sources.list.d/ubuntu.list, and you had sudo apt-get update previously, so the list had been cached.

#!/bin/bash

cd /etc/apt/sources.list.d
sudo mv .ubuntu.list.bak ubuntu.list
aptitude download "$@"
sudo mv ubuntu.list .ubuntu.list.bak

Then, run ./getdeb-ub.sh ec2-ami-tools ec2-api-tools to download the ec2 tools from the ubuntu repositories. And later, run sudo aptitude install ec2-api-tools-x.x.x.deb etc., to install the deb packages with all required dependencies. (sudo dpkg -i ... won't install dependencies for you)