You are not logged in.

#1 2016-03-29 14:12:26

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

[SOLVED] makepkg and PKGDEST

Hi folks,
often I use makepkg for building custom packages. I'd like to save the compilation results, the packages, in order to get an "higher" security level...
I want makepkg saves .pkg into the same directory used by pacman.
So, I edited (created) ~/.makepkg.conf with the below lines:

PKGDEST=/var/cache/pacman/pkg

I get this error:

==> ERROR: You do not have write permission to store packages in /var/cache/pacman/pkg.
    Aborting...

Is this normal? (at first blush I think yes, /var -> root, but thinking more deeply, I'm not sure about it because makepkg should only take care of building the package...)
How can I fix it?

Thanks you

EDIT: solved

Last edited by nTia89 (2016-03-29 17:04:32)


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#2 2016-03-29 14:16:24

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] makepkg and PKGDEST

Yes, that is normal.

/var/cache/pacman/pkg is usually used by pacman, for downloading and installing packages as root. makepkg doesn't run as root so it can't write to there (and it doesn't elevate to root either, except for un/installing make/depends).
I use /var/cache/pacman/custom as my PKGDEST which I gave 777 permissions. (This is also the location of my custom repository for AUR packages.)

Last edited by eschwartz (2016-03-29 14:18:35)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2016-03-29 16:35:31

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

ok @Eschwartz, thanks for the advice!


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#4 2016-03-29 17:03:51

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

I'd like to advice you of another way:
using yaourt (I don't know if other aur helpers have this feature too...)
just edit .yaourtrc enabling

EXPORT=2

option.
This edit makes yaourt to ask the password in order to write in the pacman's cache!

SOLVED

PS: I'd like to see the same feature in makepkg; prior to open an worthless bug our bugtracker, let me know if itis not a good idea!


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#5 2016-03-29 17:08:40

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [SOLVED] makepkg and PKGDEST

I don't think it is a necessary feature, and saying "yaourt does it" doesn't actually help the case for it.  wink  makepkg packages are necessarily foreign to the official repositories.  Mirroring them into your local package folder blurs that distinction a bit, and blurring the distinction  in itself is where much of the criticism of yaourt gets directed at.

Offline

#6 2016-03-29 17:32:18

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

mh... I think you can export into a different directory and yaourt will continue ask for password if needed, that is what makepkg is missing

OT: anyway, I use default pacman's cache because I don't see any problems doing it so (I'm a desktop user);
what have you pointed out,  is a need issues or just a concept issue?


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#7 2016-03-29 17:46:02

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [SOLVED] makepkg and PKGDEST

It's a concept issue.  Putting built packages into pacman's cache while a perfectly legal thing to do, and convenient, I personally believe is a "wart," as in not the most elegant solution.

Offline

#8 2016-03-29 17:49:47

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

please, let me know the best solution in your opinion


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#9 2016-03-29 18:12:35

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [SOLVED] makepkg and PKGDEST

When you build a package and wish to keep it put it in a folder with all your other self-built packages.  That separation will not let you ever "forget" that the package isn't actually part of the official repositories.  From there you could do some kind of job to mirror the packages to a back-up over your network or any other method to implement the same if you don't want to rely on a single-point-of-failure.

Offline

#10 2016-03-29 18:25:56

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] makepkg and PKGDEST

Again, I set PKGDEST in makepkg.conf
And in yaourtrc I have EXPORT=1 so yaourt moves the built packages to where makepkg would've put them anyway.

I feel that is the most elegant solution, especially since I then use /var/cache/pacman/custom as a custom local repository and add it as a second CacheDir in pacman.conf -- why make things harder for myself by mixing in foreign packages in the (main) cache?

Last edited by eschwartz (2016-03-29 18:26:10)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2016-03-29 18:49:22

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [SOLVED] makepkg and PKGDEST

Back, back!  To the pits of hell from which you spawned yaourt!  wink  I think you can surmise from that my opinion of it.  big_smile  cower, for the win!  smile

Offline

#12 2016-03-29 19:46:00

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

Eschwartz wrote:

Again, I set PKGDEST in makepkg.conf
And in yaourtrc I have EXPORT=1 so yaourt moves the built packages to where makepkg would've put them anyway.

...
...
...

but in my case (dir=/var/cache/pacman/pkg owned by root), with your configuration (EXPORT=1), using makepkg (lonely, no yaourt) breaks the chain!


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#13 2016-03-29 21:06:44

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] makepkg and PKGDEST

If you absolutely positively insist that you must store built packages in /var/cache/pacman/pkg, then you will need to give your user write access to root-owned directories...

I can keep on telling you it is a better idea to use a separate new directory like /var/cache/pacman/custom, but if you are just going to ignore me there is no use doing so.

...

Regardless, yaourt is irrelevant, like all AUR helpers it (can) simply depends on makepkg to determine what happens to built packages.
Yes, you can also set it to "store packages in pacman's CacheDir", but that is entirely out of makepkg's scope and I can promise you the pacman devs will NEVER go for that!

What is so hard about using some other directory?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#14 2016-03-29 21:16:19

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

simply, I interpret the KISS philosophy in this way...
- I put all installed packages into a single folder
- obtaining it in the easiest way, compatibly with my needs


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#15 2016-03-29 21:20:35

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [SOLVED] makepkg and PKGDEST

Ok, you're running low-ish on disk space so what should you do as a band-aid?  Well, pacman's cache is the first thing to throw overboard - pacman -Scc as the butcher method.  But, now, you have all your AUR packages mixed in with that folder..  Uh-oh..

Offline

#16 2016-03-30 10:47:30

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [SOLVED] makepkg and PKGDEST

ok, I give it a try...
I will create /var/cache/pacman/pkg/mattia-custom-build


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

Board footer

Powered by FluxBB