-
Notifications
You must be signed in to change notification settings - Fork 42
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
scripts: further update scripts to work better with derivative distros. #103
scripts: further update scripts to work better with derivative distros. #103
Conversation
- copy *.list files from /etc/apt/sources.list.d into the chroot - inside the chroot, filter out references to the derivative distro's package sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments follow:-
Thanks for this @peanutbutterandcrackers |
@matt335672 - I'm happy to help (: I have made some more changes (as per your suggestion) and also added one extra stuff, and comments. I have tested these recent changes on Debian 11, Debian 12, Ubuntu 22.04 and Linux Mint 21.2 (with and without source repositories enabled). |
That makes a lot more sense with the comments - thanks @peanutbutterandcrackers. A couple of comments;
Putting all that together, I'd like to suggest you consider this fragment. I may of course have missed something. Please come back to me if I have. # Scan the source repositories. Add sources for all repositories
# in this suite.
# Ignore other suites. This is needed when running the wrapper in a
# derivative-distro (like Linux Mint 21.2 'victoria') with --suite
# option (--suite=jammy).
echo "- Adding source repositories" >&2
SRCLIST=$(find /etc/apt/ /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.list')
for srclst in $SRCLIST; do
while read type url suite rest; do
case "$suite" in
$codename | $codename-updates | $codename-security)
if [ "$type" = deb ]; then
echo "deb $url $suite $rest"
echo "deb-src $url $suite $rest"
fi
;;
esac
done <$srclst
done >/tmp/combined_sources.list
sudo rm $SRCLIST ;# Remove source respositories
# remove duplicates from the combined source.list in order to prevent
# apt warnings/errors; this is useful in cases where the user has
# already configured source code repositories.
sort -u < /tmp/combined_sources.list | \
sudo tee /etc/apt/sources.list > /dev/null
sudo apt-get update |
@matt335672 - Brilliant refinements! I've tested this with Debian 11, Debian 12 and Linux Mint 21.2, and it works. I will try to follow the style guide from now on. Thank you! |
Thank you @peanutbutterandcrackers |
The scripts were not working on Linux Mint 21.2 because it keeps it's sources list inside
/etc/apt/sources.list.d
instead of the usual place. This change makes it work. Also tested on Ubuntu 22.04 and Debian 12 to make sure nothing breaks - it doesn't.Otherwise
apt-get update
fails because of lack of valid signature.