-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharch-install-update.bash
More file actions
188 lines (174 loc) · 8.12 KB
/
arch-install-update.bash
File metadata and controls
188 lines (174 loc) · 8.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#!/usr/bin/env bash
## name: arch-install-update.bash
## author: Dat (and AI)
## description: Arch Linux package synchronization and system update script
## usage: bash arch-install-packages.sh
set -e
# Install reflector if not already present (required for mirror update)
sudo pacman -S --needed --noconfirm reflector
# Update mirrorlist with faster and more reliable mirrors
echo "Updating Mirrorlist..."
sudo reflector \
--country 'Turkey,Germany,Bulgaria,Romania,Greece' \
--age 12 \
--protocol https \
--latest 12 \
--sort rate \
--save /etc/pacman.d/mirrorlist
echo "Synchronizing package databases and upgrading the system..."
# Install yay from AUR if not already present
if ! command -v yay &> /dev/null; then
echo "yay not found → installing..."
sudo pacman -S --needed --noconfirm git base-devel
git clone https://aur.archlinux.org/yay.git /tmp/yay
(cd /tmp/yay && makepkg -si --noconfirm)
rm -rf /tmp/yay
fi
# Package list
declare -a PACKAGES=(
"acpid" # ACPI power management daemon
"base" # Minimal package set for base Arch system
"base-devel" # Essential development tools (make, gcc, etc.)
"efibootmgr" # EFI boot manager
"git" # Distributed version control
"grub" # GRUB bootloader
"linux" # Default Linux kernel
"linux-firmware" # Firmware files for hardware
"linux-headers" # Kernel headers (needed for DKMS, etc.)
"reflector" # Updates mirrorlist for faster downloads
"sudo" # Allow privilege escalation
"yay" # AUR helper
"curl" # Transferring data with URLs
"bleachbit" # System cleaner
"btrfs-progs" # Tools for Btrfs filesystem
"dosfstools" # Tools for FAT filesystems
"snapper" # A tool for managing BTRFS and LVM snapshots
"btrfs-assistant" # BTRFS subvolumes and Snapper snapshot manager (AUR)
"grub-btrfs" # Btrfs snapshot support in GRUB (AUR)
"snap-pac" # Pacman hooks that use snapper to create pre/post btrfs snapshots (AUR)
"inotify-tools" # Filesystem events monitoring component
"zram-generator" # Compressed swap in RAM
"man-db" # Man pages database
"fastfetch" # Modern neofetch alternative
"htop" # Interactive process viewer
"rsync" # Fast incremental file transfer
"xdg-user-dirs" # Creates standard user directories
"less" # Pager program
"jq" # JSON processor
"fuse2" # AppImage Executer
"python-mutagen" # Python audio metadata library
"caligula" # Disk burning tool
"pacman-contrib" # Pacman cache cleaner utility
"tldr" # Tealdeer tldr manual for apps
"kid3-qt" # An MP3, Ogg/Vorbis and FLAC tag editor
"bc" # basic calculator
"networkmanager" # Network connection manager
"network-manager-applet" # NetworkManager tray applet
"iptables-nft" # nftables-based iptables
"bluez" # Bluetooth protocol stack
"bluez-utils" # Bluetooth tools
"blueman" # Bluetooth manager (GUI)
"pipewire" # Modern audio/video server
"pipewire-alsa" # Pipewire ALSA compatibility
"pipewire-jack" # Pipewire JACK replacement
"pipewire-pulse" # Pipewire PulseAudio replacement
"pipewire-v4l2" # Pipewire V4L2 support
"pipewire-zeroconf" # Pipewire Zeroconf support
"pavucontrol" # Audio mixer
"sof-firmware" # Intel Sound Open Firmware
"brightnessctl" # Control backlight brightness
"intel-ucode" # Intel CPU microcode updates
"nvidia-open-dkms" # NVIDIA open-source kernel modules
"nvidia-settings" # NVIDIA X Server Settings
"cuda" # Nvidia cuda support
"hyprland" # Dynamic Wayland compositor
"hyprcursor" # Hyprland cursor theme engine
"hypridle" # Hyprland idle daemon
"hyprlock" # Screen locker for Hyprland
"hyprpaper" # Wallpaper utility for Hyprland
"hyprpolkitagent" # Polkit agent for Hyprland
"sddm" # Simple Desktop Display Manager
"kitty" # GPU-accelerated terminal
"waybar" # Customizable Wayland bar
"wofi" # Wayland application launcher
"qt5-wayland" # Wayland Qt5 support
"qt6-wayland" # Wayland Qt6 support
"wl-clipboard" # Wayland clipboard
"kvantum" # Qt styling engine
"kvantum-qt5" # Kvantum for Qt5
"qt5ct" # Qt5 configuration tool
"qt6ct" # Qt6 configuration tool
"nwg-look" # GTK theme manager
"hyprshot" # Screenshotter tool for hyprland
"ydotool" # command line keyboard automation tool
"firefox" # Mozilla Firefox browser
"chromium" # Chromium web browser
"thunar" # File manager for Xfce
"thunar-archive-plugin" # Archive integration for Thunar
"xarchiver" # Archive manager (GUI)
"unzip" # ZIP decompressor
"zip" # ZIP archiver
"udiskie" # Removable device automounter
"gvfs-mtp" # MTP support for GVFS
"localsend" # Local file sharing app
"qbittorrent" # BitTorrent client
"vlc" # Media player
"vlc-plugins-all" # All VLC plugins
"ffmpeg" # Multimedia framework
"metadata-cleaner" # Metadata searcyh and clean GUI
"pastel" # GUI color analyzer/generator
"neovim" # Vim fork focused on extensibility
"vim" # Vi improved text editor
"visual-studio-code-bin" # VScode IDE
"netbeans" # Java IDE
"libreoffice-fresh" # LibreOffice office suite
"steam" # Gaming platform
"wine" # Windows compatibility layer
"an-anime-game-launcher-bin" # Genshin impact starter
"prismlauncher" # Minecraft launcher
"retroarch" # Frontend for emulators
"retroarch-assets-ozone" # RetroArch Ozone assets
"retroarch-assets-xmb" # RetroArch XMB assets
"libretro-mgba" # mGBA libretro core
"calibre" # E-book library management
"yt-dlp-git" # YouTube downloader
"mousai" # Song identification tool
"pokeget" # Pokémon CLI utility
"komikku" # Comic,Manga,Mahnwa,Manhua Reader/Downloader
"noto-fonts" # Noto font family
"noto-fonts-emoji" # Noto emoji fonts
"ttf-nerd-fonts-symbols" # Nerd Fonts symbols
"ttf-nerd-fonts-symbols-mono" # Monospace Nerd Fonts symbols
"woff2-font-awesome" # Font Awesome web fonts
)
# Extract only package names while preserving comments in the list above
PACKAGE_NAMES=()
for item in "${PACKAGES[@]}"; do
pkg=$(echo "$item" | awk '{print $1}' | grep -v '^$')
[[ -n "$pkg" ]] && PACKAGE_NAMES+=("$pkg")
done
echo "Installing/updating defined packages..."
yay -Syyu --needed "${PACKAGE_NAMES[@]}"
# Check for explicitly installed packages not defined in the script
echo "Checking for extra packages not defined in the script..."
INSTALLED_EXPLICIT=$(pacman -Qqe)
TO_REMOVE=()
for pkg in $INSTALLED_EXPLICIT; do
[[ " ${PACKAGE_NAMES[@]} " =~ " $pkg " ]] || TO_REMOVE+=("$pkg")
done
if [[ ${#TO_REMOVE[@]} -gt 0 ]]; then
echo "The following packages are installed but not in the script list:"
printf '%s\n' "${TO_REMOVE[@]}"
read -p "Remove them? (y/N): " confirm
[[ "$confirm" =~ ^[Yy]$ ]] && yay -Rns "${TO_REMOVE[@]}" --noconfirm && echo "Extra packages removed."
else
echo "Your system is fully in sync with the script. No extra packages found."
fi
# Cleaning
echo "Cleaning old pacman packages..."
sudo rm -rf /var/cache/pacman/pkg/download-*
echo "Cleaning orphan packages..."
yay -Yc --noconfirm # Clean orphan packages
echo "Cleaning pacman cache..."
yay -Sc --noconfirm # Clean package cache
echo "Process completed!"