You are not logged in.

#1 2011-06-01 19:16:50

scullder
Member
Registered: 2011-04-27
Posts: 21

apt-cacher-ng : a cache server for... Pacman (and APT)

Hello ! smile

I just adopt apt-cacher-ng on AUR, because I'm using it for APT (I use debootstrap and chrooted environments) and it help me saving a lot of bandwith (531Mb today).

1306955490.jpg

So here is the package if you are insterested :
http://aur.archlinux.org/packages.php?ID=40662

I've seen in the main configuration file that it can be used for Archlinux. So I did it wink

I will share my configuration in this topic.

Configuration

The main file is /etc/apt-cacher-ng/acng.conf

I'm using apt-cacher-ng only on my laptop :

BindAddress: localhost

Here are some Remap lines for Debian repositories (including security) :

Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian
Remap-debsec: /security ; http://ftp.fr.debian.org/debian-security

This is the line for Archlinux

Remap-alxrep: file:archlx_mirrors /archlinux ; file:backend_archlx # incomplete, please create this file or specify preferred mirrors here

Here is a very permissive addition to the VfilePattern regex to allow the *db files (needed for pacman -Sy)

VfilePattern = (^|.*?/)(Index|Packages\.bz2|Packages\.gz|Packages|Release|Release\.gpg|Sources\.bz2|Sources\.gz|Sources|release|index\.db-.*\.gz|Contents-[^/]*\.gz|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*\.bz2|.*\.db)$

Just put in the file /etc/apt-cacher-ng/backend_archlx your nearest mirror without the "$repo/os/$arch" part :

In my case :

echo http://mir.archlinux.fr/ > /etc/apt-cacher-ng/backend_archlx
Usage

You can now restart apt-cacher-ng

rc.d restart apt-cacher-ng

Here is your new /etc/pacman.d/mirrorlist !

Server = http://localhost:3142/archlinux/$repo/os/$arch

Just in case, here is a minimal /etc/apt/sources.list for Debian :

deb http://localhost:3142/debian squeeze main contrib 
deb http://localhost:3142/security squeeze/updates main contrib
Reflector

If you want to use the very last synced archlinux repositories, with reflector, you can do something like that

rc.d stop apt-cacher-ng
reflector -p http -l 1 --sort rate | grep -o -e 'http://[^\$]*' > /etc/apt-cacher-ng/backend_archlx
rc.d start apt-cacher-ng

Offline

#2 2011-06-10 08:17:49

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: apt-cacher-ng : a cache server for... Pacman (and APT)

I Guess you can put it inside wiki smile


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#3 2011-07-12 21:34:28

psi.neamf
Member
Registered: 2007-01-16
Posts: 9

Re: apt-cacher-ng : a cache server for... Pacman (and APT)

Hi, thx for info. Just checking with  file:archlx_mirrors
that file needs to be created as well? Can I leave it
out and just have -> Remap-alxrep: /archlinux ; file:backend_archlx

I suppose I can just test it. I read the docs, but they are a bit confusing :-)

Last edited by psi.neamf (2011-07-12 21:35:57)

Offline

#4 2011-07-16 20:57:13

scullder
Member
Registered: 2011-04-27
Posts: 21

Re: apt-cacher-ng : a cache server for... Pacman (and APT)

psi.neamf wrote:

Hi, thx for info. Just checking with  file:archlx_mirrors
that file needs to be created as well? Can I leave it
out and just have -> Remap-alxrep: /archlinux ; file:backend_archlx

I suppose I can just test it. I read the docs, but they are a bit confusing :-)

I'm not sure and I'm not a master of apt-cacher-ng wink Precise documentation is here :
http://www.unix-ag.uni-kl.de/~bloch/acn … tml#repmap

The file archlx_mirrors is in the package, and contains a list of mirrors.
The second part of Remap- line, TargetURLs, is optional.

Just try and give your results here please wink

Offline

#5 2011-08-01 13:52:34

psi.neamf
Member
Registered: 2007-01-16
Posts: 9

Re: apt-cacher-ng : a cache server for... Pacman (and APT)

Hi,

I  was configuring an existing apt-cacher-ng on an Ubuntu server, so I didn't make use of your package.

I ended up with this in /etc/apt-cacher-ng/acng.conf :

 Remap-alxrep: /archlinux ; file:backends_archlx

I used your change to VfilePattern.

I then created this file in /etc/apt-cacher-ng/ :

backends_archlx

with this content. (I suppose one can put more mirrors in here) :

http://archlinux.mirror.ac.za/

I think I got it a bit mixed up, but it's working. I should maybe move the line in backends_archlx that actually refers to a download mirror to where you have file:archlx_mirrors so that multiple mirrors can go in there. As you said, the TargetURLs is optional.

Offline

#6 2013-02-12 21:41:58

quest
Member
Registered: 2013-02-12
Posts: 2

Re: apt-cacher-ng : a cache server for... Pacman (and APT)

Sorry for digging up this old thread. Could some kind person point me to the right solution? I would like to install apt-cacher-ng on a Pogoplug (armv6l) and stumbled upon this thread.

I downloaded the package from AUR and added 'arm' as architecture to PKGBUILD file. Continuing with makepkg -s it fails:

   -> Extracting apt-cacher-ng_0.7.12.orig.tar.xz with xz
xz: apt-cacher-ng_0.7.12.orig.tar.xz: Cannot allocate memory
==> ERROR: Failed to extract apt-cacher-ng_0.7.12.orig.tar.xz
    Aborting...

This is my first try with AUR, so please bear with me. Thanks for your help.

Offline

#7 2013-02-12 21:46:13

scullder
Member
Registered: 2011-04-27
Posts: 21

Re: apt-cacher-ng : a cache server for... Pacman (and APT)

I think it's not related to AUR or this specific package but to xz, look here:
https://bbs.archlinux.org/viewtopic.php … 76#p831476

Short answer: Older xz versions have a memory usage limiter that is
enabled by default. Newer version still have it, but it is disabled by
default. You can get close to the old behavior by putting

    XZ_DEFAULTS=--memlimit=40%
    export XZ_DEFAULTS

into your shell's initialization script (e.g. .bashrc).

I never had this problem, so it's all I can do wink

Offline

Board footer

Powered by FluxBB