#!/bin/bash set -e # run dpkg-reconfigure unattended-upgrades and answer no unattended echo "Running dpkg-reconfigure unattended-upgrades..." echo "unattended-upgrades unattended-upgrades/enable_auto_updates boolean false" | sudo debconf-set-selections sudo dpkg-reconfigure -f noninteractive unattended-upgrades # mark linux-image-generic and linux-headers-generic as held back echo "Marking linux-image-generic and linux-headers-generic as held back..." sudo apt-mark hold linux-image-generic linux-headers-generic # upgrade the system echo "Upgrading the system..." sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y # Update and install required packages for Active Directory sudo DEBIAN_FRONTEND=noninteractive apt update sudo DEBIAN_FRONTEND=noninteractive apt install -y realmd libnss-sss libpam-sss sssd sssd-tools adcli samba-common-bin oddjob oddjob-mkhomedir packagekit # Install any additional software # Required packages for Ninja sudo DEBIAN_FRONTEND=noninteractive apt install -y net-tools network-manager policycoreutils # Check if reboot is required if [ -f /var/run/reboot-required ]; then echo -e "\033[31mA reboot is required.\033[0m" else echo -e "\033[32mReboot not required.\033[0m" fi