Why do I have to run aptitude update twice to install Ruby?

Posted by Willie Wheeler on Ask Ubuntu See other posts from Ask Ubuntu or by Willie Wheeler
Published on 2012-09-13T08:23:47Z Indexed on 2012/09/13 9:50 UTC
Read the original article Hit count: 1073

Filed under:

Summary. I have a fresh EC2 Precise 64-bit instance (ami-82fa58eb). After launching the instance, I want to install ruby1.9.1 (among others).

This doesn't work:

aptitude update &&
apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy dist-upgrade &&
aptitude install -y ruby1.9.1 ruby1.9.1-dev make

as Aptitude can't find the Ruby package. But this works:

aptitude update &&
aptitude update &&
apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy dist-upgrade &&
aptitude install -y ruby1.9.1 ruby1.9.1-dev make

I would like to understand why I need to run aptitude update twice.

Details. The first and second runs look pretty different. First run:

Ign http://security.ubuntu.com precise-security InRelease
Ign http://archive.ubuntu.com precise InRelease
Get: 1 http://security.ubuntu.com precise-security Release.gpg [198 B]
Ign http://archive.ubuntu.com precise-updates InRelease
Get: 2 http://security.ubuntu.com precise-security Release [49.6 kB]
Hit http://archive.ubuntu.com precise Release.gpg
Get: 3 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Hit http://archive.ubuntu.com precise Release
Get: 4 http://security.ubuntu.com precise-security/main amd64 Packages [161 kB]
Get: 5 http://archive.ubuntu.com precise-updates Release [49.6 kB]
Get: 6 http://security.ubuntu.com precise-security/restricted amd64 Packages [3,969 B]
Hit http://archive.ubuntu.com precise/main amd64 Packages
Get: 7 http://security.ubuntu.com precise-security/universe amd64 Packages [43.8 kB]
Hit http://archive.ubuntu.com precise/restricted amd64 Packages
Hit http://archive.ubuntu.com precise/universe amd64 Packages
Get: 8 http://security.ubuntu.com precise-security/multiverse amd64 Packages [2,180 B]
Hit http://archive.ubuntu.com precise/multiverse amd64 Packages
Get: 9 http://security.ubuntu.com precise-security/main i386 Packages [165 kB]
Hit http://archive.ubuntu.com precise/main i386 Packages
Hit http://archive.ubuntu.com precise/restricted i386 Packages
Hit http://archive.ubuntu.com precise/universe i386 Packages
Hit http://archive.ubuntu.com precise/multiverse i386 Packages
Get: 10 http://security.ubuntu.com precise-security/restricted i386 Packages [3,968 B]
Hit http://archive.ubuntu.com precise/main TranslationIndex
Get: 11 http://security.ubuntu.com precise-security/universe i386 Packages [44.0 kB]
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
Get: 12 http://security.ubuntu.com precise-security/multiverse i386 Packages [2,369 B]
Get: 13 http://security.ubuntu.com precise-security/main TranslationIndex [73 B]
Hit http://archive.ubuntu.com precise/restricted TranslationIndex
Get: 14 http://security.ubuntu.com precise-security/multiverse TranslationIndex [71 B]
Hit http://archive.ubuntu.com precise/universe TranslationIndex
Get: 15 http://security.ubuntu.com precise-security/restricted TranslationIndex [71 B]
Get: 16 http://archive.ubuntu.com precise-updates/main amd64 Packages [382 kB]
Get: 17 http://security.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get: 18 http://security.ubuntu.com precise-security/main Translation-en [76.5 kB]
Get: 19 http://security.ubuntu.com precise-security/multiverse Translation-en [995 B]
Get: 20 http://security.ubuntu.com precise-security/restricted Translation-en [978 B]
Get: 21 http://security.ubuntu.com precise-security/universe Translation-en [27.2 kB]
Get: 22 http://archive.ubuntu.com precise-updates/restricted amd64 Packages [6,755 B]
Get: 23 http://archive.ubuntu.com precise-updates/universe amd64 Packages [129 kB]
Get: 24 http://archive.ubuntu.com precise-updates/multiverse amd64 Packages [8,677 B]
Get: 25 http://archive.ubuntu.com precise-updates/main i386 Packages [387 kB]
Get: 26 http://archive.ubuntu.com precise-updates/restricted i386 Packages [6,732 B]
Get: 27 http://archive.ubuntu.com precise-updates/universe i386 Packages [130 kB]
Get: 28 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [9,672 B]
Get: 29 http://archive.ubuntu.com precise-updates/main TranslationIndex [3,564 B]
Get: 30 http://archive.ubuntu.com precise-updates/multiverse TranslationIndex [2,605 B]
Get: 31 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [2,461 B]
Get: 32 http://archive.ubuntu.com precise-updates/universe TranslationIndex [2,850 B]
Get: 33 http://archive.ubuntu.com precise/main Translation-en [726 kB]
Get: 34 http://archive.ubuntu.com precise/multiverse Translation-en [93.4 kB]
Get: 35 http://archive.ubuntu.com precise/restricted Translation-en [2,395 B]
Get: 36 http://archive.ubuntu.com precise/universe Translation-en [3,341 kB]
Get: 37 http://archive.ubuntu.com precise-updates/main Translation-en [188 kB]
Get: 38 http://archive.ubuntu.com precise-updates/multiverse Translation-en [5,414 B]
Get: 39 http://archive.ubuntu.com precise-updates/restricted Translation-en [1,484 B]
Get: 40 http://archive.ubuntu.com precise-updates/universe Translation-en [77.3 kB]
Ign http://archive.ubuntu.com precise/main Translation-en_US
Ign http://archive.ubuntu.com precise/multiverse Translation-en_US
Ign http://archive.ubuntu.com precise/restricted Translation-en_US
Ign http://archive.ubuntu.com precise/universe Translation-en_US
Fetched 6,137 kB in 11s (538 kB/s)
Reading package lists...

Second run:

Ign http://us-east-1.ec2.archive.ubuntu.com precise InRelease
Ign http://us-east-1.ec2.archive.ubuntu.com precise-updates InRelease
Get: 1 http://us-east-1.ec2.archive.ubuntu.com precise Release.gpg [198 B]
Get: 2 http://us-east-1.ec2.archive.ubuntu.com precise-updates Release.gpg [198 B]
Ign http://security.ubuntu.com precise-security InRelease
Get: 3 http://us-east-1.ec2.archive.ubuntu.com precise Release [49.6 kB]
Get: 4 http://us-east-1.ec2.archive.ubuntu.com precise-updates Release [49.6 kB]
Get: 5 http://us-east-1.ec2.archive.ubuntu.com precise/main Sources [934 kB]
Hit http://security.ubuntu.com precise-security Release.gpg
Hit http://security.ubuntu.com precise-security Release
Get: 6 http://us-east-1.ec2.archive.ubuntu.com precise/universe Sources [5,019 kB]
Get: 7 http://security.ubuntu.com precise-security/main Sources [42.8 kB]
Get: 8 http://security.ubuntu.com precise-security/universe Sources [13.5 kB]
Hit http://security.ubuntu.com precise-security/main amd64 Packages
Hit http://security.ubuntu.com precise-security/universe amd64 Packages
Hit http://security.ubuntu.com precise-security/main i386 Packages
Get: 9 http://us-east-1.ec2.archive.ubuntu.com precise/main amd64 Packages [1,273 kB]
Hit http://security.ubuntu.com precise-security/universe i386 Packages
Get: 10 http://us-east-1.ec2.archive.ubuntu.com precise/universe amd64 Packages [4,786 kB]
Hit http://security.ubuntu.com precise-security/main TranslationIndex
Hit http://security.ubuntu.com precise-security/universe TranslationIndex
Hit http://security.ubuntu.com precise-security/main Translation-en
Hit http://security.ubuntu.com precise-security/universe Translation-en
Get: 11 http://us-east-1.ec2.archive.ubuntu.com precise/main i386 Packages [1,274 kB]
Get: 12 http://us-east-1.ec2.archive.ubuntu.com precise/universe i386 Packages [4,796 kB]
Get: 13 http://us-east-1.ec2.archive.ubuntu.com precise/main TranslationIndex [3,706 B]
Get: 14 http://us-east-1.ec2.archive.ubuntu.com precise/universe TranslationIndex [2,922 B]
Get: 15 http://us-east-1.ec2.archive.ubuntu.com precise-updates/main Sources [163 kB]
Get: 16 http://us-east-1.ec2.archive.ubuntu.com precise-updates/universe Sources [50.8 kB]
Get: 17 http://us-east-1.ec2.archive.ubuntu.com precise-updates/main amd64 Packages [382 kB]
Get: 18 http://us-east-1.ec2.archive.ubuntu.com precise-updates/universe amd64 Packages [129 kB]
Get: 19 http://us-east-1.ec2.archive.ubuntu.com precise-updates/main i386 Packages [387 kB]
Get: 20 http://us-east-1.ec2.archive.ubuntu.com precise-updates/universe i386 Packages [129 kB]
Get: 21 http://us-east-1.ec2.archive.ubuntu.com precise-updates/main TranslationIndex [3,564 B]
Get: 22 http://us-east-1.ec2.archive.ubuntu.com precise-updates/universe TranslationIndex [2,850 B]
Get: 23 http://us-east-1.ec2.archive.ubuntu.com precise/main Translation-en [726 kB]
Get: 24 http://us-east-1.ec2.archive.ubuntu.com precise/universe Translation-en [3,341 kB]
Get: 25 http://us-east-1.ec2.archive.ubuntu.com precise-updates/main Translation-en [188 kB]
Get: 26 http://us-east-1.ec2.archive.ubuntu.com precise-updates/universe Translation-en [77.1 kB]
Fetched 23.8 MB in 23s (1,026 kB/s)
Reading package lists...

Note. My question is almost exactly the same as

Running 'apt-get upgrade' on Amazon EC2 AMI twice in succession upgrades very different packages

except that I'm seeing this issue with aptitude updates rather than apt-get upgrades.

© Ask Ubuntu or respective owner

Related posts about updates

Related posts about aptitude