https://wiki.archlinux.org/api.php?action=feedcontributions&user=Infragilis&feedformat=atomArchWiki - User contributions [en]2024-03-19T06:42:11ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Offline_installation_of_packages&diff=136019Offline installation of packages2011-04-06T00:03:47Z<p>Infragilis: /* Normal Method: Pacman */</p>
<hr />
<div>[[Category:Package management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Offline_Installation_of_Packages}}<br />
<br />
== Normal Method: Pacman ==<br />
This method is based on [[User:Byte|byte's]] post from [http://bbs.archlinux.org/viewtopic.php?id=30431 this] thread.<br />
<br />
Download the package databases on a computer with internet access and transfer them to your computer.<br />
<br />
For i686:<br />
* ftp://ftp.archlinux.org/core/os/i686/core.db.tar.gz<br />
* ftp://ftp.archlinux.org/core/os/i686/core.db<br />
* ftp://ftp.archlinux.org/extra/os/i686/extra.db.tar.gz<br />
* ftp://ftp.archlinux.org/extra/os/i686/extra.db<br />
* ftp://ftp.archlinux.org/community/os/i686/community.db.tar.gz<br />
* ftp://ftp.archlinux.org/community/os/i686/community.db<br />
* ftp://ftp.archlinux.org/multilib/os/i686/multilib.db.tar.gz<br />
<br />
For x86_64:<br />
* ftp://ftp.archlinux.org/core/os/x86_64/core.db.tar.gz<br />
* ftp://ftp.archlinux.org/core/os/x86_64/core.db<br />
* ftp://ftp.archlinux.org/extra/os/x86_64/extra.db.tar.gz<br />
* ftp://ftp.archlinux.org/extra/os/x86_64/extra.db<br />
* ftp://ftp.archlinux.org/community/os/x86_64/community.db.tar.gz<br />
* ftp://ftp.archlinux.org/community/os/x86_64/community.db<br />
* ftp://ftp.archlinux.org/multilib/os/x86_64/multilib.db.tar.gz<br />
* ftp://ftp.archlinux.org/multilib/os/x86_64/multilib.db<br />
<br />
<br />
Following steps will make sure you're working with up-to-date package lists, as if you ran <code>pacman -Sy</code>.<br />
<br />
On home PC , do the following as root:<br />
<pre><br />
mkdir -p /var/lib/pacman/sync/{core,extra,community}<br />
rm -r /var/lib/pacman/sync/{core,extra,community}/*<br />
tar -xzf core.db.tar.gz -C /var/lib/pacman/sync/core<br />
tar -xzf extra.db.tar.gz -C /var/lib/pacman/sync/extra<br />
tar -xzf community.db.tar.gz -C /var/lib/pacman/sync/community<br />
tar -xzf multilib.db.tar.gz -C /var/lib/pacman/sync/multilib<br />
rm -r /var/lib/pacman/sync/*.db<br />
cp core.db /var/lib/pacman/sync/<br />
cp extra.db /var/lib/pacman/sync/<br />
cp community /var/lib/pacman/sync/<br />
</pre><br />
pacman -Sp --noconfirm package-name > pkglist<br />
<br />
{{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:<br />
<br />
<br />
error: no database for package: package-name }}<br />
<br />
To update a New Arch Linux base system after installation you may enter<br />
pacman -Sup --noconfirm > pkglist<br />
<br />
Now open that textfile with an editor and delete all lines that are not URLs.<br />
Next, bring that list with you to a place where you have internet and either download the listed packages manually or do<br />
<br />
wget -nv -i ../pkglist<br />
<br />
in an empty directory. Take all the *.pkg.tar.gz files back home, put them in /var/cache/pacman/pkg and finally run<br />
<br />
pacman -S package-name<br />
<br />
=== A slightly contrived example ===<br />
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...)<br />
<br />
==== Generate a list of packages to download ====<br />
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:<br />
<pre><br />
pacman -Sp nvidia nvidia-utils xf86-video-nouveau > /path/to/nvidia.list<br />
</pre><br />
The file nvidia.list will contain links to the listed packages and any others which they depend on.<br />
<br />
==== Download the packages and their dependencies ====<br />
Obviously this requires an internet connection, so on 'Al' create a directory called /path/to/nvidia for the files and run:<br />
<pre><br />
wget -P /path/to/nvidia/ -i /path/to/nvidia.list<br />
</pre><br />
<br />
==== Create a repository database just for these packages ====<br />
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:<br />
<pre><br />
cd /path/to/nvidia<br />
repo-add nvidia.db.tar.gz *.pkg.tar.gz<br />
</pre><br />
<br />
==== Transfer the packages ====<br />
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:<br />
<pre><br />
cp /path/to/nvidia/* /home/me/nvidia<br />
</pre><br />
<br />
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:<br />
<pre><br />
[nvidia]<br />
Server = file:///home/me/nvidia<br />
</pre><br />
Now, instruct pacman to synchronise with the dedicated nvidia repository we created:<br />
<pre><br />
pacman -Sy <br />
</pre><br />
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.<br />
<br />
<br />
==== Install the packages ====<br />
Finally install the packages:<br />
<pre><br />
pacman -S nvidia nvidia-utils xf86-video nouveau<br />
</pre><br />
<br />
==== Links and sources ====<br />
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]<br />
<br />
== Simpler Method: Powerpill Portable ==<br />
[http://xyne.archlinux.ca/scripts/pacman/#powerpill-portable Powerpill Portable] is a tool created by Xyne to simplify offline updates. It has the following requirements:<br />
{{Warning|''Powerpill'' development has been officially discontinued: its latest version does not work with ''pacman>&#61;3.5''. See [https://bbs.archlinux.org/viewtopic.php?id&#61;115660].}}<br />
=== Requirements ===<br />
==== Unconnected Computer ====<br />
* powerpill<br />
* rsync<br />
<br />
==== Connected Computer ====<br />
* perl<br />
* aria2<br />
<br />
The connected computer does not need to be running Arch or have Pacman installed.<br />
<br />
=== Steps ===<br />
An enumerated list of steps can be found [http://xyne.archlinux.ca/scripts/pacman/#usage-example here].<br />
<br />
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".<br />
<br />
Your system is now up-to-date. Simply repeat the steps to keep it that way.</div>Infragilis