You are not logged in.

#1 2008-12-13 10:04:16

elflord
Member
From: France
Registered: 2008-11-09
Posts: 51

how to update system using pacman without internet

Hi all

I have one machine that has access internet and is updated and all downloaded packages are still in cache

my other machine doesn't have access to internet
i'm wandering if there is a way to update my second machine using files already on the first one

i know how to configure the cache directory
but i dont know how to refresh the sync when i pacman -Syy
what exactly happens we do pacman -Syy ?

can i just copy some files from the firest machine to the second to have the same effect ?
thanks

Offline

#2 2008-12-13 10:16:41

borix
Member
Registered: 2007-12-01
Posts: 17

Re: how to update system using pacman without internet

Just copy all the packages from the cache and install them manually(with pacman -U). You will not even need to refresh the database(pacman -Sy(pacman -Syy do the same)).

Offline

#3 2008-12-13 10:23:09

elflord
Member
From: France
Registered: 2008-11-09
Posts: 51

Re: how to update system using pacman without internet

thanks for the reply

there're a lot of packages and manually it would take too long
so can i just put all my packages into cache
and pacman -U (or other switch) that update the system ?

actually my second machine is a fresh archlinxu intall with almost nothing on it

Offline

#4 2008-12-13 11:03:35

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: how to update system using pacman without internet

If you copy the packages in the cache of the computer without internet access you can just:
# pacman -Su

And it will use look to see if they are in the cache first then try to download them.

pacman -Sy   #What this does is: (as explain in the man page) "Download[s] a fresh copy of the master package list"
pacman -Syy #Forces the download, normally it wouldn't download the file if it doesn't need too.

Offline

#5 2008-12-13 11:08:59

elflord
Member
From: France
Registered: 2008-11-09
Posts: 51

Re: how to update system using pacman without internet

i did but when i do pacman -Su
pacman told me that local database is up to date

i understand this coz i havnt sync to the internet package list
and that is why i want to know what exactly happens when i do pacman -Sy
and whether i can do this by hand

Offline

#6 2008-12-13 11:24:03

Heller_Barde
Member
Registered: 2008-04-01
Posts: 245

Re: how to update system using pacman without internet

on your machine with internet access run this to download all the package databases:

for db in core extra community;
do
  wget http://ftp.tu-chemnitz.de/pub/linux/archlinux/$db/os/i686/$db.db.tar.gz
done

then copy these three files onto your other machine and run this as root:

for db in core extra community;
do
  tar xvf $db.db.tar.gz -C /var/lib/pacman/sync/$db/ 
done

EDIT: This is what pacman -Sy does smile

then run this:

pacman -Sup > packages.list

this creates a file named packages.list which contains all the URLs for all the packages which need to be updated on your not-internet-accessible machine.
this file you put back on your internet-accessible machine and run:

mkdir -p downloadedpackages
wget -P downloadedpackages -i packages.list

this downloads all the needed packages from the file packages.list into a new directory called downloadedpackages. this directory must go back to the other machine and all the files in there need to go into the folder /var/cache/pacman/pkg/
then you can run pacman -Su on the non-internet machine
tadaaa! big_smile

cheers
Barde

Last edited by Heller_Barde (2008-12-13 11:25:09)

Offline

#7 2008-12-13 11:28:16

mentallaxative
Member
From: Australia
Registered: 2008-07-14
Posts: 134
Website

Re: how to update system using pacman without internet

Hmmm...

pacman -Su is not performing the upgrade because it doesn't have a new package list. To get one, you have to use pacman -Sy, which unfortunately for you connects to the internet. I suggest you read up on http://wiki.archlinux.org/index.php/Cus … repository

edit: Hellen_Barde's suggestion is better.

Last edited by mentallaxative (2008-12-13 11:30:01)

Offline

#8 2008-12-13 11:29:39

elflord
Member
From: France
Registered: 2008-11-09
Posts: 51

Re: how to update system using pacman without internet

thank you man
im gonna try that out

Offline

#9 2008-12-13 11:32:23

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: how to update system using pacman without internet

Right no internet, makes that a problem too.

There's a file (core..db.tar.gz) that is downloaded and extracted to /var/lib/pacman/
You'll need to either get that file from the internet OR tar the directory and copy it across. Something like that.

Offline

#10 2008-12-13 12:13:24

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: how to update system using pacman without internet

fumbles wrote:

Right no internet, makes that a problem too.

There's a file (core..db.tar.gz) that is downloaded and extracted to /var/lib/pacman/
You'll need to either get that file from the internet OR tar the directory and copy it across. Something like that.

Or just create one yourself for the packages you have downloaded.

repo-add --help


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#11 2008-12-13 22:03:06

borix
Member
Registered: 2007-12-01
Posts: 17

Re: how to update system using pacman without internet

elflord wrote:

there're a lot of packages and manually it would take too long

You can copy the files and use shell expansion, i.e.

cd /directory/with/packages/
pacman -U *.pkg.tar.gz

I think it's the easiest way how to upgrade system without internet access if you don't mind that pacman database won't be upgraded.

Offline

#12 2008-12-15 15:36:14

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: how to update system using pacman without internet

borix wrote:
elflord wrote:

there're a lot of packages and manually it would take too long

You can copy the files and use shell expansion, i.e.

cd /directory/with/packages/
pacman -U *.pkg.tar.gz

I think it's the easiest way how to upgrade system without internet access if you don't mind that pacman database won't be upgraded.

setting up your own local repo is better imo, since you get around the issue that all packages installed with -U is marked "explicitly installed" unless you use --asdeps


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#13 2008-12-15 15:53:34

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: how to update system using pacman without internet

+1 for setting up a custom repo (it's really quite easy)

*edit*
I actually repeated most of what Heller-Barde, only adding this:

Once you have the packages in /path/to/some/dir on the unconnected computer, you can run this command to update them (assuming you've updated the database as explained above):

pacman -Su --cachedir /path/to/some/dir

Be careful with the pkglist URLs though, they will be linked to a single server (the one at the top of your mirror list). If that's down when you want to download them, you'll need to manually change it. To avoid this hassle (and really speed up downloads), you could use these steps instead:

run "powerpill -Su --get-metalink pkglist.metalink" on the unconnected system instead of "pacman -Sup >packages.list"

run "aria2c -M pkglist.metalink" on the connected system instead of "wget -i packages.list"



Btw, how are you actually transferring files between the two?

Last edited by Xyne (2008-12-15 15:58:56)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB