Files
Compose-Files/Backups/Miker/.trash/APT - Update and Upgrade.md
T
2026-07-20 09:23:17 -04:00

27 lines
595 B
Markdown

```
#!/bin/bash
# Ensure the script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Please use sudo."
exit 1
fi
echo "--- Updating package lists ---"
apt update
echo "--- Upgrading installed packages ---"
DEBIAN_FRONTEND=noninteractive apt upgrade -y
echo "--- Performing distribution upgrade (if available) ---"
DEBIAN_FRONTEND=noninteractive apt full-upgrade -y
echo "--- Cleaning up unnecessary packages ---"
apt autoremove -y
echo "--- Cleaning up cached package files ---"
apt clean
echo "--- Linux system update and cleanup complete! ---"
```