You are not logged in.

#1 2011-08-27 17:00:55

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Need help maintaining local repository (not networked)

Greetings All!

I'm just trying to set up a local repository that I can use in the event I need to downgrade a package or suffer a serious problem while I learn more about Arch.  My process now consists of moving the pkg files from /var/cache/pacman/pkg to another drive/partition.  I've made the necessary entry in my pacman.conf and pacman finds it but when I view the repository via wakka it only shows a few packages, possibly because they are duplicates and originated from the official respositories?  I'm not certain.

Anyway, these are the commands I'm using to try & keep the database maintained.  I would appreciate it if someone would take a look and tell me if it will work, or if I have it totally screwed up.

cp /var/cache/pacman/pkg/*.pkg.tar.xz /home/chuck/Downloads/ArchRepo/
pacman -Sc
repo-add -d /home/chuck/Downloads/ArchRepo/archie.db.tar.gz /home/chuck/Downloads/ArchRepo/*.pkg.tar.gz
pacman -Syu

Offline

#2 2011-08-27 17:13:49

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: Need help maintaining local repository (not networked)

Offline

#3 2011-08-27 17:17:21

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Re: Need help maintaining local repository (not networked)

I'll look at that, thanks.

Apparently what is showing up in a query for my repo is a direct reflection of the contents of this directory /var/lib/pacman/sync/archie/
My repo doesn't contain the folders that contain the depends & desc files.

Offline

#4 2011-08-27 17:31:52

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Re: Need help maintaining local repository (not networked)

I'm overlooking something very fundamental, I just can't figure out what it is.

Attempting this might be beyond my current ability, while I've used Ubuntu for years I still have a lot to learn about Arch.

Offline

#5 2011-08-27 17:47:19

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: Need help maintaining local repository (not networked)

cbowman57 wrote:
cp /var/cache/pacman/pkg/*.pkg.tar.xz /home/chuck/Downloads/ArchRepo/
repo-add -d /home/chuck/Downloads/ArchRepo/archie.db.tar.gz /home/chuck/Downloads/ArchRepo/*.pkg.tar.gz

EDIT - scrap that misread your intention big_smile

Last edited by satanselbow (2011-08-27 17:50:22)

Offline

#6 2011-08-27 18:13:23

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Re: Need help maintaining local repository (not networked)

This is the wiki I was trying to use as a reference https://wiki.archlinux.org/index.php/Pacman_Tips

Since this isn't going across a lan I'm not sure pacserve can help me, but if I'm misunderstanding it's capabilities don't hestitte to set me straight.

Last edited by cbowman57 (2011-08-27 18:14:46)

Offline

#7 2011-08-27 18:15:11

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Need help maintaining local repository (not networked)

I would recommend that you don't do what you want to do to accomplish your goal.  Simply keep /var/cache/pacman/pkg where it is and, if need be, use the following to downgrade:

# pacman -U /var/cache/pacman/pkg/NAME

Alternatively, you can use the Arch Rollback Machine which has packages back to before you started running Arch tongue


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#8 2011-08-27 18:20:33

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Re: Need help maintaining local repository (not networked)

Thanks graysky, I'm beginning to think that you're suggestion is probably the one I should follow.

Offline

#9 2011-08-27 18:29:56

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: Need help maintaining local repository (not networked)

There are some top tips for quick, easy and scriptable recovery on that same wiki page wink

By combining

comm -23 <(pacman -Qeq) <(pacman -Qmq) > pkglist.txt

and

pacman -S $(< pkglist.txt)

you can have Arch back up in no time wink

About the only pkg upgrade I find it necessary to ignore is sdlmame cos i'm too lazy to update my roms tongue Have a look at /etc/pacman.conf if you need to add any yourself wink

Offline

#10 2011-08-27 18:40:51

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Re: Need help maintaining local repository (not networked)

Yeah, I'm using that method for a backup in the event of a catastrophe.  I was just looking for a method that would a) keep the pkgs on another partition in the event of a serious malfunction on my part. b) Avoid having to download everything again in the event of a problem.

With Ubuntu I could just relocate the files from the apt cache directory to another directory and if I was building an install using a minimal or net iso I could just copy them into the new installation and apt-get would automatically use those instead of downloading them again.  Obviously it's not that easy on Arch, maybe not even possible.  Oh well, it was just a thought.  When I first saw that [custom] entry in the pacman.conf and the associated wiki on the process I thought it would be fairly easy.  I thought wrong apparently. smile

Offline

#11 2011-08-28 10:44:20

cbowman57
Member
Registered: 2011-08-21
Posts: 77

Re: Need help maintaining local repository (not networked)

I adandoned this effort it's beyond my ability it seems.

Ok, I have a few questions in case I want to try this.

[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log

So it looks like it would be relatively easy to maintain my installed packages on another partition by editing the path names.

1) Is that something that needs to be established at installation and left unchanged or can I migrate my settings to use a custom path?
2) If it is possible to relocate them is it a simple matter of just moving or copying the directories to the new location?
3) Will pacman automatically look for packages here first without downloading them?
4) If I were to just maintain the CacheDir separately is it possible to share that cache between multiple Arch installations without problems?

A lot of questions I know, but if anyone has experience doing anything like this I would be very curious to know how they went about it. 
Thanks.

Offline

Board footer

Powered by FluxBB