Adjust usage of apt-mark slightly

This commit is contained in:
Tianon Gravi 2018-01-03 12:44:57 -08:00
parent 5f5304c3dc
commit a13f567fe9

View File

@ -121,18 +121,16 @@ RUN set -eux; \
cd /; \
rm -rf /usr/src/qemu; \
\
libs="$( \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs dpkg-query --search \
| cut -d: -f1 \
| sort -u \
)"; \
savedAptMark="$savedAptMark $libs"; \
\
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
STOPSIGNAL SIGHUP