Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 12.04 logic to handle outdated apt cache on distro #265

Merged
merged 1 commit into from
Sep 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packer/http/ubuntu-12.04/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ d-i passwd/user-uid string 900
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/username string vagrant
d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common
d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev zlib1g-dev linux-source nfs-common
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rereading this, I meant to ask -- what's the relationship of this to the cache fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libreadline-dev and dkms come from libdevel, which seems to have mismatching hashes from what actually gets downloaded from the Ubuntu repos.

If you select these packages for install during preseed there is a hash mismatch and install bails.

However if you move them to post-install, as long as they execute before the vmtools provisioner runs, we are ok. So during the update script, I clear the inaccurate cache and refresh, then pull the requisite packages iff we are on this version of Ubuntu.

-- 
Eric Shamow
Sent with Airmail

On September 13, 2014 at 9:43:54 PM, Julian C. Dunn (notifications@github.com) wrote:

In packer/http/ubuntu-12.04/preseed.cfg:

@@ -21,7 +21,7 @@ d-i passwd/user-uid string 900
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/username string vagrant
-d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common
+d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev zlib1g-dev linux-source nfs-common
Rereading this, I meant to ask -- what's the relationship of this to the cache fix?


Reply to this email directly or view it on GitHub.

d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select unattended-upgrades
d-i pkgsel/upgrade select full-upgrade
Expand Down
12 changes: 12 additions & 0 deletions packer/scripts/ubuntu/update.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash -eux

UBUNTU_VERSION=`lsb_release -r | awk '{print $2}'`
# on 12.04 work around bad cached lists
if [[ "$UBUNTU_VERSION" == '12.04' ]]; then
apt-get clean
rm -rf /var/lib/apt/lists
fi

# Update the package list
apt-get update

Expand All @@ -16,3 +23,8 @@ start on networking
task
exec /usr/bin/apt-get update
EOF

# on 12.04 manage broken indexes on distro disc 12.04.5
if [[ $UBUNTU_VERSION == '12.04' ]]; then
apt-get -y install libreadline-dev dpkg
fi