This method is based on [[User:Byte|byte's]] post from [http://bbs.archlinux.org/viewtopic.php?id=30431 this] thread.

+

This method is based on [[User:Byte|byte's]] post from [https://bbs.archlinux.org/viewtopic.php?id=30431 this] thread.

Download the package databases on a computer with internet access and transfer them to your computer.

Download the package databases on a computer with internet access and transfer them to your computer.

Line 31:

Line 31:

Following steps will make sure you're working with up-to-date package lists, as if you ran <code>pacman -Sy</code>.

Following steps will make sure you're working with up-to-date package lists, as if you ran <code>pacman -Sy</code>.

−

On home PC , do the following as root:

+

On offline PC , do the following as root:

<pre>

<pre>

mkdir -p /var/lib/pacman/sync/{core,extra,community}

mkdir -p /var/lib/pacman/sync/{core,extra,community}

Line 42:

Line 42:

cp core.db /var/lib/pacman/sync/

cp core.db /var/lib/pacman/sync/

cp extra.db /var/lib/pacman/sync/

cp extra.db /var/lib/pacman/sync/

−

cp community /var/lib/pacman/sync/

+

cp community.db /var/lib/pacman/sync/

</pre>

</pre>

pacman -Sp --noconfirm package-name > pkglist

pacman -Sp --noconfirm package-name > pkglist

Line 87:

Line 87:

==== Transfer the packages ====

==== Transfer the packages ====

−

Now all the packages have been downloaded, you don't need 'Al' anymore. Copy the contents of /path/to/nvidia to a the temporary nvidia packages cache directory on 'Bob', let's say this folder is called /home/me/nvidia:

+

Now all the packages have been downloaded, you do not need 'Al' anymore. Copy the contents of /path/to/nvidia to a the temporary nvidia packages cache directory on 'Bob', let's say this folder is called /home/me/nvidia:

<pre>

<pre>

cp /path/to/nvidia/* /home/me/nvidia

cp /path/to/nvidia/* /home/me/nvidia

Line 111:

Line 111:

==== Links and sources ====

==== Links and sources ====

−

Compiled from the forums, with thanks to [http://bbs.archlinux.org/viewtopic.php?id=60856) Heller_Barbe] and [http://bbs.archlinux.org/viewtopic.php?id=30431 byte]

+

Compiled from the forums, with thanks to [https://bbs.archlinux.org/viewtopic.php?id=60856) Heller_Barbe] and [https://bbs.archlinux.org/viewtopic.php?id=30431 byte]

Tip: Be aware you have enabled at least one of the servers defined in the /etc/pacman.d/mirrorlist file. Otherwise all what you get is a misleading error message:

error: no database for package: package-name

To update a New Arch Linux base system after installation you may enter

pacman -Sup --noconfirm > pkglist

Now open that textfile with an editor and delete all lines that are not URLs.
Next, bring that list with you to a place where you have internet and either download the listed packages manually or do

wget -nv -i ../pkglist

in an empty directory. Take all the *.pkg.tar.gz files back home, put them in /var/cache/pacman/pkg and finally run

pacman -S package-name

A slightly contrived example

Scenario: you have two Archlinux machines, 'Al' (with internet connection) and 'Bob' (without internet connection), and you need to install some nvidia packages and their dependencies on 'Bob'. Let's say the wanted packages are nvidia, nvidia-utils and xf86-video-nouveau, but you want to use a dedicated directory instead of /var/cache/pacman/pkg/ and a dedicated repository called nvidia (instead of the usual core, extra etc...)

Generate a list of packages to download

This can be done on any Archlinux machine which has up-to-date repository data bases (see above for links to database files); to create the list of links to the required packages, use:

The file nvidia.list will contain links to the listed packages and any others which they depend on.

Download the packages and their dependencies

Obviously this requires an internet connection, so on 'Al' create a directory called /path/to/nvidia for the files and run:

wget -P /path/to/nvidia/ -i /path/to/nvidia.list

Create a repository database just for these packages

This can be done on either 'Al' or 'Bob' using the repo-add command which comes with pacman (from version 3?); first, change to the /path/to/nvidia directory where the packages were downloaded, then create database file called nvidia.db.tar.gz:

cd /path/to/nvidia
repo-add nvidia.db.tar.gz *.pkg.tar.gz

Transfer the packages

Now all the packages have been downloaded, you do not need 'Al' anymore. Copy the contents of /path/to/nvidia to a the temporary nvidia packages cache directory on 'Bob', let's say this folder is called /home/me/nvidia:

cp /path/to/nvidia/* /home/me/nvidia

Next, pacman must be made aware of this new repository of packages; simply add the following lines at the bottom of your existing pacman.conf:

[nvidia]
Server = file:///home/me/nvidia

Now, instruct pacman to synchronise with the dedicated nvidia repository we created:

pacman -Sy

This command finds the nvidia.db.tar.gz file in /home/me/nvidia and expands it to /var/lib/pacman/sync/nvidia to create a database of packages contained in the nvidia repository.

Requirements

Unconnected Computer

Connected Computer

Steps

Basically, simply download the Powerpill Portable script and run it on the unconnected computer. It will create a directory named "portable" and copy some files into it (the local database and everything needed to run powerpill-portable on another system, minus perl itself and aria2). Simply take the directory to the connected computer (e.g. on a USB stick) and run the "pp" script in it on that system as though it were pacman, e.g. "pp -Syu foo bar". It will download the databases and packages into the portable directory. When you're done, bring the directory back to your unconnected computer, run the "sync" script in the portable directory, then simply run the same command(s) that you ran with pp using pacman, e.g. "pacman -Syu foo bar".

Your system is now up-to-date. Simply repeat the steps to keep it that way.