My-distro-DI-configs/deb-installer/devuan/scripts/07update-system

32 lines
912 B
Bash
Executable File

#!/bin/sh -e
################################################################################
# Title: Update system
# Description: Script to update the system after install
# Author: manuel rosa <manuelsilvarosa@gmail.com>
# Date: Outubro 29, 2023
# License: GPL-3.0-or-later
################################################################################
# This script updates the system after Debian installation.
# Update the system
if ! chroot /target apt update; then
echo "Failed to update package lists. Aborting." >&2
exit 1
fi
# Upgrade the system
if ! chroot /target apt upgrade -y; then
echo "Failed to upgrade packages. Aborting." >&2
exit 1
fi
# Clean up unnecessary packages
if ! chroot /target apt autoremove -y; then
echo "Failed to remove unnecessary packages. Continuing anyway." >&2
fi
echo "System update completed successfully."
exit 0