You are not logged in.

#1 2013-06-28 15:39:27

Kalrish
Member
Registered: 2013-02-27
Posts: 62

[SOLVED] Create local repository

Hello everyone!

First of all, I'd like to apologize for the terminology. I'm still not sure about what are the names I should use. That said, here's my problem: I want to set up a local repository to place all the packages I've ever built with makepkg. The main reason that has motivated me to do so is that, when building a package, I often need to install make dependencies, such as, for example, xorg-server-devel. That package in particular comes from xorg-server, which I have built by myself. Thus, if a package required it, I should install the correspondent package (the one I've built), and not the generic one coming from the repositories (this case may not be a good example, but, well, just think about kernel headers).

In order to set up the repository, I read Allan McRae's articles about makepkg, repo-add and package signing. I generated a key with GPG as explained here, taking the defaults, and added it to the pacman's keyring:

gpg --export Kalrish > Kalrish.key
pacman-key -a Kalrish.key

I also edited /etc/makepkg.conf as follows:

BUILDENV=(fakeroot !distcc color !ccache check sign)

Note that I've enabled sign.

I decided to maintain my "local repository" (please, correct me if I'm not making use of the correct terminology) in /var/abs/local. For that purpose, I edited /etc/makepkg.conf:

$ grep -m1 PKGDEST /etc/makepkg.conf
PKGDEST=/var/abs/local

I then built dhcpcd (which is relatively small), just to try out. makepkg put the package file in /var/abs/local as I intended; then, I did this:

repo-add 'local.db.tar.gz' 'dhcpcd-5.6.8-3-x86_64.pkg.tar.xz'

It asked me for the password to unlock my secret key. After entering it, all went well:

==> Adding package 'dhcpcd-5.6.8-3-x86_64.pkg.tar.xz'
  -> Adding package signature...
  -> Computing checksums...
  -> Creating 'desc' db entry...
  -> Creating 'depends' db entry...
==> Creating updated database file 'local.db.tar.gz'

And finally added the repo in /etc/pacman.conf (I'm only showing the relevant part of the file):

[local]
Server = file:///var/abs/local

I updated the package databases just fine with pacman -Syy. But, after removing the previously-downloaded packages from /var/cache/pacman/pkg, when trying to install the package:

$ pacman -Sy dhcpcd
:: Synchronizing package databases...
 local is up to date
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: dhcpcd is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] y
warning: dhcpcd-5.6.8-3 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Packages (1): dhcpcd-5.6.8-3

Total Installed Size:   0.23 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
error: dhcpcd: signature from "Kalrish (Kalrish Bäakjen) <kalrish.antrax@gmail.com>" is invalid
:: File /var/cache/pacman/pkg/dhcpcd-5.6.8-3-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

So it seems that I have not added my key properly. Can anybody please help me? Any answer, even if it explained why I shouldn't be trying to do this or why I should try other alternatives, will be welcomed.

Best regards,
Kalrish

Last edited by Kalrish (2013-06-28 18:26:30)

Offline

#2 2013-06-28 15:55:21

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Create local repository

Kalrish wrote:

First of all, I'd like to apologize for the terminology. I'm still not sure about what are the names I should use. That said, here's my problem: I want to set up a local repository to place all the packages I've ever built with makepkg. The main reason that has motivated me to do so is that, when building a package, I often need to install make dependencies, such as, for example, xorg-server-devel. That package in particular comes from xorg-server, which I have built by myself. Thus, if a package required it, I should install the correspondent package (the one I've built), and not the generic one coming from the repositories (this case may not be a good example, but, well, just think about kernel headers).

You haven't convinced me that you need to create your own repository, but I understand that was not the purpose of your post... tongue

If you create your own specialized PKGBUILD files, you use them to create packages, and then you install those packages, why do you need your own repository?

Offline

#3 2013-06-28 16:15:07

Kalrish
Member
Registered: 2013-02-27
Posts: 62

Re: [SOLVED] Create local repository

drcouzelis wrote:

You haven't convinced me that you need to create your own repository, but I understand that was not the purpose of your post... tongue

If you create your own specialized PKGBUILD files, you use them to create packages, and then you install those packages, why do you need your own repository?

It wouldn't be a global-accesible repository - it would be for personal use only. I often clean-up directories or mess up things, so that I sometimes need to reinstall a package that I built. For example, I stripped glibc. What would happen if my system got broken? I find it more convenient to store built packages in a separate directory, where pacman can find them.

It may still seem not enough... But, what can I say? (What if we considered this a learning exercise?) It might not be a critical thing - but I'd like to set up this idea.

Offline

#4 2013-06-28 16:18:05

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: [SOLVED] Create local repository

Kalrish wrote:

It wouldn't be a global-accesible repository - it would be for personal use only.

Then what is the purpose of signing your packages?

Offline

#5 2013-06-28 16:22:51

Kalrish
Member
Registered: 2013-02-27
Posts: 62

Re: [SOLVED] Create local repository

msthev wrote:

Then what is the purpose of signing your packages?

I thought it was mandatory, or at least strongly recommended :/
I'll try to clean up everything and set it up again - but without signing.

Thanks!

Offline

#6 2013-06-28 16:30:09

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Create local repository

Kalrish wrote:

It wouldn't be a global-accesible repository - it would be for personal use only. I often clean-up directories or mess up things, so that I sometimes need to reinstall a package that I built. For example, I stripped glibc. What would happen if my system got broken? I find it more convenient to store built packages in a separate directory, where pacman can find them.

You can store all of the packages you build yourself in a directory. I think the only benefit of creating a local repository is so you can use "pacman -S" instead of "pacman -U". Is that correct? It might help with dependency resolution, but if you built the package on that machine yourself then all of the dependencies are already installed.

I hope I'm not being too critical. I just don't want you to work harder than you need to. smile

Offline

#7 2013-06-28 16:41:08

Kalrish
Member
Registered: 2013-02-27
Posts: 62

Re: [SOLVED] Create local repository

drcouzelis wrote:

... if you built the package on that machine yourself then all of the dependencies are already installed.

I was talking about make dependencies, not runtime dependencies. I always build with makepkg -sr :)

drcouzelis wrote:

I hope I'm not being too critical. I just don't want you to work harder than you need to. :)

Of course not, don't worry.

Kalrish wrote:

Any answer, even if it explained why I shouldn't be trying to do this or why I should try other alternatives, will be welcomed.

I love thought-provoking answers as well as personal opinions. Who knows when an unexpected explanation may change my mind and make me think different? You're right: it may not be worth it. But, well, you yourself pointed the "elegant" reason out:

drcouzelis wrote:

I think the only benefit of creating a local repository is so you can use "pacman -S" instead of "pacman -U".

If pacman found the packages by itself, I wouldn't have to execute pacman -U --asdeps for every make dependency that is required by a package - but rather execute makepkg -sr and simply let pacman pick those packages I've built by myself from my local repository, and the rest from the official repos.

Offline

#8 2013-06-28 16:48:29

Kalrish
Member
Registered: 2013-02-27
Posts: 62

Re: [SOLVED] Create local repository

I'm sorry for being silly - it has always been my fault. As msthev pointed out, there's no real need to sign my packages; everything is working fine now.

Just for anyone who reads this in the future and wants to know how I "solved" it, well:

  • Remove everything in the repository.

  • Restore SigLevel in /etc/pacman.conf to its default value, or just comment it out.

  • Disable signing of your own built packages in /etc/makepkg.conf, by putting a "!" character in front of sign, in the BUILDENV array.

Nervertheless, I've just "discovered" gpg; I'll go further with it.

Last edited by Kalrish (2013-06-28 16:49:23)

Offline

Board footer

Powered by FluxBB