Skip to content

Commit

Permalink
fix(apt): replace deprecated apt command with apt-get command
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed May 26, 2023
1 parent edbacf5 commit 597c330
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions chezmoi/.chezmoitemplates/install-apt-prerequisites
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ log_task "Installing APT prerequisites"
# may use newer CAs.
# Ignore apt update error if it is due to expired certificate because chances are that
# the next command will fix it.
if output="$(sudo apt update --yes)" || [[ "${output}" == *"The certificate chain uses expired certificate."* ]]; then
if output="$(sudo apt-get update --yes)" || [[ "${output}" == *"The certificate chain uses expired certificate."* ]]; then
echo "${output}"
true
else
echo "${output}"
exit 1
fi
c sudo apt install --yes -qq -o=Dpkg::Use-Pty=0 --no-install-recommends ca-certificates
c sudo apt install --yes -qq -o=Dpkg::Use-Pty=0 --no-install-recommends curl gnupg software-properties-common zsh locales locales-all jq
c sudo apt-get install --yes -qq -o=Dpkg::Use-Pty=0 --no-install-recommends ca-certificates
c sudo apt-get install --yes -qq -o=Dpkg::Use-Pty=0 --no-install-recommends curl gnupg software-properties-common zsh locales locales-all jq

# Add APT repositories for newer versions of Git.
# remove existing apt sources
c sudo rm -f etc/apt/sources.list.d/git-core-*.list*
c sudo add-apt-repository ppa:git-core/ppa --yes
c sudo apt update --yes
c sudo apt install --yes -qq -o=Dpkg::Use-Pty=0 --no-install-recommends git
c sudo apt-get update --yes
c sudo apt-get install --yes -qq -o=Dpkg::Use-Pty=0 --no-install-recommends git

# Set up locales
# check if locale is already set up by running locale | grep LC_ALL | grep en_US.UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ done
if [[ ${#missing_packages[@]} -gt 0 ]] || [[ ${#upgrade_packages[@]} -gt 0 ]]; then
# This script also gets called when running rootmoi
if [ "$USER" = "root" ]; then
apt_command=(apt)
apt_command=(apt-get)
else
apt_command=(sudo apt)
apt_command=(sudo apt-get)
fi

c "${apt_command[@]}" update --yes -qq -o=Dpkg::Use-Pty=0
Expand Down

0 comments on commit 597c330

Please sign in to comment.