You are not logged in.

#1 2012-08-15 14:19:36

soroush
Member
From: Urmia - IRAN
Registered: 2011-09-25
Posts: 33

[SOLVED] Offline installation: How to cache pre-downloaded packages

Hi

I need to install an ArchLinux on a PC with no internet connection. I just installed same version of Arch on my laptop and also take a backup from everything in /var/cache/pacman/pkg.
What I tried so far:
1. Create a local repo by repo-add and add it to /etc/pacman.conf during installation
problem: There are some old packages in that repo, pacstrap tries to install gcc 4.6.1 (which is an old version, current is 4.7) and errors occurred.
2. Copy downloaded packages to a USB disk, mount it on /var/cache/pacman/pkg
problem: pacstrap tries to re-download everything

Last edited by soroush (2012-08-15 19:45:15)

Offline

#2 2012-08-15 14:37:16

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Offline installation: How to cache pre-downloaded packages

Make an image, or a tarball, of the installed system, and put it on the new system. Edit system files as required to accommodate differences in hardware, partition layout, etc.

Offline

#3 2012-08-15 15:09:55

soroush
Member
From: Urmia - IRAN
Registered: 2011-09-25
Posts: 33

Re: [SOLVED] Offline installation: How to cache pre-downloaded packages

tomk wrote:

Make an image, or a tarball, of the installed system, and put it on the new system. Edit system files as required to accommodate differences in hardware, partition layout, etc.

Have to be so complicated ?! I just need to tell pacman to fetch packages from a directory instead of download them from inernet !

Offline

#4 2012-08-15 16:54:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Offline installation: How to cache pre-downloaded packages

If you're only installing from a custom local repository then,imo, you should comment out the other repositories (core, extra, community). Then do -Syyu and install. (I have never tried this. I think it should work. If it doesn't, I blame Allan.)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#5 2012-08-15 18:17:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Offline installation: How to cache pre-downloaded packages

I don't find my suggestion complicated at all, but each to their own, I guess.

Here's another alternative - cd to the dir with the packages, install them all with pacman -U.

Offline

#6 2012-08-15 18:39:24

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 275

Re: [SOLVED] Offline installation: How to cache pre-downloaded packages

I'm an install junky so I do this all the time.

Relocate the /var/cache/pacman/pkg/ directory to somewhere portable (external USB, HDD, SSD or even burn it to a CD/DVD but the CD/DVD wouldn't be updatable on the fly) and just change CacheDir = /var/cache/pacman/pkg/ in /etc/pacman.conf to point to the location of the copy.

I usually mount the copy before every system update with pacman so the cache is always up to date.

Be sure to use ext3/4 as the filesystem for where you store the copy of the cache. I've had cp complain about illegal filenames for some packages when I used vfat on a USB device.

Offline

#7 2012-08-15 19:44:54

soroush
Member
From: Urmia - IRAN
Registered: 2011-09-25
Posts: 33

Re: [SOLVED] Offline installation: How to cache pre-downloaded packages

KairiTech wrote:

I'm an install junky so I do this all the time.

Relocate the /var/cache/pacman/pkg/ directory to somewhere portable (external USB, HDD, SSD or even burn it to a CD/DVD but the CD/DVD wouldn't be updatable on the fly) and just change CacheDir = /var/cache/pacman/pkg/ in /etc/pacman.conf to point to the location of the copy.

I usually mount the copy before every system update with pacman so the cache is always up to date.

Be sure to use ext3/4 as the filesystem for where you store the copy of the cache. I've had cp complain about illegal filenames for some packages when I used vfat on a USB device.

BINGO!
Thanks for the solution smile

Offline

Board footer

Powered by FluxBB