Manage Arch Linux packages like NPM
A pure Shell implementation of Arch Linux package management tool
APM is a simple and efficient Arch Linux package management tool that allows you to:
- Declaratively manage packages through configuration files
- Automatically install/uninstall packages
- Group management of different types of packages
- Automatically configure system and software
- Provide optional complex package configuration modules
APM uses yay as the default package manager backend by default, supporting installation of both Pacman and AUR packages.
You can switch to pacman or other helpers through configuration (see Custom Configuration).
.
├── packages.d/ # Grouped package configuration directory
├── conf.d/ # System configuration scripts directory
├── modules/ # Optional modules directory
├── packages.ini # Main package configuration file
├── setup.sh # Main installation script
├── func.sh # Utility function library
└── arch-installer.sh # Arch Linux installation script
Main package configuration file, each line represents a package. Supports sectioned configuration for packages from different sources:
[Pacman]
# Official repository packages
zsh
obsidian
vlc
[AUR]
# AUR packages
visual-studio-code-bin
wechat-universal-bwrapUse # or ; to add comments, supporting line comments and inline comments:
# UI theme
capitaine-cursors
papirus-icon-theme # Icon theme
; motrix # Disabled packageUsed for group management of packages, containing multiple .ini format files, each file can include a group of related packages. For example:
gnome.ini- GNOME desktop environment related packagesdev.ini- Development tools related packages
Contains configuration scripts in .sh format, used for system configuration and software initialization. These scripts will run automatically when executing setup.sh.
Implemented configurations include:
- Input method configuration (fcitx)
- Audio system configuration
- Temporary directory mounting
- Swap file configuration
- NTP time synchronization
- SSH service configuration
- Alias settings
Note: All configuration scripts are designed to be repeatable without side effects.
Contains optional complex package configuration modules, such as:
- Docker configuration
- NVIDIA driver configuration
- KVM virtualization configuration
- Samba file sharing configuration
- ZFS file system configuration
These modules need to be executed manually and will not run automatically when executing setup.sh.
For first-time use, execute the setup.sh script to install:
./setup.shThe script will:
- Check network connection
- Configure software sources
- Install AUR helper (yay)
- Install all packages defined in packages.ini and packages.d
- Execute all configuration scripts in the conf.d directory
- Create the
apmcommand alias
After executing setup.sh for the first time, an apm alias will be set in the shell configuration file, and you can directly use the apm command to update the system:
apmEach time the apm command is executed, the script will:
- Compare the current configuration with the differences from the last execution
- Install newly added packages
- Uninstall removed packages
- Execute configuration scripts
You can change the package manager backend in two ways:
# 1. Modify the default backend in setup.sh
apm="yay" # Can be changed to "pacman" or another AUR helper
# 2. Or override via environment variable when running
APM_BACKEND=pacman ./setup.sh
# After the alias is created, you can also run:
APM_BACKEND=pacman apmAll configuration scripts are designed to be repeatable without side effects. Each configuration script checks if it has already been configured before execution to avoid repeated configuration.
arch-installer.sh is a script for automating the installation of Arch Linux systems.
Note: This script performs a UEFI installation. If your machine does not support this installation method, do not execute it or modify the script before execution.
# Basic usage
arch-installer.sh -h hostname -u username -p password installation_disk
# Example
arch-installer.sh -h myarch -u alex -p mypassword /dev/sda
# Manually mount partitions
arch-installer.sh -D -h hostname -u username -p password
# Parameter description
-h hostname
-u username (if not specified, no new user will be created)
-p password (if not specified, the default password is 0000)
-D do not specify installation disk, manually mount the partitions to be installed to the /mnt directoryThe script will automatically perform the following steps:
- Partition and format the disk (EFI, root partition, and home partition)
- Mount file systems
- Install the basic system
- Configure the system (timezone, language, hostname, etc.)
- Install the bootloader
- Set up user and password
Issues and Pull Requests are welcome to improve this project. Before submitting code, please ensure:
- All scripts can be executed repeatedly without side effects
- Configuration file formats comply with project specifications
- Add appropriate comments and documentation
This project is licensed under the MIT License.