Arch Linux: Install Packages from CD / DVD or USB Device

I was wondering if it was possible to use a CD / DVD or a device USB as a repository of Pacman, Arch's package manager and derivatives ... and the answer is: of course.

Download the packages

First of all, you have to download the packages and save them in a folder, which we will then copy to our CD / DVD or USB device:

cd ~ / Packages
pacman -Syw base base-devel grub-bios xorg gimp --cachedir.
repo-add ./custom.db.tar.gz ./*

Don't forget that you have to replace the packages used together with the pacman command in the previous example. Instead, you have to put the names of the packages you want to download.

All that remains is to "burn" the Packages folder or copy its contents to a USB device.

Installation

1.- Mount the USB / CD device:

mkdir / mnt / repo
mount / dev / sr0 / mnt / repo #For a CD / DVD
mount / dev / sdxY / mnt / repo #For a USB device.

In case you are using a USB stick, don't forget to replace sdxY with the correct name, for example sdb1. It is possible to see a list of devices using the command sudo fdisk-l.

2.- Then you have to edit pacman.conf and add the device as a repository. It is important to place it before the rest of the repositories (extra, core, etc.). In this way, we ensure that the files on the CD / DVD / USB take a higher level of precedence than those found in the other repositories:

nano /etc/pacman.conf

[custom] SigLevel = PackageRequired
Server = file: /// mnt / repo / Packages

3.- Finally, you have to synchronize the pacman database:

pacman -Sy

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   mcder3 said

    Very good information, this makes it easier to install Archlinux on a pc without internet 😀