Manjaro specific build of pacredir

Hi, in the arch repos, there is a very useful tool called pacredir.
It helps sharing pacman packages in the local network, so if another computer in your network already has package x, you won't have to redownload it, it will be transfered from the other computer in your network, which is much faster. This is great for people like me with slow internet connection.

But pacredir in it's default configuration is incompatible with Manjaro branches.
You can read more about the issue here:

To avoid this issue, we have to add a file to the package in a manjaro specific version:
/etc/systemd/system/pacserve.service.d/no-db.conf:

[Service]
BindReadOnlyPaths=
BindReadOnlyPaths=/var/cache/pacman/pkg:/run/pacserve/pkg

Also, as an alternative, the arch maintainer 'could think about handling this at build time'.

Does someone of the Manjaro team want to maintain our own pacredir package?

2 Likes

That's pretty cool! It would save me some bandwidth being on metered internet. :face_vomiting:
Makes me wonder how hard it would be to build this feature into Pamac? :thinking:

i would put the cache on a drive every computer can mount and change its location variable in

/etc/pacman.conf
CacheDir = /var/cache/pacman/pkg/

This would require an extra server. Not everybody wants to set this up.
Pacredir is a simpler / cleaner solution, without needing a caching server.

But this is not what this forum thread is about. It is about maintaining our own pacredir package, so let's focus on this.

No, it does not. Using pacredir also means you download a package from one of your other computers (the one with the internet connection) and that doesn't change. Just place the folder @steanne mentioned on this computer and mount it in every other computer.

I have 4 computers in my network.
If I would set the cache dir to be on one specific computer, this machine has to always be powered on when I want to install / update packages.

Since I do not have all 4 machines on all the time, but mostly only 1 - 2, this would not work. I would have to copy over the cache dir to another machine, which is on at the time, and also change pacman.conf on all machines... everytime time different machines are powered on.
This would be really getting on my nerves.

Believe me, there is a reason why pacredir exists. It automatically finds machines powered on in the network and gets the packages from there. It's a 'setup once and forget' process, without needing changing configs every time or needing one machine powered on all the time. This is a much nicer solution.

This is the last reply I will give to something like this (except for Manjaro maintainers). I don't want to spam / make the thread unreadable. Because this is really about maintaining our own pacredir package, not how you would do it without pacredir.

I take a look into it :wink:

1 Like

Excuse me. To avoid this in the future I will just place you on the ignore list, so I won't see what you write here.

Hi @Ste74
thanks for making our own package which ignores db files by default.
However something is wrong with it. I'm always getting Currently no servers are available to check for ... log messages.
When I downgrade pacredir to 0.4.2-1 (the version from the arch repos) it works again. Upgrading to 0.4.2-1.1 (Manjaro package) it stops working.
Did you also change something else besides the default in the config?

Edit: I found the difference. It is in /etc/avahi/services/pacserve.service
In the arch package:

  <service>
    <type>_pacserve_arch_x86_64._tcp</type>
    <port>7078</port>
  </service>

Manjaro package:

  <service>
    <type>_pacserve_manjaro_x86_64._tcp</type>
    <port>7078</port>
  </service>

When I switch _pacserve_manjaro_x86_64._tcp to _pacserve_arch_x86_64._tcp in this file, it works again.

Old text

Hey @Ste74
Did you make another change to the pacredir package?

Because it stopped working. Currently I don't know why (haven't had a look what is different with the packages), but:
with the Manjaro package installed (pacredir-0.4.2-1.2), pacredir currently doesn't work, I always get this in logs:

Currently no servers are available to check for linux51-5.1.21-1-x86_64.pkg.tar.xz.
Currently no servers are available to check for SOME-PACKAGE.pkg.tar.xz.
...

even when the packages are available.

The server side works. I can download for example the new 5.1 kernel package when browsing to
http://my-server-ip:7078/pkg/linux51-5.1.21-1-x86_64.pkg.tar.xz
On my client.
So it is a client issue, the server runs fine.

So I switched to the pacredir package provided by Arch (pacredir-0.4.2-1-x86_64) and restarted the client service:

sudo systemctl restart pacredir

and it works again, the client finds the packages again, as it should.

Switched back to the Manjaro package, restarted pacredir again, and I always get the Currently no servers are available to check for error again for every package.

So what is different in the Manjaro package (besides the default config)?

Edit: Did more testing to make sure this is not a pacredir issue. If I install the arch package and manually change the config to Manjaros pacredir config, it works.
But installing the pacredir package from Manjaro repos again stops it from working.
So there have to be definitely something else changed, not only the default config.

Edit 2: I built pacredir now with the exact PKGBUILD from Archlinux, and it still doesn't work. But the arch package still works.

Edit 3: Ok, it was my fault. I found the 'fix' now.
We have to change /etc/avahi/services/pacserve.service back.
In my last post, I said we have to change the _pacserve_manjaro_x86_64._tcp to _pacserve_arch_x86_64._tcp. But this was wrong. I messed something up during testing back in that time when I wrote the post (I guess I still had the arch package installed on another system).
Switching it to _pacserve_manjaro_x86_64._tcp again makes pacredir work again for us.
I`m really sorry for this mistake.

1 Like

Hi, sorry for delay.. so no changes are needed right?

There is a change needed.
You made this change because of my mistake during testing:

This should be reverted.

Done :upside_down_face:

1 Like

Thank you! :slight_smile:

Forum kindly sponsored by Bytemark