Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu Maintenance Script

Ubuntu Bash License

A smart, safe, and fully automated system maintenance script for Ubuntu & Debian systems.

Automatically:

  • Uses apt-fast (if available) for lightning-fast updates
  • Checks disk space & internet speed
  • Updates, upgrades, cleans, and fixes broken packages
  • Streams live command output to your console by default, and logs everything with colors and timestamps
  • Asks for confirmation before dangerous actions
  • Supports quick mode, quiet mode, and forced apt fallback

Perfect for servers, desktops, and daily drivers!

Features

  • Smart apt-fast auto-install & fallback to apt
  • Verbose by default — see exactly what apt/apt-fast is doing in real time
  • Full colored console + detailed log file
  • Disk space warning before proceeding
  • Optional internet speed test
  • Reboot prompt if kernel was updated
  • Clean, modular, and well-documented code
  • Zero dependencies beyond standard Ubuntu tools

Quick Start

# Download and run (one-liner)
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/KarthikUdyawar/ubuntu-maintenance/main/maintenance.sh)"

Or clone and run:

git clone https://github.com/KarthikUdyawar/ubuntu-maintenance.git
cd ubuntu-maintenance
chmod +x maintenance.sh
sudo ./maintenance.sh

Options

sudo ./maintenance.sh          # Full interactive mode (verbose by default)
sudo ./maintenance.sh --quick  # Skip speed test
sudo ./maintenance.sh --apt    # Force use of apt (no apt-fast)
sudo ./maintenance.sh --quiet  # Suppress live command output (log file only)

Flags can be combined, e.g. sudo ./maintenance.sh --quick --apt --quiet.

Verbose Output

By default the script streams apt/apt-fast output live to your terminal as it runs, in addition to writing it to the log file — so you can see exactly what's happening during updates and upgrades. Pass --quiet to go back to the old behavior of logging silently to file only.

What It Runs

Under the hood, in order:

Step Command
Package manager install (if missing, opt-in) add-apt-repository ppa:apt-fast/stable, apt install -y apt-fast
Update package lists apt-fast update (or apt update)
Speed test (optional) apt-fast install -y speedtest-cli, speedtest-cli --simple
Show upgradable packages apt list --upgradable
Upgrade packages apt-fast upgrade -y
Full upgrade apt-fast full-upgrade -y
Check package integrity apt-fast check
Fix broken dependencies apt-fast -f install -y
Remove unnecessary packages apt-fast autoremove --purge -y
Clean package cache apt-fast autoclean -y, apt-fast clean
Reboot (if required, opt-in) shutdown -r now

Swap apt-fast for apt in the table above when running with --apt or when apt-fast isn't installed.

Log Location

All actions are logged to:
/var/log/system_maintenance_YYYYMMDD_HHMMSS.log

Author

Made with ❤️ by Karthik Udyawar

License

MIT License – Free to use, modify, and distribute.

About

Fully automated, safe & smart Ubuntu/Debian system maintenance script with apt-fast support, logging, and user confirmations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages