Skip to main content

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

1

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)"
2

Install echo_separate Helper

Ensure the echo_separate utility is in your PATH:
chmod +x ~/workspace/source/bin/echo_separate
3

Make Update Executable

chmod +x ~/workspace/source/bin/update
4

Add to PATH

echo 'export PATH="$HOME/workspace/source/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Syntax

update [OPTIONS]

Options

--all
flag
Include VS Code Insiders AUR package rebuild and installation

Usage Examples

# Run all standard updates
update
Updates:
  • System packages (yay -Syyu)
  • tldr pages database
  • zinit plugins

What Gets Updated

1

Package Database Sync (yay)

yay -Syyu
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
2

Documentation (tldr)

tldr -u
Updates:
  • Community-maintained command examples
  • Simplified man pages
  • Latest command usage patterns
3

Zsh Plugins (zinit)

zinit update
Updates:
  • All installed zinit plugins
  • Zsh themes
  • Plugin dependencies
4

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

Output Format

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...
...

Commented Features

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

# Add after zinit update
echo_separate "rustup"
rustup update

Custom Update Script

#!/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

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

Dependency Reference

Required Tools

yay

AUR helper and pacman wrapper
# Install from AUR
git clone https://aur.archlinux.org/yay.git
cd yay && makepkg -si

tldr

Simplified man pages
yay -S tldr

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
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
Verify zinit installation:
# Check zinit is loaded in .zshrc
grep zinit ~/.zshrc

# Manually update
zinit self-update
zinit update
Clean build cache and retry:
rm -rf ~/.cache/yay/visual-studio-code-insiders-bin
yay -S visual-studio-code-insiders-bin

Performance Tips

Parallel Downloads: Enable parallel downloads in /etc/pacman.conf:
ParallelDownloads = 5
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

Build docs developers (and LLMs) love