Skip to content

Commit

Permalink
Mark packages as automatically installed
Browse files Browse the repository at this point in the history
This way a later "apt autoremove" will also remove library/leaf packages installed by the initial bootstrap.
  • Loading branch information
zeha committed Jan 7, 2025
1 parent 12cce02 commit 21e1dca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion chroot-script
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ askpass() {
}
# }}}

# mark existing packages as automatically installed {{{
markauto() {
# 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(~prequired) ?not(~pimportant) ?not(~pstandard)'
}
# }}}

# define chroot mirror {{{
chrootmirror() {
if [ "$KEEP_SRC_LIST" = "yes" ] ; then
Expand Down Expand Up @@ -810,7 +818,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

0 comments on commit 21e1dca

Please sign in to comment.