This commit is contained in:
deathbybandaid 2024-05-01 22:30:41 -04:00
parent c3a2fb9ab9
commit 00a3e18dbe

View File

@ -91,13 +91,20 @@ pkgmgr_update(){
PKG_MANAGER=$( get_pkg_mgr ) PKG_MANAGER=$( get_pkg_mgr )
# Run apt update for distros that use apt # Run apt update for distros that use apt
if [ "$PKG_MANAGER" == *"apt"* ] ; then if [ "$PKG_MANAGER" == "apt" ] ; then
if should_apt_last_update ; then
"${PKG_MANAGER} update"
fi
fi
if [ "$PKG_MANAGER" == "apt-get" ] ; then
if should_apt_last_update ; then if should_apt_last_update ; then
"${PKG_MANAGER} update" "${PKG_MANAGER} update"
fi fi
fi fi
if [ "$PKG_MANAGER" == *"apt"* ] ; then if [ "$PKG_MANAGER" == "apt" ] ; then
"$PKG_MANAGER" full-upgrade -y
elif [ "$PKG_MANAGER" == "apt-get" ] ; then
"$PKG_MANAGER" full-upgrade -y "$PKG_MANAGER" full-upgrade -y
elif [ "$PKG_MANAGER" == "dnf" ] ; then elif [ "$PKG_MANAGER" == "dnf" ] ; then
"$PKG_MANAGER" update "$PKG_MANAGER" update
@ -143,7 +150,11 @@ pkgmgr_clean(){
printf "$COL_YELLOW" "Cleaning cache for $PKG_MANAGER" printf "$COL_YELLOW" "Cleaning cache for $PKG_MANAGER"
if [ "$PKG_MANAGER" == *"apt"* ] ; then if [ "$PKG_MANAGER" == "apt" ] ; then
"$PKG_MANAGER" clean
"$PKG_MANAGER" autoclean
"$PKG_MANAGER" autoremove -y
elif [ "$PKG_MANAGER" == "apt-get" ] ; then
"$PKG_MANAGER" clean "$PKG_MANAGER" clean
"$PKG_MANAGER" autoclean "$PKG_MANAGER" autoclean
"$PKG_MANAGER" autoremove -y "$PKG_MANAGER" autoremove -y
@ -170,7 +181,12 @@ pkg_mgr_install_pkg() {
PKG_MANAGER=$( get_pkg_mgr ) PKG_MANAGER=$( get_pkg_mgr )
# Run apt update for distros that use apt # Run apt update for distros that use apt
if [ "$PKG_MANAGER" == *"apt"* ] ; then if [ "$PKG_MANAGER" == "apt" ] ; then
if should_apt_last_update ; then
"${PKG_MANAGER} update"
fi
fi
if [ "$PKG_MANAGER" == "apt-get" ] ; then
if should_apt_last_update ; then if should_apt_last_update ; then
"${PKG_MANAGER} update" "${PKG_MANAGER} update"
fi fi