update update-system script

This commit is contained in:
manuel 2024-03-01 12:58:13 -01:00
parent a4508263ea
commit 093cc77c97
2 changed files with 34 additions and 6 deletions

View File

@ -7,8 +7,22 @@
# This script updates the system after Debian installation. # This script updates the system after Debian installation.
# Update the system # Update the system
chroot /target apt update if ! chroot /target apt update; then
chroot /target apt upgrade -y 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 # Clean up unnecessary packages
chroot /target apt autoremove -y if ! chroot /target apt autoremove -y; then
echo "Failed to remove unnecessary packages. Continuing anyway." >&2
fi
echo "System update completed successfully."
exit 0

View File

@ -7,8 +7,22 @@
# This script updates the system after Debian installation. # This script updates the system after Debian installation.
# Update the system # Update the system
chroot /target apt update if ! chroot /target apt update; then
chroot /target apt upgrade -y 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 # Clean up unnecessary packages
chroot /target apt autoremove -y if ! chroot /target apt autoremove -y; then
echo "Failed to remove unnecessary packages. Continuing anyway." >&2
fi
echo "System update completed successfully."
exit 0