mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-01 13:10:15 +00:00
Use apt instead of apt-get for updating the package cache if available
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
0c4e1b51ab
commit
aed343a2c9
1 changed files with 7 additions and 2 deletions
|
@ -266,8 +266,13 @@ if is_command apt-get ; then
|
||||||
# Set some global variables here
|
# Set some global variables here
|
||||||
# We don't set them earlier since the installed package manager might be rpm, so these values would be different
|
# We don't set them earlier since the installed package manager might be rpm, so these values would be different
|
||||||
PKG_MANAGER="apt-get"
|
PKG_MANAGER="apt-get"
|
||||||
# A variable to store the command used to update the package cache
|
# A variable to store the command used to update the package cache. If apt is available use this as we have seen it
|
||||||
UPDATE_PKG_CACHE="${PKG_MANAGER} update"
|
# gives more user-friendly (interactive) advice, else fall-back to apt-get
|
||||||
|
if is_command apt ; then
|
||||||
|
UPDATE_PKG_CACHE="apt update"
|
||||||
|
else
|
||||||
|
UPDATE_PKG_CACHE="${PKG_MANAGER} update"
|
||||||
|
fi
|
||||||
# The command we will use to actually install packages
|
# The command we will use to actually install packages
|
||||||
PKG_INSTALL=("${PKG_MANAGER}" -qq --no-install-recommends install)
|
PKG_INSTALL=("${PKG_MANAGER}" -qq --no-install-recommends install)
|
||||||
# grep -c will return 1 if there are no matches. This is an acceptable condition, so we OR TRUE to prevent set -e exiting the script.
|
# grep -c will return 1 if there are no matches. This is an acceptable condition, so we OR TRUE to prevent set -e exiting the script.
|
||||||
|
|
Loading…
Add table
Reference in a new issue