update_upgrade_linux

Linux System Update and Upgrade Script

A user-friendly Python script to update and upgrade your Linux system with visual feedback and safety features.

Features

Requirements

Installation

  1. Clone or download this repository
  2. Make the script executable:
    chmod +x update_upgrade_linux.py
    

Usage

Basic Usage

sudo python update_upgrade_linux.py

Dry Run Mode

To see what the script would do without making any changes:

sudo python update_upgrade_linux.py --dry-run

What the Script Does

  1. Updates Package List
    • Fetches the latest package information from repositories
  2. Upgrades Packages
    • Installs available updates for all packages
    • Automatically answers β€œyes” to prompts
  3. Cleans Up
    • Removes unnecessary packages
    • Cleans the package cache

Output Examples

Normal Run

Linux System Update and Upgrade
=============================
This script will update and upgrade your Linux system.
It will perform the following steps:
1. Update package list
2. Upgrade installed packages
3. Remove unnecessary packages
4. Clean package cache

Updating Package List
===================
Updating package list... β ‹
βœ“ Package list updated successfully

Upgrading Packages
================
Upgrading packages... β ‹
βœ“ Packages upgraded successfully

Cleaning Up
==========
Removing unnecessary packages... β ‹
βœ“ Unnecessary packages removed
Cleaning package cache... β ‹
βœ“ Package cache cleaned

Summary
=======
βœ“ System update and upgrade completed successfully!
Your system is now up to date!

Dry Run

Linux System Update and Upgrade
=============================
This script will update and upgrade your Linux system.
It will perform the following steps:
1. Update package list
2. Upgrade installed packages
3. Remove unnecessary packages
4. Clean package cache

⚠ DRY RUN MODE: No changes will be made to the system

Updating Package List
===================
Updating package list... β ‹
⚠ Would run: apt update

Upgrading Packages
================
Upgrading packages... β ‹
⚠ Would run: apt upgrade -y

Cleaning Up
==========
Removing unnecessary packages... β ‹
⚠ Would run: apt autoremove -y
Cleaning package cache... β ‹
⚠ Would run: apt autoclean

Summary
=======
⚠ This was a dry run. No changes were made to the system.

Logging

The script creates a log file update_upgrade.log with detailed information about:

Error Handling

The script includes comprehensive error handling:

Contributing

Feel free to submit issues and enhancement requests!

License

This project is open source and available under the MIT License.