Skip to content

Commit

Permalink
Update 12.04 logic to handle outdated apt cache on distro
Browse files Browse the repository at this point in the history
  • Loading branch information
eshamow committed Sep 11, 2014
1 parent 894117c commit 8c6eb60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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
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

0 comments on commit 8c6eb60

Please sign in to comment.