update
This commit is contained in:
@@ -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
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user