Commit 8bb0831c authored by Anton Midyukov's avatar Anton Midyukov

cleanup: run 'apt-get autoremove -y' after remove packages

Before mkimage 0.3.6 this did not make sense, all packages were considered manually installed. This is no longer the case, and it makes sense to remove packages installed by dependencies.
parent 0355eae8
......@@ -8,4 +8,7 @@ fi >&2
[ -n "$GLOBAL_CLEANUP_PACKAGES" ] || exit 0
list="$(rpmquery -a --qf='%{NAME}\n' $GLOBAL_CLEANUP_PACKAGES)"
[ -z "$list" ] || apt-get remove -f -y -- $list
if [ -n "$list" ]; then
apt-get remove -f -y -- $list
apt-get autoremove -y
fi
......@@ -25,6 +25,9 @@ echo "removing $CLEANUP_PACKAGES"
# remove temporary packages from the installed system
list="\$(exec_chroot rpmquery -a --qf='%{NAME}\\n' $CLEANUP_PACKAGES)"
[ -z "\$list" ] || exec_chroot apt-get remove -f -y -- \$list
if [ -n "\$list" ]; then
exec_chroot apt-get remove -f -y -- \$list
exec_chroot apt-get autoremove -y
fi
EOF
chmod +x "$SCRIPT"
......@@ -12,5 +12,8 @@ fi >&2
CLEANUP_PACKAGES="$GLOBAL_CLEANUP_PACKAGES $GLOBAL_CLEANUP_LIVE_PACKAGES"
list="$(rpmquery -a --qf='%{NAME}\n' $CLEANUP_PACKAGES)"
[ -z "$list" ] || apt-get remove -f -y -- $list
if [ -n "$list" ]; then
apt-get remove -f -y -- $list
apt-get autoremove -y
fi
:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment