Giter Site home page Giter Site logo

Make local pacman use flexo's cache about flexo HOT 3 CLOSED

nroi avatar nroi commented on June 16, 2024
Make local pacman use flexo's cache

from flexo.

Comments (3)

nroi avatar nroi commented on June 16, 2024 1

Sounds good! I haven't investigated if and why pacman was really falling back to downloading the entire file when the .sig file is missing, but either way, with the newest release, Flexo caches .sig files just like normal package files, so this should not be a problem anymore.

Just to reiterate: If you want pacman to directly fetch existing files from the file system instead of downloading them via HTTP and storing a redundant copy, modify your /etc/pacman.conf to use multiple CacheDir entries, for example:

CacheDir = /var/cache/pacman/pkg
CacheDir = /var/cache/flexo/pkg/community/os/x86_64
CacheDir = /var/cache/flexo/pkg/core/os/x86_64
CacheDir = /var/cache/flexo/pkg/extra/os/x86_64
CacheDir = /var/cache/flexo/pkg/multilib/os/x86_64

If you use any additional repositories, you need to add more CacheDir entries.

You might also want to replace the first CacheDir entry with:

CacheDir = /tmp/pacman_cache

to avoid redundant package files: /tmp is usually mounted as tmpfs, so the files disappear after reboot, which is fine since the files are still stored inside /var/cache/flexo.

from flexo.

nroi avatar nroi commented on June 16, 2024

So far, I've dealt with this problem by setting the CacheDir of pacman to /tmp/pacman_cache. This means files are still stored redundantly, but are removed after each reboot due to /tmp being mounted as tmpfs. Also, it's all stored in RAM, so you don't have any additional wear-and-tear on your SSD. But I understand that this is not ideal if you don't have enough RAM to waste.

It might be possible to solve this problem without making any changes to Flexo: according to man 5 pacman.conf, it's possible to set multiple directories as CacheDir:

Multiple cache directories can be specified, and they are tried in the order they are listed in the config file.

However, currently it does not work to just set something like:

CacheDir  = /tmp/pacman_cache /var/cache/flexo/pkg/community/os/x86_64 /var/cache/flexo/pkg/core/os/x86_64 /var/cache/flexo/pkg/extra/os/x86_64 /var/cache/flexo/pkg/multilib/os/x86_64

But this seems to be due to the fact that Flexo currently does not cache .sig files. So, if pacman doesn't find the .sig files (along with the actual package file) in the local file system, it fetches both the .sig file and the package file via HTTP.

I've created a separate issue for this (#65). As soon as Flexo caches .sig files, I'll have a closer look at this.

from flexo.

codeswhite avatar codeswhite commented on June 16, 2024

Thanks for the reply!
Firstly I learned something new today, didn't knew I could specify multiple cache directories in pacman.conf.

You wrote:

However, currently it does not work to just set something like:

CacheDir  = /tmp/pacman_cache /var/cache/flexo/pkg/community/os/x86_64 /var/cache/flexo/pkg/core/os/x86_64 /var/cache/flexo/pkg/extra/os/x86_64 /var/cache/flexo/pkg/multilib/os/x86_64

I found out that using it as:

CacheDir = /tmp/pacman_cache
CacheDir = /var/cache/flexo/pkg/core/os/x86_64
CacheDir = /var/cache/flexo/pkg/extra/os/x86_64
... etc ...

Is actually a valid solution for the local pacman.. !

I've tested it with a single package that I've downloaded from remote machine that used Flexo as its mirror, and then tried to install that same package on the Flexo server, it worked thus it did not seem that .sig was required...
Although I've seen in /var/cache/pacman that only some packages are being fetched with .sig files alongside, which makes me wonder whether you are right about pacman falling-back to downloading when it will not find a .sig alongside a particular package.

from flexo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.