-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupgrade.sh
More file actions
executable file
·37 lines (31 loc) · 810 Bytes
/
upgrade.sh
File metadata and controls
executable file
·37 lines (31 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/bash
# Function to update the package index
update() {
echo "Updating package index..."
sudo apt update
}
# Function to upgrade installed packages
upgrade() {
echo "Upgrading installed packages..."
update
sudo apt full-upgrade -y
}
# Function to remove unnecessary packages
autoremove() {
echo "Removing unnecessary packages..."
sudo apt autoremove -y
}
# Main function to manage updates and upgrades
main() {
# echo "This script will update and upgrade your system."
# read -p "Do you want to proceed? (y/n): " answer
# if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
upgrade
autoremove
echo "Update and upgrade completed successfully."
# else
# echo "Operation canceled."
# fi
}
# Execute the main function
main