|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
|
Thread Tools | Display Modes |
|
|||
Why ports?
Hi
everyone I have been using freebsd for about a month now and I have the following questions: 1) Why ports? It often takes such a long time to compile these packages and to install it. For example, it took me like an hour to compile azureus and mozilla. Why then is this preferred? 2) What controls the network service in FreeBSD? I tried to back up everything I have on my laptop, and I used scp. Whenever it uploads after a certain amount of time, my freebsd 's internet connection gets completely cut off. How do I diagnose this problem? |
|
||||
To elaborate a little more on ports--they sometimes have a newer version than does the package. Plus they allow more flexibility in configuration.
It's a bit of a trade off, but most of the time, not really a noticeable one. However, there are over 16,000 ports and not all have packages, especially for say, CURRENT. There are ports vs. packages threads all over, including, I believe, in the handbook. For mozilla, for example, with its long compile time especially when the chances are that you won't be customizing the installation, packages are almost certainly the better choice. |
|
|||
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident! |
|
|||
But how does that provide benefits from the user's point of view? Linux has repositories which they can download precompiled binaries.
FreeBSD allows you to compile from scratch. What is the advantages to this??? (Aside from optimization; if it is a huge factor, how much more optimized can it be?) |
|
||||
From the FreeBSD handbook, chapter 4.2:
Package Benefits
Ports Benefits
|
|
||||
Quote:
FreeBSD offers you both choices, and leaves it up to you. Packages = binary, ports = source. If you need compile-time optimizations and/or customizations, use ports. Maybe you need an application to rely on PostgreSQL instead of MySQL, but the package is compiled against MySQL! Use ports there. In a binary-only linux distribution, you'd be out of luck, and forced to compile your own, outside of any package management. Know that all packages you download are actually just pre-compiled versions of the exact same things in your ports tree. Try it yourself: cd /usr/ports/category/port && make package |
|
||||
I think Carpetsmoker said it best hehe.
Simply put, packages are created from ports, binaries are created from source code, and you can't really modify binaries very well !!! One of the things I love most about ports is the possibility to build packages with the desired build options on one machine then nfs or sftp them over to other systems to be installed that also need them :-)
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
Quote:
Anyway, reading your post TerryP made me ask a question related to the original point in ways. I understand you compile from source on one machine and make those build packages of some use on another machine etc. As I've seen myself building everything from Ports with basic Make.conf optimizations, would you or, anyone reading, happen to have any tips or tricks on compiling on one machine and using them later on or on a another machine? |
|
||||
the easiest way is to make a package with what ever build options you need.
When you do a 'make package' or 'make package-recursive' in a ports directory (e.g. /usr/ports/x11-wm/blackbox) and use the environment variables out lined in ports(7) to control their placement. Generally if you create /usr/ports/packages/ they will go there by default; last time I needed to make packages. A nice trick is to mount the build machines /usr/ports/packages/All/ on the target system over nfs and pkg_add them. When it comes to deploying them on another PC, you have to watch the optimizations and build options to make sure it will work. For example, if your system is set to generate code that will only execute on an i686 CPU and you need to get the package installed on a system running an i586 you've got to rebuild the package for it. That's why the GENERIC kernel configuration has 'cpu I486_CPU', cpu I586_CPU', and 'cpu I686_CPU'. The Intel 80486 is basically the lcd, even though most users would hopefully have newer chips even in older serves... (I've bumped into a few netizens with 486/pentium pro servers). What kind of stuff do you have in make.conf and whats the difference between the build and target machines?
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
My experience with packages on FreeBSD has been dismal at best, but on OpenBSD it is stellar. I do really like the ports way of doing things in FBSD. I can see a large difference in performance on my Apache servers and more so on my MySQL servers. IMHO, on FBSD use ports, and on OpenBSD use packages. Of course, YMMV.
-Tim |
|
|||
I believe the FreeBSD team are working on better package tools but yes, I agree the pkg system on FreeBSD is pretty crappy and ports are by far the more preferred option.
|
|
||||
Personally, I find packages better suited for getting a system up and running right away (just a bunch of
# pkg_add -r commands), but ports are better for keeping a system up-to-date and only using/installing/running the bits you want.To get the best of both worlds, configure a build system where you use the ports tree to build packages, and then use the pkg_* tools on the target system to install them. That way, you don't even need a compiler toolchain or ports tree on your in-use systems. |
|
||||
Quote:
I would just say that basically as I'm still young and all, I tend to break things over and over again giving myself good "build & .conf -weekends" with freebsd... Time to time that starts to get a bit repetitive, and usually it ends with my face on the keyboard... So that obviously means, I would use the packages usually on a single i686 machine... |
|
||||
Breaking and having to fix stuff is usually a good way to learn ;-)
Keyboards probably make worse pillows then laptops..... hehe
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
packages vs ports | zelut | FreeBSD Ports and Packages | 17 | 28th October 2009 08:19 AM |
Broken ports in /usr/ports/x11 | DNAeon | FreeBSD Ports and Packages | 3 | 5th July 2009 08:20 PM |
How do you update ports? | disappearedng | FreeBSD General | 6 | 8th November 2008 05:59 AM |
no /usr/ports or /usr/src/ports ?? | ukulele | OpenBSD Installation and Upgrading | 3 | 27th July 2008 09:50 PM |
Install ports from cd? | xCipherx | OpenBSD Packages and Ports | 5 | 2nd June 2008 06:35 PM |