Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark packages as automatically installed #298

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion chroot-script
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ askpass() {
}
# }}}

# mark existing packages as automatically installed {{{
markauto() {
case "$RELEASE" in
jessie|stretch|buster|bullseye)
# apt-mark is unavailable or does not support all used patterns.
return
;;
esac

# Mark most leaf packages as automatically installed.
# Later in the systems life, apt autoremove will remove them if possible.
apt-mark auto '~i !~M ?not(?priority(required)) ?not(?priority(important)) ?not(?priority(standard))'
}
# }}}

# define chroot mirror {{{
chrootmirror() {
if [ "$KEEP_SRC_LIST" = "yes" ] ; then
Expand Down Expand Up @@ -810,7 +825,7 @@ trap signal_handler HUP INT QUIT TERM
# always execute install_policy_rcd
install_policy_rcd

for i in chrootmirror grmlrepos backportrepos kernelimg_conf \
for i in markauto chrootmirror grmlrepos backportrepos kernelimg_conf \
kernel packages extrapackages reconfigure hosts \
default_locales timezone fstab install_fs_tools hostname \
initrd grub_install passwords \
Expand Down
Loading