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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How to cancel or pause live migrations using virsh
  2. i3status: command not found
  3. How to change the default permissions on /var/log/audit/audit.log file in CentOS/RHEL
  4. UNIX / Linux : How to delete root equivalent user (Non-Root User with UID 0)
  5. List of SELinux Utilities
  6. fsck: command not found
  7. Rsyslog : How to Send log files to remote server in CentOS/RHEL 6,7
  8. blastn: command not found
  9. How to Partition DM-Multipath Pseudo Devices in CentOS/RHEL
  10. CentOS / RHEL 6 : How to configure 802.1q VLAN On NIC

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright