You are not logged in.

#1 2014-08-11 19:19:34

vicencb
Member
Registered: 2014-08-11
Posts: 3

pacman with multiple cachedir

Hello,
I'm trying to install a package from a local file with pacman -U
this package has dependencies found in AUR which have been previously built and placed into /var/abs/local/pkg
I want pacman to automatically install all the dependencies.
to do so I tried:
1) in /etc/pacman.conf (as suggested by "man pacman.conf")
CacheDir = /var/cache/pacman/pkg/ /var/abs/local/pkg/
2) in the command line (as suggested by "man pacman")
--cachedir /var/cache/pacman/pkg --cachedir /var/abs/local/pkg

All of them failed with "could not satisfy dependencies"

Why does that happen?
Is it related to pacman only searching for packages into the database and not into the cache directories?
How can it be achieved?

Regards,
  vicencb

Offline

#2 2014-08-11 19:28:21

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: pacman with multiple cachedir

You could -U all the packages you want at once.

Offline

#3 2014-08-11 19:43:34

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: pacman with multiple cachedir

vicencb wrote:

Is it related to pacman only searching for packages into the database and not into the cache directories?

Yes.

Pacman looks up packages/dependencies in it's database to see if it knows about them, if your AUR packages aren't in any of your synced repositories then as far as pacman is concerned they don't exist, so it doesn't matter that they're in your CacheDir or not.

Last edited by Slithery (2014-08-11 19:44:23)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2014-08-11 19:47:54

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: pacman with multiple cachedir

You'll need a package database of your aur packages if this is the way you want to do it. Take a look at repo-add and related utilities if this is the way you want to manage your packages.

Personally, I prefer to install aur/abs packages using pacman -U with the --asdepend switch if it is a dependency of another package. The dependency status is carried over for a package update, so it all works out. (also works with makepkg)

edit for clarity, although slithery beat me to posting

Last edited by runical (2014-08-11 19:49:21)

Offline

#5 2014-08-11 22:16:49

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: pacman with multiple cachedir

You need to create a pacman database.

  1. Put all of those packages in a single directory.

  2. Create a database in that directory using repo-add or repo-add_and_sign

  3. Add an entry in /etc/pacman.conf for the new database. You must use the same name that you used when you created the database. The path should use the "file" scheme:

    Server=file:///path/to/directory

    where /path/to/directory is the local path to that directory.

  4. Optionally add the directory as a local cache in /etc/pacman.conf

  5. Run pacman -Syu <package> where <package> is the name of the package in your custom local repository.

Note that you will have to rebuild all of those packages yourself when updated become available on the AUR. Pacman will not do it for you. Alternatively, you may use one of the many AUR helpers that provide dependency resolution when installing AUR packages.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#6 2014-08-11 22:17:03

vicencb
Member
Registered: 2014-08-11
Posts: 3

Re: pacman with multiple cachedir

Thanks for your answers, they are very helpful.
I didn't know about the option of building my own database with repo-add.
Now I've a db built with
  repo-add /var/abs/local/pkg/aur.db.tar.xz /var/abs/local/pkg/*.pkg*
and a new repo in pacman.conf
  [aur]
  Server = file:///var/abs/local/pkg
  SigLevel = Optional TrustAll
along with two CacheDir paths

The only drawback I see in this method is that
  pacman -Qm
does not report aur packages as foreign.

Thanks,
  vicencb.

Offline

#7 2014-08-11 22:27:00

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: pacman with multiple cachedir

vicencb wrote:

The only drawback I see in this method is that
  pacman -Qm
does not report aur packages as foreign.

Thanks,
  vicencb.

"Foreign" packages are those which are not found in any pacman database so this is expected. If you want to work around this, remove your repo from /etc/pacman.conf and add it to an empty text file, then at the beginning of the file add this line:

Include = /etc/pacman.conf

This is your custom pacman.conf file. Save it wherever you want with whatever name you want.

Now create an alias such as

alias localpacman='pacman --config /path/to/custom/pacman.conf'

with the path to the file that you saved.

You can then run localpacman (or whatever you want to call it) to quickly install packages in your local repo but then use pacman as usual.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB