Noob question... reddit / BSD ---------------------------------------------------------------------- [deleted] · 2011-01-27 20:03 Is there a performance benefit, in terms of using the installed app/binary after using the "make install" system vs package add to add app to the os? ---------------------------------------------------------------------- kmwhite · 2011-01-27 20:14 Some of the ports (I noticed this last night when building things related to mplayer) have a use optimizations option you can select. This, however, is not picked by default. The actual performance gains yielded? I have no idea... For my usage, I usually stick with packages, but where I want to customize it a bit more (only have certain protocols in pidgin or enable 256-colors in rxvt-unicode) I build ports. ---------------------------------------------------------------------- [deleted] · 2011-01-27 20:26 I appreciate your input. One more question, is it actually faster building an app with package add? I have only used ports thus far, and the installations go smooth, but they seem to take forever. Thanks! ---------------------------------------------------------------------- rainman_104 · 2011-01-27 21:12 A bit of google-fu is your friend: http://oscartheduck.wordpress.com/2007/07/25/on-ports-vs-pkg_add-a- digression-into-keeping-your-freebsd-programs-up-to-date-with-the- latest-patches-and-software/ pkg_add gives you binary installs; ports gives you source installs with the benefit of dependency resolution. If you're installing something like KDE, pkg_add will make you not curse. But with stuff like php where you need to set the configure flags before building if you want to tweak the install, ports are your friend. ---------------------------------------------------------------------- cjg_ · 2011-01-27 21:20 Yes, packages are faster as they are precompiled. ---------------------------------------------------------------------- NihilisticAbandon · 2011-01-27 21:41 Honestly, please read the manual -- your question suggests that you don't understand the difference between the ports system and the package system. The ports system basically grabs the source code (along with dependencies), compiles it, and "make install" installs the compiled binary and other necessary files onto your system. A simple "make" will simply just grab and compile the source code, but will not install it into the system. You may want to check out some ports fronteneds, like portmaster. Portsnap is also a nice program for updating the ports tree (_but_ not the programs themselves!) so that you can update programs with portmaster. The packages system is a collection of binary packages that have already been compiled for you -- there is no compilation needed, however, you do not get to set compile-time options such as extra features or performance optimizations. Whether or not it is a good idea to mix ports and packages together is something I'm wondering. I'm thinking that ports is more up-to-date, but I have not checked to see if that's the case. ---------------------------------------------------------------------- uxp · 2011-01-27 23:16 If one is familiar with Ubuntu/Debian, `portsnap fetch update` is just like `apt-get update`, and `portupgrade -a` or `portmaster -a` is just like `apt-get upgrade`, when using the Ports. When using packages, instead of `dpkg*`, one uses `pkg*`. `dpkg` is based on the BSD `pkg`, so the idea is very similar. `portmaster` and `portupgrade` both have flags to force packages instead of ports, or you can do it manually for each port or package. To manually upgrade a single port, you would: cd /usr/port/sysutils/lsof sudo make deinstall sudo make sudo make reinstall sudo make clean Mixing Ports and Packages together is perfectly safe. Ports will be more up to date, because when a maintainer updates the port, that gets committed to the Ports tree, and users can then fetch the new port files, and update immediately. The packages are built upon the committed port files, and it may take some time to do so on the BSD tinderbox (their build servers). `man ports` is your friend. It took me some time to realize this, but the BSD manpages are much more helpful than their GNU counterparts. Try to get in the habit of always going there first, since your questions will most likely be answered. FreeBSD's [handbook](http://www.freebsd.org/doc/handbook/) is also incredibly helpful. And like you said, ports have more options. Specifically, I like to use Postfix instead of Sendmail as my MTA. Postfix has an option to rewrite its --prefix= to /usr instead of /usr/local (/usr/local is generally where ports and packages go). Perl's port also has this same option with symlinks, because they both are alternates to the versions installed with the base system. Installing from Packages will not give you that option, so sometimes its best to check out what configuration is available before installing from packages with `make showconfig` And, in multi server configurations, like in a colo farm, you might want to devote a box as your buildbox, where you build all the ports for all your servers on that one box, then package your custom built port and send it to your production servers, and then install that package instead of having to manually build ports on every one of your servers. `make package` is what you'd end up doing. ---------------------------------------------------------------------- [deleted] · 2011-01-27 23:16 Sorry if I was un clear. I am not questioning the differences in how port and pkg_add install programs, but if compiling and program on your computer means you get a better quality/efficient program whos built specify on or around my hardware. So it may be better to ask, if you compile and program, dose that make that program run better, vs pkg_add something that has been precompiled. ---------------------------------------------------------------------- edogawaconan · 2011-01-28 01:36 > Mixing Ports and Packages together is perfectly safe until you try to update your system. > Perl's port also has this same option with symlinks, because they both are alternates to the versions installed with the base system there's no perl in base, nor postfix ---------------------------------------------------------------------- uxp · 2011-01-28 05:28 > until you try to update your system. Care to give context? You're the first to say to me that it absolutely has problems. > there's no perl in base, nor postfix Ah, you're right. Perl was removed from base some time ago. I forgot about that, but the Port still retains the option to symlink it to /usr. You are right about Postfix as well, but I was referring to the fact that the default MTA in base is Sendmail, but I prefer Postfix, which is capable of completely overwriting the `mail` and `sendmail` executables from Sendmail with it's own. ---------------------------------------------------------------------- edogawaconan · 2011-01-28 16:06 > Care to give context? You're the first to say to me that it absolutely has problems. How do you upgrade your system? Manually write down which packages installed through ports and binary pkg? How do you handle big upgrades (ie. perl default update 5.10 -> 5.12) and the packages which depend on them? ---------------------------------------------------------------------- uxp · 2011-01-28 18:57 > How do you upgrade your system? cd /usr/src csup /root/supfile make buildworld make buildkernel KERNCONF=MYKERNEL make installkernel KERNCONF=MYKERNEL mergemaster -p make installworld mergemaster I have `/usr/sbin/portsnap -I cron update && /usr/sbin/pkg_version -vIL=` as a crontab entry, which mails me a list of all ports that need updating nightly. When a security vulnerability is known, or once a week on a specific day, I parse that email on my build server and create new packages for that port, usually manually. I then install those packages with portupgrade with -PP specified, and my servers are configured to pull all packages from my buildserver, not ftp.freebsd.org. On the rare occasion that I require something built on my servers directly for say updating Perl from 5.10 to 5.12, I'll ssh over and follow /usr/ports/UPDATING: pkgdb -Ff env DISABLE_CONFLICTS=1 portupgrade -o lang/perl5.12 -f perl-5.10.\* portupgrade -frPP perl I have not once ever had any conflicts by installing a binary package on a base system, then using ports to update it. My systems are configured to know about my buildserver, and will pull all binary packages from there. Am I doing something wrong? I have a number of systems that I've kept running for years using this method and not once have I had a problem due to ports or packages mangling each other. Like I asked before, what are the possible implications of mixing ports and packages on a single system? ---------------------------------------------------------------------- edogawaconan · 2011-01-28 19:31 so, are you updating using ports or packages? Did you mean you only use packages for initial installation and later do update using ports? If you update using ports, do you customize the OPTIONS? If yes, how do you find the orphan dependencies? Also it seems you're using portupgrade to install binary package. Do you manually modify make.conf to tell portupgrade some special cases (ie forcing mysql51-client for php dependency)? Last time I tried using packages from dedicated build server through portupgrade, it messed up dependencies - it tried to install postgresql81-client package for php-pgsql and such while it's built using more recent version in the buildserver. You mentioned updating perl by ports on the production server (not the build server) - do you always replicate that on the build server? *also I mistyped previous question, should be "how do you update your system's packages" ---------------------------------------------------------------------- uxp · 2011-01-28 22:26 What the fuck does it matter? Why are you so fucking curious as to my method? I usually use Packages, built by myself, but some special cases require Ports, built directly on the server. I always read UPDATING before I start my process, and if there are any irregularities (like having to rebuild every port that depends on Perl for example), then I usually will do that on the servers, unless I can get by with building everything once on my buildserver, *Just Like I Told You In My Previous Comment*. Answer the question, What are the possible implications of mixing Ports and Packages on one server? You came out of fucking nowhere with a claim "Mixing ports and packages is a bad idea", yet you have yet to back up your claim, where Hundreds of other BSD administrators I have talked to have never even eluded to that same claim. If you know something special, please, enlighten us. edit: Yes, my make.conf is very customized on every one of my servers. ---------------------------------------------------------------------- edogawaconan · 2011-01-29 03:12 Because I have experienced bad thing by mixing ports and packages. So did my friends. Also so did [someone on internet](http://oscartheduck.wordpress.com/2007/07/25/on-ports-vs- pkg_add-a-digression-into-keeping-your-freebsd-programs-up-to-date- with-the-latest-patches-and-software/). I have mentioned the difficulties on doing that - synchronized/complex make.conf (my make.conf is mere 28 lines), how sometimes it's impossible to stay with "binary packages always updated with binary package, source packages always updated with source package", how you actually do that with your own buildserver - not using pointyhat. If that doesn't sound like maintenance hell (especially when the installed package count well over hundreds), I guess you just really like doing something like that - something I can't comprehend. Simplest example would be: 1. you installed mysql55-server through ports 2. then you decided to install ruby-mysql through packages 3. default mysql dependency on ruby-mysql is mysql51-client - whereas you have mysql55-client installed and registered conflict with mysql51-client 4. whoops. Output: [root@freebsd64 nginx]# pkg_add -r ruby18-mysql Fetching ftp://ftp4.freebsd.org/pub/FreeBSD/ports/amd64/packages- 8-stable/Latest/ruby18-mysql.tbz... Done. Fetching ftp://ftp4.freebsd.org/pub/FreeBSD/ports/amd64/packages- 8-stable/All/mysql-client-5.1.54_1.tbz... Done. pkg_add: package 'mysql-client-5.1.54_1' conflicts with mysql- client-5.5.8_2 pkg_add: please use pkg_delete first to remove conflicting package(s) or -f to force installation pkg_add: pkg_add of dependency 'mysql-client-5.1.54_1' failed! ---------------------------------------------------------------------- [deleted] · 2011-01-29 21:29 [deleted] ---------------------------------------------------------------------- PHiZiX · 2011-02-05 00:51 i was learning by reading this thread. i'm not so sure why you are getting angry. he was just asking what works for you, since there are all sorts of wierd little facts you need to know to make a functional FreeBSD system. he provides an example below. are we just too damn dumb to deserve your knowledge? ---------------------------------------------------------------------- uxp · 2011-02-05 22:18 No. I had explained how I update my systems, including mixing packages and ports. He said it was a bad idea, but didn't give a reason besides "It'll screw it up". I was asking for clarification because I have never once had my system's Ports or Packages get mangled like he finally said could happen. After 3 times of asking for clarification, and him responding with more questions specific to my use that are really irrelevant to an abstract concept, I became frustrated and it started to sound like he didn't have an answer in the long run. His final reasoning was that if one installs something like MySQL 5.5 from the ports tree, and then installs the MySQL driver for Ruby from packages, it will pull in 5.1 (it will actually pull on 5.0). His reasoning is correct, but it is not because there is a problem with the way Ports and Packages intermix. It is due to the fact that databases/mysql50-client is a direct dependency to databases/ruby- mysql. If one wants to override that dependency with an alternate version, then they need to create that package themselves. Blindly installing Ports and Packages will screw up your system. Carefully understanding what dependencies are required for every port, and configuring your system to use that is how someone should operate. edit: seriously, read `man ports` and the Handbook. It isn't that fucking hard. Blindly installing programs left and right will do nothing but screw up your system and make it run as slow and bloated as a Windows Desktop from Dell. Unix's motto is do one thing and do one thing well. Your servers should operate on that principle as well.