• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pacstrap Command Examples in Linux

by Deepika

“pacstrap” is a script included in the Arch Linux distribution that is used to install packages to a new root directory. This script is run during the initial installation process and is used to set up the base system by installing a minimal set of packages. The “pacstrap” script can also be run later to add additional packages to the system. The script takes as its argument the path to the root directory to which packages should be installed, as well as a list of packages to install. The packages specified will be downloaded and installed, along with any dependencies they have. This makes “pacstrap” a useful tool for installing a custom Arch Linux system, for example on a disk partition or in a virtual machine.

pacstrap Command Examples

1. Install the `base` package, Linux kernel and firmware for common hardware:

# pacstrap path/to/new/root base linux linux-firmware

2. Install the `base` package, Linux LTS kernel and `base-devel` build tools:

# pacstrap path/to/new/root base base-devel linux-lts

3. Install packages without copy the host’s mirrorlist to the target:

# pacstrap -M path/to/new/root packages

4. Use an alternate configuration file for Pacman:

# pacstrap -C path/to/pacman.conf path/to/new/root packages

5. Install packages using the package cache on the host instead of on the target:

# pacstrap -c path/to/new/root packages

6. Install packages without copy the host’s pacman keyring to the target:

# pacstrap -G path/to/new/root packages

7. Install packages in interactive mode (prompts for confirmation):

# pacstrap -i path/to/new/root packages

8. Install packages using package files:

# pacstrap -U path/to/new/root path/to/package1 path/to/package2

Filed Under: Linux

Some more articles you might also be interested in …

  1. ganache-cli: Command-line version of Ganache, your personal blockchain for Ethereum development
  2. setfacl Command Examples in Linux
  3. mkpasswd Command Examples in Linux
  4. clang-format: Tool to auto-format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code
  5. locate: command not found
  6. zip Command Examples in Linux
  7. Rabbitmq install and management
  8. CentOS / RHEL 6 : How to completely remove device mapper multipath (dm-multipath)
  9. javac Command Examples
  10. deluge: A command-line BitTorrent client

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright