Slashdot Mirror


FreeBSD Ports Tricks

BSD Forums writes "One of FreeBSD's biggest benefits is its ports collection. You can go years without learning more than just make install clean, but there are dozens of features built into the ports tools. OnLamp's Dru Lavigne demonstrates several of these tricks to simplify your life."

26 of 201 comments (clear)

  1. yes by Openadvocate · · Score: 4, Informative

    And you can even find the Bittorrent client.

    --
    my sig
    1. Re:yes by m0rten · · Score: 5, Informative
      Guys, what happens if I remove a piece of software after it's been installed and lots of other software depends on it. Will "Ports" warn me about what will break, or will it just go ahead and do it, and leave me scratching my head trying to figure out what happened?
      It will warn you that there are other ports depending on this port. However you can forcefully remove it if you wish (and then you're on your own..)
    2. Re:yes by GodOfNothing · · Score: 2, Informative

      Yes, the dependencies are fully listed in both directions (requires and required by)

  2. Useful by billatq · · Score: 4, Informative

    These are pretty useful little tips, thought it looks like almost all of them are in the FreeBSD handbook already.

    1. Re:Useful by Anonymous Coward · · Score: 1, Informative

      Unfortunately FreeBSD doesn't do very well in comparison to the performance achieved by other systems such as Windows or Linux. Sys Admin magazine wrote this story on the very topic. It's a good read.

    2. Re:Useful by Anonymous Coward · · Score: 1, Informative

      Ah hah! The followup is a bit better. The main difference by the looks are using similar sort of filesystem modes as the other OSs. FreeBSD catches up quite a bit which is more like I would have expected.

      Still a dated comparison though.

  3. Re:BSD is Dying by usotsuki · · Score: 4, Informative

    Maybe not but it sure as hell runs Debian!

    -uso.

    --
    Dreams, dreams, don't doubt dreams, dreaming children's dreaming dreams. Sailor Moon SS
  4. Re:Envy by Phroggy · · Score: 3, Informative

    Somebody is working on iPortage, a Cocoa-based GUI front-end to Gentoo's packaging system...

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  5. Re:BSD is Dying by SiliconJesus101 · · Score: 5, Informative
    Well, actually it can in fact run quite a few Linux applications. A friend of mine (ack, how cliche') has a Quake III Arena server running on his BSD box and as far as I know most Linux ELF binaries can be coaxed to run on BSD without too much of a hassle (again from what my friend says).

    From http://www.freebsd.org/doc/en_US.ISO8859-1/books/h andbook/linuxemu.html , actually it can in fact run quite a few Linux applications.

    "In a nutshell, the compatibility allows FreeBSD users to run about 90% of all Linux applications without modification. This includes applications such as Star Office, the Linux version of Netscape, Adobe Acrobat, RealPlayer 5 and 7, VMWare, Oracle, WordPerfect, Doom, Quake, and more. It is also reported that in some situations, Linux binaries perform better on FreeBSD than they do under Linux." "In a nutshell, the compatibility allows FreeBSD users to run about 90% of all Linux applications without modification. This includes applications such as Star Office, the Linux version of Netscape, Adobe Acrobat, RealPlayer 5 and 7, VMWare, Oracle, WordPerfect, Doom, Quake, and more. It is also reported that in some situations, Linux binaries perform better on FreeBSD than they do under Linux."

    --

    "The strong will do what they want, the weak will do what they must."
    -Thucydides

  6. Re:Envy by hondo_san · · Score: 3, Informative
    My father has been a Mac person since there *was* a Mac, and quite a geek, to boot. Recently, he proposed doing a bunch of of server-y stuff on his G4, to which I responded "why potentially mess up your OS-X install when you can get FreeBSD on another server in the house?" (wired Cat-5 in every room.) He hooked me up with a 1GHZ Pentium with 512MB of memory, and a 40GB drive, now running in the basement with 4.8, horribly underutilized, but ready for anything.

    I certainly don't wish to cast dispersions on OS-X, but since I work w/ FBSD, I'm more comfortable with this scenario, as the "critical data", i.e. 2 years of stuff, is still in its place on the Mac, and the new server is ready and willing to do whatever we throw at it.

    So, mostly a fear of screwing up the OS-X stuff (I am nervous about a server-capable machine with a gui), I fall back to what I know. A colleague of his is running a WAP and Postgres from his Mac laptop, so, I suppose it's really about what you're comfortable with - provided it works, and is secure out of the box.

    Before you flame, in my noob days, I got r00ted in RH (6.2 default) and FBSD (OpenSSH). But that was a lifetime ago, three years. In that time, the modularity of FBSD, IMHO, has allowed me to more easily and efficiently stay current and less vulnerable.

    The ports tree rocks.

  7. Yes, FreeBSD does run Linux. by Anonymous Coward · · Score: 4, Informative

    The install process asks you: "Do you wish to enable Linux compatibility?"

    If you answer yes, it installs a loader that translates a Linux program's system calls into FreeBSD ones. It works rather well.

    I've personally run the Linux binaries of Unreal Tournament 2003 on FreeBSD 4.8 with full OpenGL 3D acceleration on my Pentium 3/800 with an NVidia GEForce 3. It ran better than the Windows version does on the same hardware.

    Many other 3D accelerated Linux games (like Quake 3) also run just fine under FreeBSD.

  8. Warning for first time installers by AmiMoJo · · Score: 3, Informative

    When I installed FreeBSD for the first time, I noticed that on some configurations the default install is broken. Basically, if you have a small (500MB) /usr partition, you cannot instal ports by default as the standard newfs call used by the installer to create the initial filesystem does not allocate enough inodes.

    IIRC, you need to format /usr by hand using the "-i 2048" switch. This one got me the first time round, as it's not mentioned in any of the documentation.

    --
    const int one = 65536; (Silvermoon, Texture.cs)
    SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
  9. Re:Envy by battlej · · Score: 2, Informative

    the netbsd pkgsrc collection works fine on osx...

    [netbsd-pkgsrc]

  10. Re:BSD is Dying by DrSkwid · · Score: 4, Informative

    why yes, it does

    which would you like ?

    Red Hat
    /usr/ports/emulators/linux_base-6/pkg-descr
    /usr/ports/emulators/linux_base-8/pkg-descr

    or

    Debian
    /usr/ports/emulators/linux_base-debian/pkg-descr
    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  11. Re:My beef with FreeBSDs port system.. by TCM · · Score: 2, Informative

    Just do a 'make package'. This will install the port and create a binary package which you can install with pkg_add(1) on other boxes.

    --
    Of course it runs NetBSD. BTC: 1NT7QvbetmANwaMzhpVL6
  12. auto dependency install by Anonymous Coward · · Score: 1, Informative

    the author didn't mention, but making your package repository fetchable via ftp (or http i guess), and seeting PACKAGEROOT=ftp://yourserver allows you to do pkg_add -r from your machines, and the dependencies will fetch and install themselves.

  13. I'm surprised no one has mentioned portupgrade... by Edward+Scissorhands · · Score: 5, Informative

    There's a great utility in the ports tree called portupgrade. It's very handy and allows for quick and easy upgrading of your ports.

    It lives in /usr/ports/sysutils/portupgrade

    Check it out. Start with the manual page (man portupgrade) after you install it, then use Google for more info. It's well worth it.

  14. Worthless page by bluGill · · Score: 4, Informative

    That page is almost worthless. Don't waste your time reading it, the only tip worth anything is the one about doing a "make readmes". Everything else is better accomplished by using the portupgrade scripts.

    Trust me on this one, once you use portupgrade you will not go back to the pkg_* commands.

  15. use packages by Anonymous Coward · · Score: 1, Informative

    If your /usr directory is that small then you should not be using ports anyway. Just install binary packages using /stand/sysinstall instead. That's what I do on my old Cyrix 5x86/100 mhz machine.

  16. The latest FBSD already has README.htmls by Istealmymusic · · Score: 3, Informative

    Thought I'd save someone some unnecessary building.

    --
    "The lesson to be learned is not to take the comments on slashdot too literally." --Vinnie Falco, BearShare
  17. Portupgrade! by Piquan · · Score: 4, Informative

    Every FreeBSD admin should know about portupgrade.

    It's in ports. It has several tools. One of them, portupgrade, upgrades ports. Another, pkgdb, fixes your ports db by updating out-of-date deps, merging multiple versions of the same port, etc. A third, pkg_version, is like port_version but much faster. A fourth, portsclean, cleans any debris from using ports, such as outdated shared libs.

    Get it. Learn it. Love it.

    1. Re:Portupgrade! by bmah · · Score: 4, Informative

      > A third, pkg_version, is like port_version but much faster.

      Actually, pkg_version is in the base system, portversion is the program that comes with portupgrade.

      portversion is faster because it relies on a database of installed packages, whereas pkg_version depends only on knowing what ports are installed (via pkg_info) plus either an up-to-date ports tree or an INDEX file. Both are useful IMHO.

      But I agree with the general sentiment...the whole portupgrade package is extremely useful, and it's one of the first things that goes on a system that I install if I think I'll ever be upgrading ports on it.

  18. Re:My beef with FreeBSDs port system.. by yanestra · · Score: 3, Informative
    My biggest concern about FreeBSD's port collection is that it's essentially "unstable". That is, it seems to be changing on the time.
    [...]
    It would be a whole lot better if the ports tree was frozen together with the OS when it's released and later only security and bug fixes were merged into the ports

    You have not much idea of what you are talking about, have you?

    Together with the OS comes a complete ports tree. If that ports tree is being changed to newer versions, it's because the sysadmin has set up a task to do so. It's no problem to keep an unchanged ports tree, additionally, if there is need for it.

    You can also make a binary package from a port, if you want to install software on several machines in the same way...

    BSD is an operating system for people who know what they're doing...

  19. Re:Feeling of unease by Anonymous Coward · · Score: 1, Informative

    The differences that exist aren't really all that big - I regularly work on Solaris, AIX, FreeBSD, NetBSD, Debian, Redhat and Mandrake. Yes, there are differences, but checking the syntax via 'man' or even 'info' (if you have info pages installed of course) usually clears it up pretty quickly. Only real problem I have is when I have to work on pesky Windows platforms. The syntax is REALLY different there.

  20. Re:My beef with FreeBSDs port system.. by yanestra · · Score: 2, Informative
    Ok, but then if I don't cvsup the port tree I also won't be able to install the security updates/bug fixes.

    Simply copy the old ports tree before cvsupping...:
    cp -Rp /usr/ports /usr/ports.dist

    That's all...

    (Ok, you might have to resolve dependencies on your own if you want to mix distribution/updated packages, but that really should be trivial. <grin>)

  21. Finding with grep by Thornae · · Score: 2, Informative
    find is even handier when you incorporate grep into it, say to find certain textfiles:
    find . -iname "*txt" -exec grep -Hi foo \{\} \;


    One of my most common uses for this is to look for ports that do certain things not included in their one line description, eg:
    find /usr/ports -name "pkg-descr" -exec grep -Hi quicktime \{\} \;
    Just a quick FYI, in case you were unaware of this handy thing.
    --
    |>
    Here be Dragons