DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD Package System (pkgsrc)

NetBSD Package System (pkgsrc) Installation and upgrading of packages on NetBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default Some basic questions regarding pkgsrc use

I have been using NetBSD on and off for some years now, but I still feel very frustrated when it comes to pkgsrc. I don't think the pkgsrc guide gives enough practical information for users like me who are not, to put it kindly, advanced users of NetBSD. I have some questions regarding its use that I would like a NetBSD user to throw some light on so I can use this great operating system to its full potential. I am very fond of NetBSD but I often end up compiling software from source for it because there will invariably be something in the pkgsrc tree that refuses to install for me.

First of all, here is how I would like to use pkgsrc: I prefer source to binaries, and want to compile from source as a normal user and install using the just-in-time su feature. It would be nice if I could do a full unprivileged build to $HOME/usr/{etc,pkg} and $HOME/var but it's not really necessary.

And here are the questions I have, in no particular order:

1) I tend to stick with released or soon-to-be-released versions of NetBSD and the latest quarterly release of pkgsrc.tar.xz. Can I assume this combination will work? Or is it expected that recent quarterly pkgsrc releases work best with NetBSD -current and older quarterly releases should be preferred when using 6 or 7?

2) Regarding modular X, what benefit does this provide that is not in the X shipped with base? Again, I usually have nothing but trouble trying to compile modular xorg and friends and I really do wonder if it provides some benefit that makes it worth the hassle. Nowhere is there a simple explanation of what modular X actually is, and why NetBSD has these two different versions.

3) What does it mean to bootstrap pkgsrc? Again, in the pkgsrc guide it is assumed we just know what this is. There is no explanation whatsoever what it is and whether or not it is needed. After extracting pkgsrc.tar.xz do we need to run the bootstrap script - yes or no?

4) As a completely new user some years ago it took me a long time to find the default mk.conf. Once again, in the pkgsrc guide it is assumed we know where this file is and where it should go. To quote chapter 5: "In which directory pkgsrc looks for that file depends on the installation. On NetBSD, when you use make(1) from the base system, it is in the directory /etc/." Except that it's not in /etc, at least on a newly-installed system. Why on earth can they not simply say "Copy mk.conf from ~/pkgsrc/mk/defaults/ to /etc/ and adjust it according to the following guidelines" and follow up with a set of 10 simple steps to customise your mk.conf? Specifying local Gnu, Perl and Sourceforge mirrors would be a good start. Again, things are taken for granted. I do understand that the BSDs are not meant to be Ubuntu; having said that, many of us who want to use the BSDs are not developers and would rather use the systems than have to jump through these hoops before we can start.

5) Is it possible to mix unprivileged pkgsrc in $HOME/pkg with privileged pkgsrc in /usr/pkg? I recall reading somewhere that pkgsrc allows you to have multiple parallel installs but it seems from my reading elsewhere that this is not recommended.

These are just some of the questions I have as I try to make my way through pkgsrc. I am subscribed to the NetBSD mailing lists but I would prefer not to trouble the pkgsrc developers with such basic questions. They have enough on their plate. I am sure other questions will pop up as I knuckle down to learn how to use pkgsrc properly. It would be great if an experienced NetBSD user here would take some time to answer at least some of them, or better still, to post their own workflow with pkgsrc - how they get it, how and where they extract it, how they set up mk.conf, and how they use it. Thank you.
Reply With Quote
  #2   (View Single Post)  
Old 28th April 2015
pygope pygope is offline
Port Guard
 
Join Date: Apr 2015
Posts: 33
Default

I am also a newbie in netbsd, so I cannot answer of your questions:

1) It should be irrelevant using any version of pkgsrc with any version of NetBSD. They should just work the same. But you can find that a particular package doesn't compile in your NetBSD version with an specific pkgsrc version.
You can check pkgsrc-bulk mail list to see which are the packages that not compiles for your NetBSD and a particular pkgsrc.

2) As far as I know, the only difference is that with modular xorg you can select which packages you want to install and which not , instead of installing a full Xorg from sets.
Modular Xorg (someone corrects me), comes from the time when the default X system was XFree86, mostly due to old architectures NetBSD supports, but Xorg was available for anyone willing to use it.
I use Xorg from installation, so I cannot help more with this question.
3) Sorry, never crossed my mind to install two sets of pkgsrcs. Only can tell you, that I use pkgsrc to build my packages and I never have used bootstrap. I only got to an specific directory and run "sudo make install clean"

