mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Recommend apt instead of apt-get if updating the package cache failed (#4421)
* Only change the recommendation to use apt Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
0c4e1b51ab
commit
996f8fff28
1 changed files with 7 additions and 1 deletions
|
@ -1481,8 +1481,14 @@ update_package_cache() {
|
||||||
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
||||||
else
|
else
|
||||||
# Otherwise, show an error and exit
|
# Otherwise, show an error and exit
|
||||||
|
|
||||||
|
# In case we used apt-get and apt is also available, we use this as recommendation as we have seen it
|
||||||
|
# gives more user-friendly (interactive) advice
|
||||||
|
if [[ ${PKG_MANAGER} == "apt-get" ]] && is_command apt ; then
|
||||||
|
UPDATE_PKG_CACHE="apt update"
|
||||||
|
fi
|
||||||
printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}"
|
||||||
printf " %bError: Unable to update package cache. Please try \"%s\"%b" "${COL_LIGHT_RED}" "sudo ${UPDATE_PKG_CACHE}" "${COL_NC}"
|
printf " %bError: Unable to update package cache. Please try \"%s\"%b\\n" "${COL_LIGHT_RED}" "sudo ${UPDATE_PKG_CACHE}" "${COL_NC}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue