refactor: Improve mirror selection feedback in package installation process

This commit is contained in:
Peter Wood
2025-05-29 07:34:23 -04:00
parent 3763c92b2a
commit c9322d7277

View File

@@ -204,10 +204,13 @@ case $PKG_MANAGER in
sudo rm -f /etc/apt/sources.list.d/nala-sources.list 2>/dev/null
# Try to fetch mirrors with less aggressive settings
if ! sudo nala fetch --auto --fetches 1 --country auto; then
echo -e "${YELLOW}Mirror selection failed, continuing with system default mirrors...${NC}"
echo -e "${YELLOW}Attempting to find faster mirrors (this may fail and that's okay)...${NC}"
if ! sudo nala fetch --auto --fetches 1 --country auto 2>/dev/null; then
echo -e "${YELLOW}Note: Fast mirror selection failed, using default mirrors (this is normal and safe)${NC}"
# Remove any potentially corrupted Nala sources
sudo rm -f /etc/apt/sources.list.d/nala-sources.list 2>/dev/null
else
echo -e "${GREEN}Fast mirrors configured successfully!${NC}"
fi
# Install packages using Nala