Linux command
pacstrap 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo pacstrap /mnt base linux linux-firmware
Example
sudo pacstrap /mnt base base-devel linux-lts
Example
sudo pacstrap -P /mnt [packages]
Example
sudo pacstrap -C [path/to/pacman.conf] /mnt [packages]
Example
sudo pacstrap -c /mnt [packages]
Example
sudo pacstrap -K /mnt [packages]
Example
sudo pacstrap -i /mnt [packages]
说明
pacstrap is designed to create a new system installation from scratch. It installs packages to a specified new root directory, typically used during Arch Linux installation to bootstrap the base system. The tool handles mounting the target filesystem, installing packages using pacman, and optionally copying the host's configuration. It is part of the arch-install-scripts package.
参数
- -C _config_
- Use alternate pacman configuration file
- -c
- Use package cache on host instead of target
- -G
- Avoid copying host's pacman keyring to target
- -i
- Prompt for package confirmation (interactive mode)
- -K
- Initialize empty pacman keyring in target
- -M
- Avoid copying host's mirrorlist to target
- -N
- Run in unshare mode as regular user
- -P
- Copy host's pacman config to target
FAQ
What is the pacstrap command used for?
pacstrap is designed to create a new system installation from scratch. It installs packages to a specified new root directory, typically used during Arch Linux installation to bootstrap the base system. The tool handles mounting the target filesystem, installing packages using pacman, and optionally copying the host's configuration. It is part of the arch-install-scripts package.
How do I run a basic pacstrap example?
Run `sudo pacstrap /mnt base linux linux-firmware` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -C _config_ do in pacstrap?
Use alternate pacman configuration file