Overview
update is a zsh-based system update utility that orchestrates updates across multiple package managers, tools, and plugin systems in a single command. Designed specifically for Arch Linux systems using yay as the AUR helper.
This utility combines yay, tldr, and zinit updates into a streamlined workflow with visual section separators.
Features
Update all system packages via yay (AUR + official repos)
Refresh tldr pages database
Update zinit zsh plugins
Optional VS Code Insiders build from AUR
Visual section separators for clear output
Non-interactive updates with auto-confirmation
Installation
Prerequisites
Install required dependencies: # Install yay (AUR helper)
sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
# Install tldr
yay -S tldr
# Install zinit (if using zsh)
bash -c "$( curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
Install echo_separate Helper
Ensure the echo_separate utility is in your PATH: chmod +x ~/workspace/source/bin/echo_separate
Make Update Executable
chmod +x ~/workspace/source/bin/update
Add to PATH
echo 'export PATH="$HOME/workspace/source/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Syntax
Options
Include VS Code Insiders AUR package rebuild and installation
Usage Examples
Standard Update
Full Update
# Run all standard updates
update
Updates:
System packages (yay -Syyu)
tldr pages database
zinit plugins
# Include VS Code Insiders
update --all
Updates everything plus:
Rebuilds VS Code Insiders from AUR
Installs updated package
What Gets Updated
Package Database Sync (yay)
Updates:
Syncs package databases
Refreshes all packages
Includes AUR packages
Updates official Arch packages
Double -y forces refresh even if databases appear up-to-date
Documentation (tldr)
Updates:
Community-maintained command examples
Simplified man pages
Latest command usage patterns
Zsh Plugins (zinit)
Updates:
All installed zinit plugins
Zsh themes
Plugin dependencies
VS Code Insiders (--all only)
cd ~/.cache/yay/visual-studio-code-insiders-bin
makepkg -si --noconfirm
Updates:
Rebuilds latest VS Code Insiders
Installs without confirmation
Uses cached build directory
Source Code
#!/usr/bin/env zsh
[ " $1 " = "--all" ] && echo_separate "makepkg vscode insiders" \
&& cd ~/.cache/yay/visual-studio-code-insiders-bin \
&& makepkg -si --noconfirm
echo_separate "yay -Syu"
yay -Syyu
echo_separate "tldr -u"
tldr -u
echo_separate "zinit"
zinit update
# echo_separate "doom upgrade"
# doom -y upgrade
# echo_separate "cabal update"
# cabal update
The utility uses echo_separate to create visual section headers:
==== yay -Syu ==========================================
:: Synchronizing package databases...
core is up to date
extra is up to date
...
==== tldr -u ==========================================
Successfully updated local database
==== zinit ============================================
Updating plugins...
...
The script includes commented-out sections for additional tools:
# echo_separate "doom upgrade"
# doom -y upgrade
Uncomment to enable automatic Doom Emacs framework updates: doom -y upgrade # Non-interactive Doom Emacs upgrade
# echo_separate "cabal update"
# cabal update
Uncomment for Haskell development: cabal update # Update Haskell package index
Advanced Customization
Adding More Update Sections
Rust Toolchain
Node.js Packages
Python Packages
Flatpak
# Add after zinit update
echo_separate "rustup"
rustup update
Custom Update Script
Basic Template
With Error Handling
With Logging
#!/usr/bin/env zsh
# Your custom updates
echo_separate "Custom Section"
# Your commands here
# Include original updates
echo_separate "yay -Syu"
yay -Syyu
echo_separate "tldr -u"
tldr -u
echo_separate "zinit"
zinit update
#!/usr/bin/env zsh
set -e # Exit on error
update_section () {
echo_separate " $1 "
if ! $2 ; then
echo "Error updating $1 "
return 1
fi
}
update_section "yay" "yay -Syyu"
update_section "tldr" "tldr -u"
update_section "zinit" "zinit update"
#!/usr/bin/env zsh
LOGFILE = " $HOME /.cache/update-log-$( date +%Y%m%d-%H%M%S).txt"
{
echo_separate "yay -Syu"
yay -Syyu
echo_separate "tldr -u"
tldr -u
echo_separate "zinit"
zinit update
} 2>&1 | tee " $LOGFILE "
echo "\nLog saved to: $LOGFILE "
Common Workflows
Daily Update Routine
# Quick morning update
update
Weekly Full Update
# Include everything, then reboot
update --all
sudo systemctl reboot
Automated Updates
Create service file /etc/systemd/system/update-system.service: [Unit]
Description =System Update Service
[Service]
Type =oneshot
User =yourusername
ExecStart =/home/yourusername/workspace/source/bin/update
Create timer file /etc/systemd/system/update-system.timer: [Unit]
Description =Daily System Update
[Timer]
OnCalendar =daily
Persistent =true
[Install]
WantedBy =timers.target
Enable timer: sudo systemctl enable update-system.timer
sudo systemctl start update-system.timer
# Edit crontab
crontab -e
# Add daily update at 2 AM
0 2 * * * /home/yourusername/workspace/source/bin/update >> /home/yourusername/.cache/update.log 2>&1
Dependency Reference
yay AUR helper and pacman wrapper # Install from AUR
git clone https://aur.archlinux.org/yay.git
cd yay && makepkg -si
zinit Zsh plugin manager bash -c "$( curl -fsSL https://git.io/zinit-install)"
echo_separate Custom output formatter # Included in bin directory
chmod +x ~/workspace/source/bin/echo_separate
Troubleshooting
Install yay AUR helper: sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
echo_separate: command not found
Ensure helper script is in PATH: ls -la ~/workspace/source/bin/echo_separate
chmod +x ~/workspace/source/bin/echo_separate
echo $PATH # Verify bin directory is included
zinit not updating plugins
Verify zinit installation: # Check zinit is loaded in .zshrc
grep zinit ~/.zshrc
# Manually update
zinit self-update
zinit update
VS Code Insiders build fails
Clean build cache and retry: rm -rf ~/.cache/yay/visual-studio-code-insiders-bin
yay -S visual-studio-code-insiders-bin
Parallel Downloads : Enable parallel downloads in /etc/pacman.conf:
Faster Mirrors : Use reflector to optimize mirror list:sudo pacman -S reflector
sudo reflector --country US --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
Unattended Updates : Be cautious with fully automated updates on production systems. Manual review is recommended for critical systems.
See Also
stot Dotfile management utility
Overview All command-line utilities
yay Documentation Official yay documentation
Arch Wiki Arch Linux update best practices