Skip to content

Commit 32f02da

Browse files
committed
chore: Run apt update only once, globally
1 parent d595d45 commit 32f02da

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

debian.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ install_cli_tools() {
8585

8686
if ! command -v terraform &> /dev/null || [ -n "$CI" ]
8787
then
88-
sudo apt update && sudo apt-get install --yes \
88+
sudo apt-get install --yes \
8989
gnupg \
9090
software-properties-common
9191

@@ -139,7 +139,7 @@ install_cli_tools() {
139139
mkdir -p "$ZSH_COMPLETIONS_DIR"
140140
just --completions zsh > "${ZSH_COMPLETIONS_DIR}/_just"
141141

142-
sudo apt update && sudo apt install --yes \
142+
sudo apt install --yes \
143143
direnv \
144144
dnsutils \
145145
fd-find \
@@ -177,7 +177,7 @@ install_cli_tools() {
177177
install_ssh_tooling_and_configure_ssh() {
178178
print_large "Installing SSH tooling and configuring SSH..."
179179

180-
sudo apt update && sudo apt install --yes \
180+
sudo apt install --yes \
181181
keychain \
182182
openssh-client
183183

@@ -201,7 +201,7 @@ install_language_toolchains() {
201201
install_base_build_packages() {
202202
print_large "Installing general base and build packages..."
203203

204-
sudo apt update && sudo apt install --yes \
204+
sudo apt install --yes \
205205
apt-transport-https \
206206
build-essential \
207207
ca-certificates \
@@ -264,7 +264,7 @@ install_language_toolchains() {
264264

265265
if ! command -v python3 &> /dev/null || [ -n "$CI" ]
266266
then
267-
sudo apt update && sudo apt install --yes \
267+
sudo apt install --yes \
268268
python3 \
269269
python3-ipython \
270270
python3-pip \
@@ -279,7 +279,7 @@ install_language_toolchains() {
279279
fi
280280

281281
# https://github.com/pyenv/pyenv/issues/678
282-
sudo apt update && sudo apt install libsqlite3-dev
282+
sudo apt install libsqlite3-dev
283283
if ! command -v pyenv &> /dev/null || [ -n "$CI" ]
284284
then
285285
# https://github.com/pyenv/pyenv/tree/96f93fd5531afa2fb5a826c92770293e500f9ab6#automatic-installer
@@ -300,7 +300,7 @@ install_language_toolchains() {
300300

301301
if ! command -v npm &> /dev/null || [ -n "$CI" ]
302302
then
303-
sudo apt update && sudo apt install nodejs
303+
sudo apt install nodejs
304304
fi
305305

306306
print_large "npm installed successfully."
@@ -317,6 +317,8 @@ install_language_toolchains() {
317317
main() {
318318
print_large "Provisioning system..."
319319

320+
sudo apt update # Single global update, not per step
321+
320322
install_language_toolchains
321323
install_ssh_tooling_and_configure_ssh
322324
install_and_configure_shell

0 commit comments

Comments
 (0)