Skip to content

Commit 4a07a38

Browse files
committed
chore(scripts/archlinux_util): Update pacman commands to disable download timeout
1 parent 1cceabc commit 4a07a38

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/archlinux_util.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,19 @@ _refresh_and_sort_mirrors() {
147147

148148
# Install reflector if it's not installed
149149
if ! command -v reflector >/dev/null 2>&1; then
150-
pacman -Sy --noconfirm reflector
150+
pacman -Sy --noconfirm --disable-download-timeout reflector
151151
fi
152152

153153
# Install rsync if it's not installed
154154
if ! command -v rsync >/dev/null 2>&1; then
155-
pacman -Sy --noconfirm rsync
155+
pacman -Sy --noconfirm --disable-download-timeout rsync
156156
fi
157157

158158
# Use reflector to sort the mirrors by speed and update the mirrorlist file
159159
reflector --verbose --latest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
160160

161161
# Refresh the package lists
162-
pacman -Sy
162+
pacman -Sy --disable-download-timeout
163163
echo_ok "Package lists refreshed and mirrors sorted by speed."
164164
_set_and_persist "_ARCH_MIRRORLIST_UPDATED" "true"
165165
}
@@ -180,7 +180,8 @@ _init_pacman_keyring() {
180180

181181
# Upgrade system
182182
echo_msg "Upgrading system..."
183-
pacman -Sy --needed --noconfirm archlinux-keyring && pacman -Su --noconfirm
183+
pacman -Sy --needed --noconfirm --disable-download-timeout archlinux-keyring &&
184+
pacman -Su --noconfirm --disable-download-timeout
184185
echo_ok "System upgraded."
185186
fi
186187
}
@@ -196,7 +197,7 @@ check_and_install_packages() {
196197

197198
echo_msg "Installing and updating packages ($*)..."
198199
if ! pacman -Syu --needed --noconfirm --disable-download-timeout "$@"; then
199-
echo "Failed to install or update packages. If you're getting an error about a missing secret key, you might need to manually import the key. Refer to the Arch Linux wiki for more information: https://wiki.archlinux.org/title/Pacman/Package_signing#Adding_unofficial_keys"
200+
echo "Failed to install or update packages."
200201
exit 1
201202
fi
202203

0 commit comments

Comments
 (0)