From eac2d7f5881fdbf3d7c583ac62abf118053b732c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 23 Jul 2014 21:56:35 -0400 Subject: [PATCH] Revert "Cleanup apt cache after grub install" This calls chroot as a non-root user, which will always fail with EPERM. This reverts commit ab2d1a31f2177b26aada075201712b0061a1b771. Change-Id: Ie674fef694ad66e1ebc22083dec2a0bc34371e7b --- elements/dpkg/cleanup.d/99-clean-up-cache | 9 --------- elements/dpkg/post-install.d/99-clean-up-cache | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) delete mode 100755 elements/dpkg/cleanup.d/99-clean-up-cache create mode 100755 elements/dpkg/post-install.d/99-clean-up-cache diff --git a/elements/dpkg/cleanup.d/99-clean-up-cache b/elements/dpkg/cleanup.d/99-clean-up-cache deleted file mode 100755 index b01509b2..00000000 --- a/elements/dpkg/cleanup.d/99-clean-up-cache +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# Do an apt-get clean. This will free some space. - -set -eu -set -o pipefail - -if ! chroot ${TARGET_ROOT} mount | grep /var/cache/apt/archives; then - sudo chroot ${TARGET_ROOT} apt-get clean -fi diff --git a/elements/dpkg/post-install.d/99-clean-up-cache b/elements/dpkg/post-install.d/99-clean-up-cache new file mode 100755 index 00000000..487c3474 --- /dev/null +++ b/elements/dpkg/post-install.d/99-clean-up-cache @@ -0,0 +1,9 @@ +#!/bin/bash +# Do an apt-get clean. This will free some space. + +set -eu +set -o pipefail + +if ! mount | grep /var/cache/apt/archives; then + apt-get clean +fi