I hope I have helped you.
Reply With Quote
  #3   (View Single Post)  
Old 28th April 2015
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 344
Default

This seems to be the place for answers about pkgsrc, (being an OBSD user, I can't give any definitive answers), but maybe this can.
http://wiki.netbsd.org/pkgsrc/
__________________
Linux since 1999, & also a BSD user.
Reply With Quote
  #4   (View Single Post)  
Old 28th April 2015
fn8t's Avatar
fn8t fn8t is offline
Real Name: Ego
Shell Scout
 
Join Date: May 2014
Location: Tao
Posts: 120
Default

Welcome to the forums, gezley!

Quote:
Originally Posted by gezley View Post
1) I tend to stick with released or soon-to-be-released versions of NetBSD and the latest quarterly release of pkgsrc.tar.xz. Can I assume this combination will work? Or is it expected that recent quarterly pkgsrc releases work best with NetBSD -current and older quarterly releases should be preferred when using 6 or 7?
I pretty sure using -current on both just means that you are more likely to find things developers might want to know about (bugs). I doubt that you should expect to see many added issues, if any, in most cases.

Quote:
2) Regarding modular X, what benefit does this provide that is not in the X shipped with base? Again, I usually have nothing but trouble trying to compile modular xorg and friends and I really do wonder if it provides some benefit that makes it worth the hassle. Nowhere is there a simple explanation of what modular X actually is, and why NetBSD has these two different versions.
One thing to keep in mind, is that Pkgsrc is not meant for use strictly on NetBSD. Since you haven't had much luck with modular-xorg, I was wondering if you have tried the meta-pkgs install for it? I think modular-xorg will build the whole lot.

Edit:Some non NetBSD systems may not have xorg binaries available from their maintainers or pkgsrc. If you were to use pkgsrc on a bare install of Slackware or Debian, you might prefer using the modular-xorg over the distributions packaged xorg. Modular-xorg could be useful for someone putting together a hybrid L.F.S. system.

Quote:
3) What does it mean to bootstrap pkgsrc? Again, in the pkgsrc guide it is assumed we just know what this is. There is no explanation whatsoever what it is and whether or not it is needed. After extracting pkgsrc.tar.xz do we need to run the bootstrap script - yes or no?
On non NetBSD systems this is required prior to pkgsrc use.

[QOUTE]4) As a completely new user some years ago it took me a long time to find the default mk.conf. Once again, in the pkgsrc guide it is assumed we know where this file is and where it should go. To quote chapter 5: "In which directory pkgsrc looks for that file depends on the installation. On NetBSD, when you use make(1) from the base system, it is in the directory /etc/." Except that it's not in /etc, at least on a newly-installed system. Why on earth can they not simply say "Copy mk.conf from ~/pkgsrc/mk/defaults/ to /etc/ and adjust it according to the following guidelines" and follow up with a set of 10 simple steps to customise your mk.conf? Specifying local Gnu, Perl and Sourceforge mirrors would be a good start. Again, things are taken for granted. I do understand that the BSDs are not meant to be Ubuntu; having said that, many of us who want to use the BSDs are not developers and would rather use the systems than have to jump through these hoops before we can start.[/QUOTE]

I don't know your complete background. You did mention that you prefer application installation from source files. If you have ever used or looked into Gentoo or Arch Linux, you'll find lots of user inspired documentation. I can agree that some of the NetBSD documentation is not clear enough for every possible user. I also don't mean to say that it has nothing to do with negligence. Volunteering your input is what has helped make a lot of the really good system documentation for many systems. The people required to utilize your input are likely not members of this forum.

Quote:
5) Is it possible to mix unprivileged pkgsrc in $HOME/pkg with privileged pkgsrc in /usr/pkg? I recall reading somewhere that pkgsrc allows you to have multiple parallel installs but it seems from my reading elsewhere that this is not recommended.
Are you asking if an unprivileged user, having built and installed their own packages, can still execute globally built and installed packages? I'm pretty sure you are okay. It may just depend on the situation you are deploying all of this into. How many users are on this system? I could see a dependency being called for globally, and if a user disable certain configuration flags for their unprivileged install of that dependency, the target application may fail to execute. By parallel installations you mean a global pkg directory and a user/home/pkg directory, right?

