Update install utilities

This commit is contained in:
MacRimi 2025-07-30 17:34:44 +02:00
parent 53f29ec710
commit 8db57bda6e
2 changed files with 60 additions and 1 deletions

View File

@ -690,6 +690,24 @@ install_system_utils() {
command -v "$1" >/dev/null 2>&1
}
ensure_repositories() {
local sources_file="/etc/apt/sources.list"
local need_update=false
if ! grep -q "deb.*${OS_CODENAME}.*main" "$sources_file"; then
echo "deb http://deb.debian.org/debian ${OS_CODENAME} main contrib non-free non-free-firmware" >> "$sources_file"
need_update=true
fi
if [ "$need_update" = true ] || ! apt list --installed >/dev/null 2>&1; then
msg_info "$(translate "Updating package lists")..."
apt update >/dev/null 2>&1
fi
return 0
}
install_single_package() {
local package="$1"
@ -806,12 +824,18 @@ install_system_utils() {
show_proxmenux_logo
msg_title "$SCRIPT_TITLE"
msg_info2 "$(translate "Installing selected utilities")"
if ! ensure_repositories; then
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
return 1
fi
msg_ok "$(translate "Update package list successful")"
local failed=0
local success=0
local warning=0
local selected_array
IFS=' ' read -ra selected_array <<< "$selected"
@ -876,6 +900,8 @@ install_system_utils() {
install_system_utils_() {
msg_info2 "$(translate "Installing common system utilities...")"

View File

@ -60,6 +60,24 @@ install_system_utils() {
}
ensure_repositories() {
local sources_file="/etc/apt/sources.list"
local need_update=false
if ! grep -q "deb.*${OS_CODENAME}.*main" "$sources_file"; then
echo "deb http://deb.debian.org/debian ${OS_CODENAME} main contrib non-free non-free-firmware" >> "$sources_file"
need_update=true
fi
if [ "$need_update" = true ] || ! apt list --installed >/dev/null 2>&1; then
msg_info "$(translate "Updating package lists")..."
apt update >/dev/null 2>&1
fi
return 0
}
install_single_package() {
local package="$1"
local command_name="${2:-$package}"
@ -184,6 +202,13 @@ install_system_utils() {
clear
show_proxmenux_logo
msg_title "$(translate "Installing group"): $group_name"
if ! ensure_repositories; then
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
return 1
fi
msg_ok "$(translate "Update package list successful")"
local failed=0
local success=0
@ -241,6 +266,13 @@ install_system_utils() {
clear
show_proxmenux_logo
msg_title "$(translate "Installing selected utilities")"
if ! ensure_repositories; then
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
return 1
fi
msg_ok "$(translate "Update package list successful")"
local failed=0
local success=0
@ -300,6 +332,7 @@ install_system_utils() {
clear
show_proxmenux_logo
msg_info "$(translate "Verifying all utilities status")..."
local utilities=(
"axel:Download accelerator"