This commit is contained in:
pika 2025-05-17 21:05:21 +02:00
parent e23be42d6a
commit 4127204f34

View file

@ -120,6 +120,28 @@ removeBloat() {
fi
}
_nala() {
if command_exists nala; then
echo_info "Nala is already present, fetching mirros now!"
echo_warning "(This might take a minute or two, depending on your internet speed)"
$_sudo nala fetch --auto --assume-yes --https-only
else
echo_note "Nala is not installed on the system, do you want to install it now? (Y/n): "
read -r inst_nala </dev/tty
case "$inst_nala" in
N | n)
echo_warning "All right, continue without nala!"
;;
*)
echo_note "Installing nala.."
$_sudo apt install nala --assume-yes &&
echo_info "Fetching best mirrors"
$_sudo nala fetch --auto --assume-yes --https-only
;;
esac
fi
}
main() {
# Getting general dependencies
@ -134,16 +156,17 @@ main() {
sources_file="/etc/apt/sources.list"
# Check if file exists
if [ ! -f "$sources_file" ]; then
if [ -f "$sources_file" ]; then
# Comment out CD-ROM entries using sudo
$_sudo sed -i 's/^[[:space:]]*deb[[:space:]]\+cdrom:/#&/' "$sources_file"
echo_info "CD-ROM entries have been commented out in $sources_file"
else
if [ ! -f "/etc/apt/sources.d/sources.list" ]; then
echo_error "Error: $sources_file not found"
return 1
fi
fi
# Comment out CD-ROM entries using sudo
$_sudo sed -i 's/^[[:space:]]*deb[[:space:]]\+cdrom:/#&/' "$sources_file"
echo_info "CD-ROM entries have been commented out in $sources_file"
_nala
;;
esac
}