Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
BSD Operating Systems

Portupgrade on FreeBSD 119

BSD Forums writes "In her previous article, OnLamp's Dru Lavigne took a look at the built-in utilities that can be used to manage the FreeBSD ports collection. In this article, she'd like to continue in that vein. She takes a look at portupgrade, a feature-rich port designed to help you get the most out of the ports collection."
This discussion has been archived. No new comments can be posted.

Portupgrade on FreeBSD

Comments Filter:
  • but is this a slow news day or something? portupgrade is at least 2 years old... It kicks ass, but it's hardly news (or, imho, as good as portage)
    • If you look at the last articles in the BSD section, there's been a lot of junk lately (like the gettext update). My guess is that they are up to something - maybe that's part of a wicked plan for the traditional premature announcement of the next FreeBSD release or something.
    • by kruntiform ( 664538 ) on Friday August 29, 2003 @09:48PM (#6830751)
      portupgrade is at least 2 years old... It kicks ass, but it's hardly news

      portupgrade is not news, but new user documentation is news. Well, if it's good documentation, then it's news. I read a few sections of it just now, and I think it's pretty good. It's written in a direct, readable style and has lots of examples. Since it answered some questions I had about portupgrade, it seems to me to be comprehensive. So, this is pretty cool. One of the best things about BSD is the quality of the documentation.

  • by JDizzy ( 85499 ) on Friday August 29, 2003 @12:34PM (#6825864) Homepage Journal
    The thing that tweaks me is that portupgrade should be part of the base system. Portupgrade and friends should be writen in something aside from ruby (becuse we dont' want ruby in base). It is probably the most usefull and powerfull package/port managment tool ever created since the freebsd ports is already the best package system in all of open source. FreeBSD ports is always immitated, yet never replicated in full glory. It nice that portupgrade traces down dependancies automatically (forward, or reverse), and can cleanout stale lib's and such.
    • by Anonymous Coward
      What high-level language is in the base system? Shell script? Forth?

      I'd rather have Ruby in the base than Perl, it's a pain to build. Ruby is (currently) much more lightweight, I even have it installed on my Zaurus handheld as a single executable (miniruby).
      • by Anonymous Coward
        Preferably C++. GNU C++ is bound to be as portable as C, and there shouldn't be any worries about "bloat" as this program isn't meant to be part of the Unix "swiss army knife" of standard utilities. Neither one of those are going anywhere anytime soon. C++ is probably better, maybe even somewhat faster than ruby-based portupgrade. But, yes, unfortunately this isn't even vaporware, it's "I don't have the gumption and talent to do it myself but I'll look a gift horse in the mouth and pretend I know what I
    • No (Score:5, Insightful)

      by cperciva ( 102828 ) on Friday August 29, 2003 @01:53PM (#6826870) Homepage
      The ports tree is good. Better than the base system; stuff in the ports tree is split into nice self-contained packages, while the base system is a single monolithic mess.

      We need to hack parts of the base system off and put them into ports (like kerberos), not add more stuff into the base system.
      • Re:No (Score:5, Informative)

        by JDizzy ( 85499 ) on Friday August 29, 2003 @05:26PM (#6829171) Homepage Journal
        I admit you have an intersting perspective, and i would point out that you can build your system without kerberos via make.conf options. Same for Sendmail, etc...
        • Re:No (Score:3, Informative)

          by cperciva ( 102828 )
          Yes, you can *rebuild* the system without those; but that's really the point of packagizing code. If sendmail, bind, and other similar software was taken out of base and put into ports, people would be able to add or remove them as distinct packages. Right now, if you've installed a RELEASE and you decide you don't want sendmail around, you need to work out for yourself which files to delete.
          • Problem is that in this case your system would hardly be usable out-of-the-box. Then again, the sam ething as has been done for perl (and applies to X as well) could be done: remove from base, but provide a package as part of the install process.

    • by drdink ( 77 ) * <smkelly+slashdot@zombie.org> on Friday August 29, 2003 @05:00PM (#6828964) Homepage
      Portupgrade should not be part of the base system. If you look, you'll see that CVSup is not part of the base system, either. CVSup is the tool you use to update both your source and ports trees, and it isn't part of the base! I believe the current mindset among many is that the base should be smaller, and more should be offloaded to ports. For example, Sendmail shouldn't be part of the base system. Ports are a great tool, but they are not a necessary part of the system.
    • There is a bit of talk here about how portupgrade won't make it into the base system even if it were in C or C++. Maybe, maybe not. I do know that there's some work on revamping the whole package management system. If so, then portupgrade might very well be the candidate.

      I have thought off and on about rewriting portupgrade in C++. The only benefit of this would be to get it into the base system, since I don't think with all the disk i/o going on, that C/C++ will be any faster than Ruby in this context. Bu
      • I would be willing to help in this. I can write in C, and it really isn't that trivial of functionallity once I think about it. But we must realize that portupgrade is a suite of tools, and we would have to do them all. It would be nice to add some XML support to portupgrade, and the ports system in general as Jordan Hubard once suggested. Anyways, it seems easy to me to parse the pkgdb and act upon it. If your still interested, let me know.. you would have at least one person in your corner. =)
        • Okay, let's talk. How do I reach you? (you can reach me through my website)
        • Is there any reason you want XML support added, or is it just because everything should have XML support until the Next Big Thing comes along?
    • Amen to that.

      cd /usr/ports
      make upgrade or make update should do the right thing.

      I filed that bug and it got pissed on. More and more I'm thinking OSX will be my next server OS.
  • Wow (Score:5, Interesting)

    by Sevn ( 12012 ) on Friday August 29, 2003 @01:10PM (#6826281) Homepage Journal
    I'm humbled. I used ports forever, even dabbled with portupgrade on FreeBSD and still was of the opinion that Gentoo portage was "better". If anything, I'd say they are neck and neck now. VERY good article. From someone that has to manage a whole bunch of FreeBSD machines, this article hit the spot. Now I'll just add portsdb -Uu and pkgdb -F to my nightly cvsup cron job. If you take the time to set up your cvsup stuff in /etc/defaults/make.conf, updating your sources and ports is as easy as:

    cd /usr/src
    make update

    To translate for Gentoo users:

    emerge -upD world becomes:

    portversion -L "="

    and emerge -uD world becomes:

    portupgrade -arR

    Oh, and etc-update has always been:

    mergemaster

    Though mergemaster does kinda suck until you get used to it. Not that etc-update is an e-ticket ride either.
    • Re:Wow (Score:5, Insightful)

      by pillohead ( 553676 ) <dirtywetback@nOSpAM.hotmail.com> on Friday August 29, 2003 @03:56PM (#6828312) Journal

      Are you a developer? I can't think of a reason why you need to cvsup nightly. Also you can have one machine do the cvsup then export /usr/ports via nfs to the other machines.

      I wouldn't edit the /etc/defaults/make.conf, in fact I wouldn't edit anything in the /etc/defaults folder. Copy that file to /etc/make.conf it will override the default without altering it.

      • Re:Wow (Score:5, Interesting)

        by Sevn ( 12012 ) on Friday August 29, 2003 @10:42PM (#6830970) Homepage Journal
        I cvsup nightly because it really doesn't matter. That and a lot of these machines are commercial webhosting platforms. One very tiny nightly cvsup is going to take a lot less time than a weekly or monthly update. If it's done nightly, chances are that any security update I hear about from freebsd-security-announce is already there. Also more likely any port with a security problem is upgraded also. That's why I cvsup nightly. I admin 300+ machines that are all facing the world. On each network, I cvsup ONE machine, then push the packages out to the other machines in the farm. In keeping with my "hands off, zero administration" approach, I prefer using cron'd rsync to keep a package directory updated instead of using nfs which is sometimes thought of as an acronym for "NO FUCKING SECURITY". My scripts then install my pre-approved packages from the local package directories on each slave machine. Editing /etc/default/make.conf is of little concern to me because I know the meaning of every single line in the file as I've been using FreeBSD since version 2.1.7. I suppose I could copy it to /etc and only put the differences in there, but it's really not that big of a deal. Rc.conf is something I don't mess with though. I do edit the one in /etc and leave the one in /etc/defaults alone. FreeBSD is kinda how I pay for my car and my house and my food. But hey, thanks for the tips!
        • Re:Wow (Score:4, Insightful)

          by dodell ( 83471 ) <dodell@sTEAitetronics.com minus caffeine> on Sunday August 31, 2003 @02:43AM (#6836918) Homepage
          Not to troll, but your hostility is completely unnecessary. You could have said you were familiar with the process you needed to take and say thanks anyway. The sarcasm is really unnecessary. It adds to an "elitist" outlook on the BSD community (one that OpenBSD already contributes enough to) and discourages people from migrating. The dude has no way to know you've got such experience with FreeBSD.

          Granted Linux has got a whole lot of these pissing contests going on all the time... we don't need them in BSD.
          • Re:Wow (Score:1, Troll)

            by Sevn ( 12012 )
            I think I pretty much summed up that I was familiar with the environment that I live on, and that I'm not "stupid". I don't think you are either. Someone new to FreeBSD has every right to think the way you do. I'm just too "oldschool" to do everything "correct". Neither one of us are right. I just have a system based on an old way of thinking that works for me and the businesses I support. Traditional UNIX is FUELED by elitism. It is sad, but true. Back in the "good ole days" of UNIX, that sadly I'm old eno
            • Ever gone to a shrink about that ego problem of yours? I've plenty of experience with BSD (mostly with FreeBSD, but I can manage well in Net or OpenBSD) and I don't agree with this at all. Neither would most of the people on the FreeBSD mailing lists.

              I don't think that anybody should just "fuck off". FreeBSD has a lot to offer (for a secure, stable networked future) and if people aren't willing to spread the knowledge, I don't see things coming very far. I'm sure the BOFH mentality gets you far in life and
              • by Sevn ( 12012 )
                Amazing how you analyzed me from one post. You are brilliant. I'm not judging you but you sure are passing judgement on me. It's probably time for you to take a long look in the mirror. Oh, I see you childishly added me to your foes list because of your difference in opinion. Very mature. I made sure to add you to my friends list. :) Perhaps you should look at a lot more of my posts before going off half cocked and reread a little more closely what I actually wrote.
    • You have been registered. 1
  • Nice work Dru!
  • Excellent (Score:4, Interesting)

    by thanjee ( 263266 ) on Friday August 29, 2003 @09:47PM (#6830743) Journal
    Dru Lavigne writes so many really useful articles. Has she got a book on the way?
  • by doiuf ( 700960 ) on Friday August 29, 2003 @10:20PM (#6830870)
    Dru's written some excellent articles, and she manages to put in some humor as well. Keep up the good work :)
    "If you're ever asked to run pkgdb -F, do it. However, don't interrupt this command, or you'll end up with an inconsistent database. If you're ever in that unfortunate situation, this command will fix the inconsistencies:

    % pkgdb -fu

    That's a pretty easy switch combo to remember, as similar thoughts will probably be running through your head at the time."

  • But.... (Score:5, Informative)

    by xA40D ( 180522 ) on Saturday August 30, 2003 @02:57AM (#6831735) Homepage

    Reasonable article.... But running an automatic portupgrage without paying attention to what's actually being upgraded is a really bad move.

    Upgrading Apache for instance will trash your running config. Whereas MySQL is a bitch to upgrade as by default it will fail if there is an existing DB.

    I find portupgrade -ai is a much better option.

    And a backup of /etc/ and /usr/local/etc would be a good idea first....

    • Re:But.... (Score:5, Informative)

      by OpperNerd ( 16084 ) on Saturday August 30, 2003 @04:47AM (#6831932) Homepage
      I always use the -P option:

      portupgrade -aRrPv

      this does check if there's a package available. Saves a lot of time.
      • Re:But.... (Score:1, Funny)

        by Anonymous Coward
        always use the -P option:

        portupgrade -aRrPv


        I just click Windows Update, and click OK whenever prompted.
    • Re:But.... (Score:2, Informative)

      by Fudgie ( 594631 )

      Upgrading Apache will not trash your running config as long as you remove the symlinks to the *-dist directories and make your own dirs. Which is the whole point of having the ports install *-dist files/dirs.

      MySQL upgrades just fine, as there is a flag called SKIP_INSTALL_DB=yes for mysql323-server. Set this in your pkgtools.conf and upgrade all you want.

      mysql40-server and mysql41-server don't require this, as they use a flag to install the db instead.

      • No, /usr/local/etc/apache/ does get trashed.
        • Oh, you mean httpd.conf-dist, access.conf-dist, magic-dist, mime.types-dist, srm.conf-dist, and apache.sh-dist? Look at the makefile for the port if you still think it hoses your config files.

          None of the Apache ports touch your config files if they differ from the -dist installed files.

          Most FreeBSD ports install config files with a -dist extension so they don't trash your config.
          • No. I mean portupgrade trashes /usr/local/etc/apache. Not the port, PORTUPGRADE - the thing the article was talking about.

            Before a port is installed by portupgrade THE OLD PORT IS DELETED. Which I've discovered - twice - trashes the current config directory. Hence the "run interactive & make a backup" caveat.
            • Re:But.... (Score:2, Informative)

              by Fudgie ( 594631 )

              .. and how does portupgrade delete a port? By using the ports own 'make deinstall', which leaves your config files in place.

              I just did a portupgrade -f apache, and lookie here:
              -rw-r--r-- 1 root wheel 37691 Sep 1 20:12 httpd-std.conf
              -rw-r--r-- 1 root wheel 38645 Jun 23 17:57 httpd.conf
              My config wasn't touched. Maybe it happened earlier, but I've never had a problem the last year or so.
              • Kewl, looks like you're right. But I I do a portupgrade -f apache+mod_ssl-1.3.28+2.8.15_1, I get this before:

                -rw-r--r-- 1 root wheel - 20859 Aug 22 12:46 /usr/local/etc/apache/httpd.conf

                And this after.

                -rw-r--r-- 1 root wheel - 47887 Sep 1 19:44 /usr/local/etc/apache/httpd.conf

                So it also looks like I'm right. Sure glad I've got a backup.....
  • Or are things getting really desperate when people start having to chat about updating thier ports?

    I mean, seriosuly. Keep that in teh coffe room with all the 'I just totally recompiled the kernel on my 76 Kaufna Commodore Toaster!

    Oh, and don't forget the classic "don't worry, I can just tty in later. Hahah! Get it? TTY, Later?"

    Okay, so I'm just trying to see how easy it is to rile these bsd folks....

If you aren't rich you should always look useful. -- Louis-Ferdinand Celine

Working...