You are not logged in.

#1 2025-07-08 01:38:48

foobarDestroyer
Member
Registered: 2025-07-08
Posts: 10

[ SOLVED ] [ Offline - Internetless ] Arch Linux live USB installation

PREFACE WARNING: This is a long and informative post smile
What is attempting to be accomplished
  • An offline (100% no internet connection) installation of Arch Linux from/off of a USB storge medium device

The desired method to be utilized (no other)
  • Offline ("local"), custom repository, stored on a USB device

ArchWiki, ArchLinux and other URLs read
  1. https://wiki.archlinux.org/title/USB_fl … ion_medium

  2. https://wiki.archlinux.org/title/Pacman/Tips_and_tricks

  3. https://wiki.archlinux.org/title/Offline_installation

  4. https://wiki.archlinux.org/title/Enviro … iables#pwd

  5. https://wiki.archlinux.org/title/Pacman/Package_signing

  6. https://archlinux.org/download/

  7. https://aur.archlinux.org/packages/keyring

  8. https://bbs.archlinux.org/viewtopic.php … 38#p463238

  9. https://bbs.archlinux.org/viewtopic.php?id=30431

  10. https://bbs.archlinux.org/viewtopic.php?id=303370

  11. https://bbs.archlinux.org/viewtopic.php?id=216708

  12. https://www.reddit.com/r/archlinux/comm … tallation/

  13. https://man.archlinux.org/man/repo-add.8.en

  14. https://wiki.archlinux.org/title/Pacman

Major bug note regarding pacman since pacman v7.0.0

The "CacheDir" option will error out if "." is used instead of a fully qualified path; E.G: --cachedir = /foo/bar/ vs --cachedir = . (produces an error)

What I have last attempted and the results

Mounted a USB storage medium device (FAT32 and EXT4 filesystems, respectively), verified with lsblk and executed the following:

mkdir /usb/foobar
cd /usb/foobar
pacman -Syw --cachedir /usb/foobar --dbpath /usb/foobar iw
repo-add $PWD/custom.db.tar.zst $PWD/*.pkg.tar.zst

Rebooted into the functional live Arch Linux USB and attempted to install the package (Intel Wireless; iw) offline via:

pacman -Sy iw
The result (paraphrased from memory):

Archlinux keyring out of date; no internet connection found

A quick reboot, amendment of archlinux-keyring and a retry later yields similar results (package verification/signature necessary; attempts to use the internet).

The pacman.conf on both the non-live install (harddrive/solid state drive) and live install (USB device) were modified; no sandbox, installing user is a real user (not alpm); the custom repo was enabled with the path modified and the block (order of repositories are linear; top to bottom; ascending order) reordered.

What I would NOT LIKE as a reply (none is preferred)

Suggestions of other methods (E.G: archinstall, squshfs, archiso, abs, etc
Suggestions of how to format/reformat my post/thread
An inquisition as to my decision making or reasons for selecting this particular method

What I WOULD LIKE as a reply (preferred)

A solution to using pacman, repo-add and a USB storage medium using the latest Arch Linux live ISO in conjunction with my preferred packages on an alternate partition ('persistent data' / 'modifiable USB') on the same USB storage device (simplified: Partition A contains the live Arch Linux ISO and partition B contains Nth GB/TB of read-write data).

Thank you very much in advance! smile

<--- ! EDIT: Solution provided below ! --->
Solution to the problem

Step 1. Creating a repository
CREATE A "custom" repository for localized (offline/intranet/internet) use

pacman -Syw --cachedir /mnt/foobar/cache --dbpath /tmp/blankdb base linux linux-firmware

Step 2a. Adding packages and package signatures

repo-add /var/pacman/cache *.ztd *.sig

Step 2b. Editing pacman configuration file
CREATE a custom repo (referred in /etc/pacman.conf literally as [NAME])

cd /var/pacman/cache (where all desired packages to be copied/saved/added/used are)
repo-add ./custom.db.tar.zst ./*[^sig]

Step 3. Editing pacman configuration file
MODIFY /etc/pacman.conf
/etc/pacman.conf "custom" is the "custom.db.tar.zst" file's name (as long as the filename matches: Everything works; pick what pleases you)

[custom]
SigLevel = Optional
Server = file:///mnt/foobar

Step 4. Using your custom repo for offline installation
FROM A live USB run: You can (100% offline) install ALL desired packages as usual

pacstrap -K /mnt base linux linux-firmware
NOTES
  1. Motherboard (CMOS/BIOS) time, system time (Arch Linux's timedatectl or hwclock) must agree and must agree with the file timestamps (inode meta data can be affected by ext3/ext4 options)

  2. archlinux-keyring MUST be up-to-date (pacman -S archlinux-keyring)

  3. pacman-key --init / populate / refresh should be ran AFTER archlinux-keyring (offline ONLY) is updated

  4. Absolute paths (see: echo $PWD) must be used instead of relative paths (see: .) until the bugfix is posted

User ALPM, sandbox, signature requirements and other related options should not cause a problem anymore; the repo can be stored on the USB itself or a storage medium or an intranet; pacman version 7+ was tested successfully under multiple conditions.

100% no internet connection required

Last edited by foobarDestroyer (Yesterday 00:29:06)

Offline

#2 2025-07-08 06:27:50

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 66,389

Re: [ SOLVED ] [ Offline - Internetless ] Arch Linux live USB installation

paraphrased from memory … pacman.conf on both the non-live install (harddrive/solid state drive) and live install (USB device) were modified … package verification/signature necessary; attempts to use the internet

https://bbs.archlinux.org/viewtopic.php?id=57855
How is anyone supposed to tell you why an unspecific setup fails with an undisclosed error?
"Because you did it wrong."

Start by posting the actual outputs reg. the problems you face.

Online

#3 2025-07-13 09:16:39

macromal
Member
Registered: 2024-08-03
Posts: 30

Re: [ SOLVED ] [ Offline - Internetless ] Arch Linux live USB installation

From another machine running Arch Linux with an internet connection, you can quickly create a custom repository and install the packages in just a few seconds.

mkdir repo && cd repo || exit 1
cp /var/cache/pacman/pkg/* .
repo-add ./custom.db.tar.gz ./*[!sig]

Transfer this folder to a external medium and uncomment the following settings in /etc/pacman.conf:

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
[custom]
SigLevel = Optional TrustAll
Server = file:///repo

You have to comment the core and extra repositories configuration too.

Offline

#4 Yesterday 00:24:40

foobarDestroyer
Member
Registered: 2025-07-08
Posts: 10

Re: [ SOLVED ] [ Offline - Internetless ] Arch Linux live USB installation

Solution to the problem

Step 1. Creating a repository
CREATE A "custom" repository for localized (offline/intranet/internet) use

pacman -Syw --cachedir /mnt/foobar/cache --dbpath /tmp/blankdb base linux linux-firmware

Step 2a. Adding packages and package signatures

repo-add /var/pacman/cache *.ztd *.sig

Step 2b. Editing pacman configuration file
CREATE a custom repo (referred in /etc/pacman.conf literally as [NAME])

cd /var/pacman/cache (where all desired packages to be copied/saved/added/used are)
repo-add ./custom.db.tar.zst ./*[^sig]

Step 3. Editing pacman configuration file
MODIFY /etc/pacman.conf
/etc/pacman.conf "custom" is the "custom.db.tar.zst" file's name (as long as the filename matches: Everything works; pick what pleases you)

[custom]
SigLevel = Optional
Server = file:///mnt/foobar

Step 4. Using your custom repo for offline installation
FROM A live USB run: You can (100% offline) install ALL desired packages as usual

pacstrap -K /mnt base linux linux-firmware
NOTES
  1. Motherboard (CMOS/BIOS) time, system time (Arch Linux's timedatectl or hwclock) must agree and must agree with the file timestamps (inode meta data can be affected by ext3/ext4 options)

  2. archlinux-keyring MUST be up-to-date (pacman -S archlinux-keyring)

  3. pacman-key --init / populate / refresh should be ran AFTER archlinux-keyring (offline ONLY) is updated

  4. Absolute paths (see: echo $PWD) must be used instead of relative paths (see: .) until the bugfix is posted

User ALPM, sandbox, signature requirements and other related options should not cause a problem anymore; the repo can be stored on the USB itself or a storage medium or an intranet; pacman version 7+ was tested successfully under multiple conditions

The Arch Linux installation can be entirely automated with minimal human interraction covering swaths of exponentally (N ^ 23 or so) different configurations using an overly simplified [key = value] dichtonomous set of options (nested when applicable) or an overly complicated yet acceptable JSON format (XML) style document to refer to all nestable options (BIOS/UEFI/Secure Boot/MBR/GPT/NVRAM firmware direct boot/intermediate bootloader/encrypted options/Linux kernels/unified kernel image/kernel options/kernel boot options/custom kernel/X/Wayland/terminal/WM/DE/packages stored (uninstalled)/packages installed (explicit/automatic/order controlled for later managerial usage)/multi-boot system (UNIX/Linux/Windows/emulator/other); this is not an all inclusive list.

Essentially hardware related packages (bloatware, effectively if not tailored to a target audience) can be automatically installed and configured in an ascending order for security sake as well as raw performance; makepkg, pacman and custom solutions are no exception; esentially a serverless, single-user desktop Wayland system can be automatically installed and fully configured from scratch from beginning to end in under 2min (with custom, high security/special CPU instruction set gcc/clang/other compiler/linker options); preferred binaries (official, AUR and other) are no exception.

A fully functional commercial enterprise (intranet) workstation environment (N * Y machines) can be simultaneously powered on remotely (PXE-boot) while offline and blank slates and configured to be as secure as possible (up to and including generalized client-level firewall settings and complex SYSLinux/AppArmor/PAM settings per general 'office worker category' topologically crafted).

A much lengthier version will not be posted after much consideration.

Thank you... This is 100% possible without any secondary machine using the internet nor even a primary machine at any point.

I hope this helps. smile

Last edited by foobarDestroyer (Yesterday 00:25:50)

Offline

Board footer

Powered by FluxBB