You are not logged in.

#1 2007-02-01 04:26:02

hugin
Member
Registered: 2006-05-19
Posts: 93

update a pacman database on a machine with no internet.

ok, I'm not sure how many of you are going to find this useful, but here is what happened.  I have 2 Arch boxes running, my laptop and my desktop.  My laptop can get online, my desktop can't; due to I can't find a modem that will work with it.  so how am I supposed to keep the desktop as bleeding edge?  Easy, move the packages and pacman database to the desktop from the laptop.  Now, I don't do this everyday, maybe once a week (after a major version bump, or something).  I don't konw about you, but I would constantly be re-looking up all the switches I need to do this properly.  So I wrote a script; well two actually.  The first, is a simple bash one liner.  The other is a little more complicated.  You can find them here: http://mckean.upb.pitt.edu/~jhs/rph.tar.bz2.

I've been using them for about 3 weeks or so, and haven't broke anything.  But these are use at your own risk.  The import does  make a backup of your database, but the first few times I would suggest making one yourself, just to be on the safe side. 

Please leave feed back. 

(btw, rph = Remote Pacman-db Helpers)


/swogs


Open Toes; Open Mind; Open Source.

Offline

#2 2007-02-01 14:07:29

stingray
Member
From: Lima, Peru SA
Registered: 2006-03-24
Posts: 188

Re: update a pacman database on a machine with no internet.

Another option: I use NFS to share my pacman cache from my main computer to my other computers, then mount on the other computers. The main advantage is that all the packages are only using up space on one computer.  It works really good.

In your case you would need to mount the pacman database also. "/var/lib/pacman/" I think?

Just thought I'd share what works good for me.

Here are my notes I took to remind me how to do it.

 How To Setup NFS to share & mount pacman cache on other computer 
 
 ======On main computer============
# pacman -S nft-utils

/etc/rc.conf
DAEMONS(… portmap nfslock nfsd …)

/etc/hosts.allow
#---For NFS Network File System, Linux shares----
portmap:  192.168.1.51
lockd:    192.168.1.51
rquotad:    192.168.1.51
mountd:    192.168.1.51
statd:    192.168.1.51
#------------------------------------------------

/etc/exports
#---share pacman cache -----
/var/cache/pacman/pkg 192.168.1.51(rw,no_root_squash,subtree_check)



======On Other Computer ==========
# pacman -S nft-utils

/etc/rc.conf
DAEMONS(… portmap nfslock nfsd …)  
Note: only portmap is needed for mounting a share
Note: put portmap before network if automounting in fstab

delete cache "/var/cache/pacman/pkg"

mount cache
# mount192.168.1.50:/var/cache/pacman/pkg /var/cache/pacman/pkg/

check it
# ls /var/cache/pacman/pkg/


Automount in fstab
/etc/fstab
192.168.1.50:/var/cache/pacman/pkg /var/cache/pacman/pkg nfs rw,addr=172.25.1.150 0 0

Offline

#3 2007-02-01 16:00:12

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: update a pacman database on a machine with no internet.

stingray wrote:

In your case you would need to mount the pacman database also. "/var/lib/pacman/" I think?

Be careful if you do this - you would want to mount /var/lib/pacman/{current,extra,unstable,community} but not /var/lib/pacman/local.

Offline

#4 2007-02-01 17:04:58

stingray
Member
From: Lima, Peru SA
Registered: 2006-03-24
Posts: 188

Re: update a pacman database on a machine with no internet.

Thanks!  I've only ever mapped the cache...  That's good to know!

Offline

#5 2007-02-01 18:53:34

hugin
Member
Registered: 2006-05-19
Posts: 93

Re: update a pacman database on a machine with no internet.

Cerebral wrote:

Be careful if you do this - you would want to mount /var/lib/pacman/{current,extra,unstable,community} but not /var/lib/pacman/local.

That is precisley the reason I went with the scripts, seemed safer and easier than a bunch of mounts.  My first attempt, I borked my local on my desktop.  I thought about mounting the cache through NFS, but just haven't really had the time to set it up, (I know it only takes a minute, but I have more pressing matters).  I made the scripts just handle the DB, so one could go about syncing the cache any way they saw fit; scp was the first already setup way I had, so I used it.

cheers


/swogs


Open Toes; Open Mind; Open Source.

Offline

#6 2007-02-01 19:23:11

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: update a pacman database on a machine with no internet.

Why dont you share your internet connection? it might be a little of topic, but anyway, it's as easy as this.
/etc/firehol/firehol.conf (you need to run firehol as a daemon, its basicly a firewall, but can share internet too (AUR))

#!/etc/rc.d/firehol
# ------------------------------------------------------------------------------

interface eth0 lan
# this is only between me and
# other computer = full access

        server all accept
        client all accept

interface wlan0 internet
# im behind hardware firewall
# so i dont need very much protection

        server all accept
        client all accept

# This is all you need for basic internet sharing :)
router internet2lan inface wlan0 outface eth0
                masquerade reverse
                client all accept

"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#7 2007-02-01 20:49:48

hugin
Member
Registered: 2006-05-19
Posts: 93

Re: update a pacman database on a machine with no internet.

first, I don't share because I don't really know how to.
second, it would seem as though just the idle traffic on dialup, would degrade them to the point where you can't use either of them.

thanks for the idea, I might look into it anyways.


/swogs


Open Toes; Open Mind; Open Source.

Offline

#8 2007-02-02 00:12:58

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: update a pacman database on a machine with no internet.

Oh! my bad tongue
I thought you meant an adsl modem...


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#9 2007-02-02 02:38:55

hugin
Member
Registered: 2006-05-19
Posts: 93

Re: update a pacman database on a machine with no internet.

no, old school 56k, took me 2 days to pull KDE ><  oh well, once it's up and updating, it's rare that it takes a whole night to update my machine. 

/swogs


Open Toes; Open Mind; Open Source.

Offline

Board footer

Powered by FluxBB