Fix ubuntu image creation issue 30/50530/7
authorAnil Belur <abelur@linuxfoundation.org>
Mon, 27 Feb 2017 05:02:47 +0000 (15:02 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 27 Feb 2017 08:58:56 +0000 (18:58 +1000)
- 'E: Unable to locate package':
  This issue is not reproducable local packer build. Add additional repository
  when install fails to get package from one of the repositories

Change-Id: I7b35770bc9fef31bada046139ee637da7f9b536e
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
packer/provision/baseline.sh

index cff72debedcd88cac628b200b5e5d0b807b79f9d..ec8a25f91bd4d9775dd17cd4335f115338e266fa 100644 (file)
@@ -138,9 +138,23 @@ Dpkg::Options {
 EOF
 
     echo "---> Updating operating system"
+
+    # add additional repositories
+    sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
+    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
+
     apt-get update
+    apt-get clean
     apt-get upgrade
 
+    # todo: added to debug "E: Unable to locate package" issue
+    # list of all available repositories.
+    apt-cache policy
+    # list the repositories the package is available
+    apt-cache policy git-review
+    apt-cache policy puppet
+    apt-cache policy libxml-xpath-perl
+
     # add in stuff we know we need
     echo "---> Installing base packages"
     apt-get install unzip xz-utils puppet git git-review libxml-xpath-perl