diff --git a/elements/dpkg/bin/install-packages b/elements/dpkg/bin/install-packages index dc755abcd..800ce37ff 100755 --- a/elements/dpkg/bin/install-packages +++ b/elements/dpkg/bin/install-packages @@ -28,6 +28,9 @@ install_deb_packages () { if [ "$1" = "-u" ] ; then install_deb_packages dist-upgrade exit 0 +elif [ "$1" = "-e" ]; then + install_deb_packages remove $@ + shift else install_deb_packages install $@ fi diff --git a/elements/yum/bin/install-packages b/elements/yum/bin/install-packages index fe839827a..2ee49cb66 100755 --- a/elements/yum/bin/install-packages +++ b/elements/yum/bin/install-packages @@ -17,6 +17,7 @@ set -e EXTRA_ARGS= +ACTION=install if [ "$1" = "-u" ] ; then yum -y update @@ -24,6 +25,9 @@ if [ "$1" = "-u" ] ; then elif [ "$1" = "-d" ] ; then EXTRA_ARGS="--downloadonly" shift +elif [ "$1" = "-e" ]; then + ACTION=erase + shift fi # Packages that aren't available in the distro but requested for installation @@ -42,7 +46,7 @@ if [ -n "$WHITELIST" ]; then if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release fi - yum -y install $EXTRA_ARGS $(map-packages $WHITELIST) + yum -y $ACTION $EXTRA_ARGS $(map-packages $WHITELIST) for pkg in "$@"; do if [ "$pkg" = "python-pip" ] ; then alternatives --install /usr/bin/pip pip /usr/bin/pip-python 10