2023-10-30 10:43:35 -01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
################################################################################
|
2023-11-16 12:32:50 -01:00
|
|
|
# Title: Update system
|
|
|
|
# Description: Script to update the system after install
|
2023-10-30 10:43:35 -01:00
|
|
|
# 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
|
2024-09-05 13:05:55 +00:00
|
|
|
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
|
2023-10-30 10:43:35 -01:00
|
|
|
|
|
|
|
# Clean up unnecessary packages
|
2024-09-05 13:05:55 +00:00
|
|
|
if ! chroot /target apt autoremove -y; then
|
|
|
|
echo "Failed to remove unnecessary packages. Continuing anyway." >&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "System update completed successfully."
|
|
|
|
exit 0
|