Important Note: The best thing to do is just download the zip files for ec2-api-tools and ec2-ami-tools and follow the instructions in the readme-install.txt file (found in ec2-ami-tools.zip). If you want to use apt-get, just know that they are out of date as of 6-20-2013 and some things you expect to be supported are not (such as ec2-register not supporting the -O and -W options for AWS_ACCESS_KEY and AWS_SECRET_KEY).
The following is how you install ec2-api-tools and ec2-ami-tools on an Ubuntu 12.04 LTS (Precise Pangolin) instance on EC2. You can adapt it for other Ubuntu versions.
1. Edit your /etc/apt/sources.list file and uncomment the following lines:
<code style="border: 0px; outline: 0px; vertical-align: baseline; background-color: transparent; margin: 0px; padding: 0px; background-position: initial initial; background-repeat: initial initial;">deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse<br><br>
deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse<br><br>
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse<br><br>
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
Instead of "us.archive.ubuntu.com" it may instead be something like "us-east-1.ec2.archive.ubuntu.com". If the lines don't exist, just add them. Also, depending on your Ubuntu version, you'll replace "precise" with something like "lucid" (you should see other lines as examples when you open the file for editing).
2. Run the following two commands:
<code style="border: 0px; outline: 0px; vertical-align: baseline; background-color: transparent; margin: 0px; padding: 0px; background-position: initial initial; background-repeat: initial initial;">sudo apt-get update<br><br>
sudo apt-get install ec2-api-tools ec2-ami-tools
UBUNTU
更新于 2023年03月28日