Quote:
These are just some of the questions I have as I try to make my way through pkgsrc. I am subscribed to the NetBSD mailing lists but I would prefer not to trouble the pkgsrc developers with such basic questions. They have enough on their plate. I am sure other questions will pop up as I knuckle down to learn how to use pkgsrc properly. It would be great if an experienced NetBSD user here would take some time to answer at least some of them, or better still, to post their own workflow with pkgsrc - how they get it, how and where they extract it, how they set up mk.conf, and how they use it. Thank you.
Please ask at both. I won't beg, but in repayment for the possible help you might get, make your plight available for all who way walk the same road one day.

The following isn't targeted at you, gezley. Some industry mature, professional, and time served users may come at you with a sharp object if you sound noob. I'm not gonna come out and say that they've earned the right, but people should consider the pressure a professional can be under from time to time. You could understand a typical response like, "This system is for advanced users, go get Slax on a pendrive if your VLC player won't load!". Be persistent and respectful regardless. There are other users willing to answer with less vinegar. Maybe even one who has burnt you at the stake might give you the required guidance, eventually. There is one thing to keep in mind.... never ask a noob question dress up like it isn't a noob question. I think people have died for this.

Last edited by fn8t; 28th April 2015 at 07:36 PM.
Reply With Quote
  #5   (View Single Post)  
Old 28th April 2015
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

