Get rid of all naked -Sy usage

This commit is contained in:
David Heinemeier Hansson
2025-08-27 14:52:38 +02:00
parent 4cbc8eef43
commit 20ab2ee81e
15 changed files with 13 additions and 26 deletions

View File

@@ -6,7 +6,7 @@ if [[ -z "$1" ]]; then
fi
install_php() {
sudo pacman -Sy php composer php-sqlite --noconfirm
sudo pacman -S php composer php-sqlite --noconfirm
# Install Path for Composer
if [[ ":$PATH:" != *":$HOME/.config/composer/vendor/bin:"* ]]; then

View File

@@ -2,7 +2,7 @@
echo "Adding multilib repository for 32-bit compatibility"
sudo sed -i '/^\s*#\[multilib\]/,/^$/{s/^\s*#//}' /etc/pacman.conf
sudo pacman -Sy
sudo pacman -Syu
echo "Now pick dependencies matching your graphics card"
sudo pacman -S steam

View File

@@ -18,7 +18,7 @@ pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}")
if [[ -n "$pkg_names" ]]; then
# Convert newline-separated selections to space-separated for yay
echo "$pkg_names" | tr '\n' ' ' | xargs yay -Sy --noconfirm
echo "$pkg_names" | tr '\n' ' ' | xargs yay -S --noconfirm
sudo updatedb
omarchy-show-done
fi

View File

@@ -14,12 +14,11 @@ fzf_args=(
--color 'pointer:green,marker:green'
)
sudo pacman -Sy
pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}")
if [[ -n "$pkg_names" ]]; then
# Convert newline-separated selections to space-separated for yay
echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -Sy --noconfirm
echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm
sudo updatedb
omarchy-show-done
fi

View File

@@ -36,7 +36,7 @@ if [ -n "$(lspci | grep -i 'nvidia')" ]; then
fi
# force package database refresh
sudo pacman -Sy
sudo pacman -Syu
# Install packages
PACKAGES_TO_INSTALL=(

View File

@@ -37,9 +37,3 @@ if [[ "$(uname -m)" == "x86_64" ]] && [ -z "$DISABLE_CHAOTIC" ]; then
echo -e "Failed to install Chaotic-AUR, so won't include it in pacman config!"
fi
fi
# Allow repository index updates without sudo
sudo tee /etc/sudoers.d/repositories >/dev/null <<EOF
$USER ALL=(ALL) NOPASSWD: /usr/bin/pacman -Sy
EOF
sudo chmod 440 /etc/sudoers.d/repositories

View File

@@ -3,5 +3,5 @@ echo "Add Omarchy Package Repository"
if ! grep -q "omarchy" /etc/pacman.conf; then
sudo sed -i '/^\[core\]/i [omarchy]\nSigLevel = Optional TrustAll\nServer = https:\/\/pkgs.omarchy.org\/$arch\/\n' /etc/pacman.conf
sudo systemctl restart systemd-timesyncd
sudo pacman -Sy
sudo pacman -Syu
fi

View File

@@ -1,4 +1,4 @@
echo "Install Plymouth splash screen"
sudo pacman -Sy --needed --noconfirm uwsm plymouth
sudo pacman -Syu --needed --noconfirm uwsm plymouth
source "$HOME/.local/share/omarchy/install/login/plymouth.sh"

View File

@@ -1,7 +1,7 @@
echo "Replace wofi with walker as the default launcher"
if ! command -v walker &>/dev/null; then
sudo pacman -Sy --noconfirm --needed walker-bin libqalculate
sudo pacman -Syu --noconfirm --needed walker-bin libqalculate
sudo pacman -Rns --noconfirm wofi
rm -rf ~/.config/wofi

View File

@@ -11,7 +11,7 @@ if [[ "$(uname -m)" == "x86_64" ]] && ! grep -q '^\[chaotic-aur\]' /etc/pacman.c
echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null
# Refresh pacman package databases
sudo pacman -Sy
sudo pacman -Syu
else
echo "Failed to install Chaotic-AUR, so won't include it in pacman config!"
fi

View File

@@ -1,3 +1,3 @@
echo "Add xmlstarlet needed for updating fonts via Omarchy menu"
sudo pacman -Sy --noconfirm --needed xmlstarlet
sudo pacman -Syu --noconfirm --needed xmlstarlet

View File

@@ -1,4 +1,4 @@
echo "Update and restart Walker to resolve stuck Omarchy menu"
sudo pacman -Sy --noconfirm walker-bin
sudo pacman -Syu --noconfirm walker-bin
omarchy-restart-walker

View File

@@ -11,7 +11,7 @@ set_theme_colors() {
if command -v chromium &>/dev/null; then
sudo pacman -Rns --noconfirm chromium || true
sudo pacman -Sy --noconfirm omarchy-chromium
sudo pacman -Syu --noconfirm omarchy-chromium
if pgrep -x chromium; then
if gum confirm "Chromium must be restarted. Ready?"; then

View File

@@ -1,3 +1,3 @@
echo "Ensure latest uwsm is installed"
sudo pacman -Sy --noconfirm uwsm
sudo pacman -Syu --noconfirm uwsm

View File

@@ -1,6 +0,0 @@
echo "Allow pacman -Sy without sudo to easier installs"
sudo tee /etc/sudoers.d/repositories >/dev/null <<EOF
$USER ALL=(ALL) NOPASSWD: /usr/bin/pacman -Sy
EOF
sudo chmod 440 /etc/sudoers.d/repositories