#!/bin/bash # Check the Linux distro distro=$(cat /etc/os-release | grep ^NAME | cut -d '=' -f2- | sed 's/"//g') # Update the OS case $distro in "Ubuntu" | "Linux Mint") sudo apt update && sudo apt upgrade -y ;; "Fedora" | "CentOS" | "RHEL") sudo dnf update -y ;; "openSUSE") sudo zypper update -y ;; "Debian") sudo apt update && sudo apt upgrade -y ;; *) echo "Unsupported Linux distribution: $distro" exit 1 ;; esac