I can't add very much since I only use pkgsrc binaries. About a possible reason to use modular Xorg: back in 2010 I was having a problem with the video in the standard X install. It was suggested to try modular Xorg since it had a newer version of the video driver. It turned out to be educational but didn't fix my problem. But that could be a reason to try it, if there is something newer in it that you need/want. Also, being modular you can install just the parts of X you want.
Reply With Quote
  #6   (View Single Post)  
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by pygope View Post
Modular Xorg (someone corrects me), comes from the time when the default X system was XFree86, mostly due to old architectures NetBSD supports, but Xorg was available for anyone willing to use it.
OK that would make sense. Thanks.
Reply With Quote
  #7   (View Single Post)  
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by bsd-keith View Post
This seems to be the place for answers about pkgsrc, (being an OBSD user, I can't give any definitive answers), but maybe this can.
http://wiki.netbsd.org/pkgsrc/
Thanks Keith. The trouble is, the wiki has been rather haphazard and unreliable ever since the old wiki was taken offline. The following, under "How to use pkgsrc", hardly inspires confidence:

"This wiki is semi-official and is frequently outdated. Sometimes even misleading."

Nor does the wiki definitively address the specific issues I raised.
Reply With Quote
  #8   (View Single Post)  
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by fn8t View Post
Welcome to the forums, gezley!
Thanks! Been here a while in fact but never used it that much, mainly because I quickly resolved all the problems I ever had with NetBSD ever since I started using it some years ago, except, of course, for this niggling issue with pkgsrc. At one point some years ago I had a fairly complex Xen setup working with various paravirtualised domUs in a virtual LAN. I do know my way around the system but the lack of clear, up-to-date and definitive instructions for pkgsrc use on NetBSD (not other systems) still bothers me, and other resources around the web, claiming to show how to use pkgsrc, quickly throw up some problem or other.

Quote:
One thing to keep in mind, is that Pkgsrc is not meant for use strictly on NetBSD. Since you haven't had much luck with modular-xorg, I was wondering if you have tried the meta-pkgs install for it? I think modular-xorg will build the whole lot.
Yes indeed I tried to build modular-xorg yesterday and it failed while building the dependency tradcpp.. Using a recent 7 beta ISO and 2015q1 pkgsrc release. That's when I threw up my hands in despair and came here for help. Might as well report it as a bug but I fear the problem might be that I'm doing something wrong the way I set up pkgsrc in the first place.

Quote:
Are you asking if an unprivileged user, having built and installed their own packages, can still execute globally built and installed packages? I'm pretty sure you are okay. It may just depend on the situation you are deploying all of this into. How many users are on this system? I could see a dependency being called for globally, and if a user disable certain configuration flags for their unprivileged install of that dependency, the target application may fail to execute. By parallel installations you mean a global pkg directory and a user/home/pkg directory, right?
It's just my own private system. It would be nice to be able to build and install most software as an unprivileged user: emacs, for example, and rxvt-unicode. But I suspect some software would need to be or should be installed system-wide: a web server, for example, which really shouldn't run from $HOME. I can't find the link but I'm pretty sure I read somewhere that you can have parallel pkgsrc trees and installations.

Quote:
The following isn't targeted at you, gezley. Some industry mature, professional, and time served users may come at you with a sharp object if you sound noob. I'm not gonna come out and say that they've earned the right, but people should consider the pressure a professional can be under from time to time. You could understand a typical response like, "This system is for advanced users, go get Slax on a pendrive if your VLC player won't load!". Be persistent and respectful regardless. There are other users willing to answer with less vinegar. Maybe even one who has burnt you at the stake might give you the required guidance, eventually. There is one thing to keep in mind.... never ask a noob question dress up like it isn't a noob question. I think people have died for this.
Well I wasn't trying to dress up my question. I'm not a NetBSD noob; been using it for perhaps 5 or 6 years on and off. Thank you for your help.
Reply With Quote
  #9   (View Single Post)  
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by IdOp View Post
I can't add very much since I only use pkgsrc binaries. About a possible reason to use modular Xorg: back in 2010 I was having a problem with the video in the standard X install. It was suggested to try modular Xorg since it had a newer version of the video driver. It turned out to be educational but didn't fix my problem. But that could be a reason to try it, if there is something newer in it that you need/want. Also, being modular you can install just the parts of X you want.
OK. I think the gap has narrowed recently but there is still a gap. X11 in base didn't work for me yesterday while testing NetBSD in Virtualbox. That's when I decided to start over again and try modular X. But that refused to build. It's very frustrating at times like this to be told the answer lies in the pkgsrc guide, when the answer clearly doesn't lie in the pkgsrc guide.
Reply With Quote
Old 29th April 2015
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by gezley View Post
It's very frustrating at times like this to be told the answer lies in the pkgsrc guide, when the answer clearly doesn't lie in the pkgsrc guide.
I can understand how you feel about that, since I felt it at times back then too. I don't mean to complain too much, the guide was still very helpful getting me to do what I did, couldn't have done it without, just had to muddle through some parts. My sense was that it hadn't been updated for a while; haven't looked at it lately so not sure if that's still true.

I don't use any modern virtualization, but just wondering if you could rule out that as the source of problems. Can you install on a USB stick and check on the proverbial bare metal?
Reply With Quote
Old 29th April 2015
fn8t's Avatar
fn8t fn8t is offline
Real Name: Ego
Shell Scout
 
Join Date: May 2014
Location: Tao
Posts: 120
Default

Quote:
Originally Posted by gezley View Post
Yes indeed I tried to build modular-xorg yesterday and it failed while building the dependency tradcpp.. Using a recent 7 beta ISO and 2015q1 pkgsrc release. That's when I threw up my hands in despair and came here for help. Might as well report it as a bug but I fear the problem might be that I'm doing something wrong the way I set up pkgsrc in the first place.
Maybe not. there are some pretty heavy changes happening with video. I remember seeing that error mentioned a time or two already.

Quote:
It's just my own private system. It would be nice to be able to build and install most software as an unprivileged user: emacs, for example, and rxvt-unicode. But I suspect some software would need to be or should be installed system-wide: a web server, for example, which really shouldn't run from $HOME. I can't find the link but I'm pretty sure I read somewhere that you can have parallel pkgsrc trees and installations.
You could actually teach me here. Why the need for parallel trees?

Quote:
Well I wasn't trying to dress up my question. I'm not a NetBSD noob; been using it for perhaps 5 or 6 years on and off. Thank you for your help.
No, certainly not. It just seemed like a good time to mention it.
Reply With Quote
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by fn8t View Post
You could actually teach me here. Why the need for parallel trees?
It's not that I need them. If I could get away with compiling and installing all software as an unprivileged user I would. I somehow doubt that's feasible, so the next best thing is to compile and install 70, 80, or 90% of pkgsrc as an unprivileged user and the remainder compiled as unprivileged user and installed with just-in-time su. I'm a firm believer in the principle of least privilege.

In the third post at the link below Aleksey Cheusov suggests "multiple instances of pkgsrc packages on single host" are possible.

Link to thread at NetBSD mailing list archive
Reply With Quote
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by IdOp View Post
I don't mean to complain too much, the guide was still very helpful getting me to do what I did, couldn't have done it without, just had to muddle through some parts.
Yes; while I get frustrated I won't hear a bad word said about NetBSD. They do a sterling job on limited resources. It always amazes me how well it works.
Quote:
I don't use any modern virtualization, but just wondering if you could rule out that as the source of problems. Can you install on a USB stick and check on the proverbial bare metal?
Good idea! Installing to a spare USB is something I always overlook. Thanks.
Reply With Quote
Old 29th April 2015
fn8t's Avatar
fn8t fn8t is offline
Real Name: Ego
Shell Scout
 
Join Date: May 2014
Location: Tao
Posts: 120
Default

Quote:
Originally Posted by gezley View Post
It's not that I need them. If I could get away with compiling and installing all software as an unprivileged user I would. I somehow doubt that's feasible, so the next best thing is to compile and install 70, 80, or 90% of pkgsrc as an unprivileged user and the remainder compiled as unprivileged user and installed with just-in-time su. I'm a firm believer in the principle of least privilege.

In the third post at the link below Aleksey Cheusov suggests "multiple instances of pkgsrc packages on single host" are possible.

Link to thread at NetBSD mailing list archive
Sorry, I read too much into your setup. I thought you were looking to run another privileged tree in addition to the existent privileged/unprivileged combo. It wasn't the way you wrote anything either. It was just that time of night for me.
Reply With Quote
Old 29th April 2015
gezley gezley is offline
Port Guard
 
Join Date: May 2009
Location: Ireland
Posts: 12
Default

Quote:
Originally Posted by fn8t View Post
Sorry, I read too much into your setup. I thought you were looking to run another privileged tree in addition to the existent privileged/unprivileged combo. It wasn't the way you wrote anything either. It was just that time of night for me.
No need to apologise! I do the ungodly hour routine as well!

Reply With Quote
Old 30th April 2015
abs abs is offline
Port Guard
 
Join Date: Jul 2012
Posts: 12
Default NetBSD, VirtualBox & X

Quote:
Originally Posted by gezley View Post
OK. I think the gap has narrowed recently but there is still a gap. X11 in base didn't work for me yesterday while testing NetBSD in Virtualbox. That's when I decided to start over again and try modular X. But that refused to build. It's very frustrating at times like this to be told the answer lies in the pkgsrc guide, when the answer clearly doesn't lie in the pkgsrc guide.
I dual boot my Thinkpad T420s between NetBSD and Windows 7. I recently switched to NetBSD 7_BETA and have run X11 both in NetBSD-6 and NetBSD-7 as a VirtualBox guest (obviously with a different xorg.conf to native

As an aside, if you are running NetBSD in VirtualBox or similar under Windows you may want to look at http://mobaxterm.mobatek.net/ - the provide a free Windows X server which allows you to open a mobaxterm window, ssh to your NetBSD guest and then run X apps onto the Windows desktop. Very handy indeed if you need to run some windows Apps but you want to run your NetBSD firefox from its nice encrypted cgd partition...
Reply With Quote
Reply

Tags
netbsd pkgsrc beginner

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
openbsd basic questions barti OpenBSD General 12 17th July 2012 08:38 PM
basic rsync questions unixjingleman FreeBSD General 5 27th May 2011 04:39 AM
basic IRQ question unixjingleman OpenBSD Installation and Upgrading 1 3rd January 2011 04:49 PM
Which is the significance about pkgsrc-2009Q2 and pkgsrc-2009Q3? aleunix NetBSD Package System (pkgsrc) 3 16th December 2009 07:19 AM
Basic starter questions ??? dennky OpenBSD Installation and Upgrading 10 5th December 2009 07:21 PM


All times are GMT. The time now is 07:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick