This commit is contained in:
2020-07-27 14:33:35 -04:00
parent db6da60694
commit 3f8d7fc62c
6 changed files with 41 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
function process_debian()
{
## Update repos
apt-get update
## Upgrade packages
apt-get upgrade -y
## Remove unused packages
apt autoremove
## Remove old cached packages
apt autoclean
}
function process_rhel()
{
## Clean cache
yum clean all
## Update all packages, skipping problematic dependencies
yum update --skip-broken
}
function process_fedora()
{
## Update Fedora release
dnf upgrade --refresh
}
if [ -n "$(command -v apt-get)" ]; then
process_debian
elif [ -n "$(command -v yum)" ]; then
process_rhel
elif [ -n "$(command -v dnf)" ]; then
process_fedora
else
echo "Package update command not found!"
fi