wip
This commit is contained in:
parent
e23be42d6a
commit
4127204f34
1 changed files with 28 additions and 5 deletions
|
@ -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 "/etc/apt/sources.d/sources.list" ]; then
|
||||
echo_error "Error: $sources_file not found"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
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"
|
||||
fi
|
||||
fi
|
||||
|
||||
_nala
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue