OpenBSD Journal

apt-get db on OpenBSD

Contributed by deanna on from the apt-get-install-openbsd dept.

Stephan A. Rickauer writes:

Our Software Installation Server had a severe hard disk problem couple of days ago. It served all SuSE Linux RPM’s for our 120 clients by holding an apt4rpm repository. Quite nice, since my linux users can use synaptic to install software themselves using a GUI by having a robust apt-get system underneath, in spite of using an RPM system.

However, since the server (running good old Red Hat 9) became flaky I decided to port that service to OpenBSD. All it actually needs to do is creating the apt repository for all RPM’s and serving them using Apache. The latter is no problem at all, since a secured version of Apache is part of the base system of OpenBSD.

Well, I felt kind of reluctant to ask for an apt-get port for OpenBSD on misc@ ;) - that’s why I had a closer look at this idea first and it turned out the build process of the apt database would only require one perl plus one shell script and one linux binary.

update-apt, written in Perl
genbasedir, shell script
genpkglist, linux binary

Apart from fixing other little things (md5sum replaced with md5 etc.) the major problem was to get genpkglist running. Fortunately, OpenBSD comes with the linux binary emulation layer, to be enabled with sysctl kern.emul.linux=1. Additionally, I had to install the redhat8-base package and all libraries genpkglist required.

Finally, we now have the apt software repository build process working on and served by OpenBSD, which itself runs only in a virtual machine on our VMWare GSX server … this I call efficient.

Stephan A. Rickauer is a Unix Engineer at the Institute of Neuroinformatics at ETH Zurich.

(Comments are closed)


Comments
  1. By Rob Funk (24.93.188.153) on

    Why not compile the source code for genpkglist?

    Comments
    1. By Anonymous Coward (218.75.87.37) on

      > Why not compile the source code for genpkglist?

      Tangent warning.

      It's not always that easy. First, where's the dependency list? It's not in the source distribution or on the webpage. Ok well whatever.

      env LD_LIBRARY_PATH=/usr/local/lib ./configure
      
      checking for BZ2_bzopen in -lbz2... no
      configure: error: Can't find libbz2 library
      
      Huh.
      -r--r--r--  1 root  bin  66800 Aug 24 11:44 /usr/local/lib/libbz2.so.10.3
      
      Ok google..

      Yoshioka Tsuneo has contributed some functions to give better zlib compatibility. These functions are BZ2_bzopen, BZ2_bzread, BZ2_bzwrite, BZ2_bzflush, BZ2_bzclose, BZ2_bzerror and BZ2_bzlibVersion. These functions are not (yet) officially part of the library. If they break, you get to keep all the pieces. Nevertheless, I think they work ok.

      Cool! Is that going to conflict in some way with my OpenBSD bzip package? Do I have to put it in some other directory, and then do a bunch of LD_LIBRARY_PATH bull? Wait, where do I even get a bzip lib with this function? And this is just the _first_ undocumented dependency. What's next? Etc. Stupid linux stuff always claims to run on "BSD" and never does. Respect to the ports guys. :-)

      Comments
      1. By Jonathan Rockway (66.92.134.156) jon@jrock.us on http://blog.jrock.us/

        > Cool! Is that going to conflict in some way with my OpenBSD bzip package? Do I have to put it in some other directory, and then do a bunch of LD_LIBRARY_PATH bull? Wait, where do I even get a bzip lib with this function? And this is just the _first_ undocumented dependency. What's next?

        I assume for such a simple library, you can just statically link everything.

      2. By Anonymous Coward (151.188.247.104) on

        > Stupid linux stuff always claims to run on "BSD" and never does. Respect to the ports guys. :-)


        Wow, a little pent-up hostility there, perhaps? If you don't like the "stupid linux stuff", then just don't use it. I don't bash the OpenBSD team for not porting pf to Linux. You want those "stupid linux" functions to work on BSD, great, shut up and start coding!

        Comments
        1. By Anonymous Coward (69.207.171.114) on

          > Wow, a little pent-up hostility there, perhaps? If you don't like the "stupid linux stuff", then just don't use it. I don't bash the OpenBSD team for not porting pf to Linux. You want those "stupid linux" functions to work on BSD, great, shut up and start coding!

          It is true (and sad) that a lot of people write a lot of Linux-specific code without realizing it. And from the perspective of an OpenBSD user, it gets pretty frustrating to see that no one knows how to write portable code. Often these programs are useful.... Just poorly written. I know I've spent a lot of time cleaning up other people's crap, cursing the developers for being so foolish, but at the same time recognizing that their software fills a gap that I need.

          I've had nearly as many bad experiences with Linux code not working on Linux, though. I think in general, most people don't know how to code elegantly. They can make something that works, and in many cases works well, but only in a narrow set of circumstances. If that makes sense to say.

          Comments
          1. By Anonymous Coward (151.188.247.104) on

            > > Wow, a little pent-up hostility there, perhaps? If you don't like the "stupid linux stuff", then just don't use it. I don't bash the OpenBSD team for not porting pf to Linux. You want those "stupid linux" functions to work on BSD, great, shut up and start coding!
            >
            > It is true (and sad) that a lot of people write a lot of Linux-specific code without realizing it. And from the perspective of an OpenBSD user, it gets pretty frustrating to see that no one knows how to write portable code. Often these programs are useful.... Just poorly written. I know I've spent a lot of time cleaning up other people's crap, cursing the developers for being so foolish, but at the same time recognizing that their software fills a gap that I need.
            >
            > I've had nearly as many bad experiences with Linux code not working on Linux, though. I think in general, most people don't know how to code elegantly. They can make something that works, and in many cases works well, but only in a narrow set of circumstances. If that makes sense to say.


            OK, now there I'll agree with you. OpenOffice.org 2.0 is a glaring example; even for their GNU/Linux binaries, their install process is now dependent on RPM or DEB (Slackware, what the hell is that?). Back in the 1.x days, it was a good ol' fashioned tarball that worked on every GNU/Linux distro. The Mozilla Foundation/Corporation/Whatever seems to also focus on Windows, Mac OS X, and Linux only. That kind of non-portable thinking, in my opinion, is a bad thing. I can say with certainty that if OpenOffice.org 2.0 and Evolution (with the MS Exchange Connector) were available for OpenBSD natively, i. e. not through a Linux subsystem, then one of my laptops would be running OpenBSD right now.

            Your post is rational, and I appreciate that. Too often, I hear "Linux sux" or "stupid Linux" and the like. That's Slashdot-type thinking and "commentary" that I don't believe belongs at a forum with thinking individuals such as those who visit the OpenBSD Journal. You use what the best tool is for a given task at hand, and very often that best tool is OpenBSD.

  2. By Anonymous Coward (156.34.218.41) on

    I'm curious why you just didn't stick with a Linux distribution for this task. I'm sure it will work well, but using OpenBSD for a Linux package installation database is certainly a curious choice. Was there a particular reason you didn't just use another Linux distribution, or did you just set it up on OpenBSD 'for the sheer hell of it'?

    Comments
    1. By Anonymous Coward (66.11.66.41) on

      > I'm curious why you just didn't stick with a Linux distribution for this task. I'm sure it will work well, but using OpenBSD for a Linux package installation database is certainly a curious choice. Was there a particular reason you didn't just use another Linux distribution, or did you just set it up on OpenBSD 'for the sheer hell of it'?

      Because maintaining linux machines is such a nightmare?

      Comments
      1. By Anonymous Coward (151.188.247.104) on

        > > I'm curious why you just didn't stick with a Linux distribution for this task. I'm sure it will work well, but using OpenBSD for a Linux package installation database is certainly a curious choice. Was there a particular reason you didn't just use another Linux distribution, or did you just set it up on OpenBSD 'for the sheer hell of it'?
        >
        > Because maintaining linux machines is such a nightmare?


        Only if you're a MCSE. :-D

        Comments
        1. By Anonymous Coward (74.115.21.120) on

          > > Because maintaining linux machines is such a nightmare?
          >
          >
          > Only if you're a MCSE. :-D
          >

          How does having an MCSE make openbsd so much easier to maintain than linux distros?

          Comments
          1. By Anonymous Coward (24.46.21.229) on

            > > > Because maintaining linux machines is such a nightmare?
            > >
            > >
            > > Only if you're a MCSE. :-D
            > >
            >
            > How does having an MCSE make openbsd so much easier to maintain than linux distros?

            It looks as if the comment was aimed at the percieved ineptitude of MCSE graduates, in that Linux isn't really hard to maintain, unless you're coming from a Windows (& GUI centric) galaxy. It doesn't seem to have any comment towards OpenBSD at all.

            Comments
            1. By Anonymous Coward (68.167.146.78) on

              > > > > Because maintaining linux machines is such a nightmare?
              > > >
              > > >
              > > > Only if you're a MCSE. :-D
              > > >
              > >
              > > How does having an MCSE make openbsd so much easier to maintain than linux distros?
              >
              > It looks as if the comment was aimed at the percieved ineptitude of MCSE graduates, in that Linux isn't really hard to maintain, unless you're coming from a Windows (& GUI centric) galaxy. It doesn't seem to have any comment towards OpenBSD at all.


              You are exactly correct in your interpretation. Not only am I the one who made the comment, I'm also a former MCSE who woke up several years ago, thank goodness. Sine that time, I learned that neither Linux (especially Slackware) nor OpenBSD are hard to maintain if you simply use your brain. I happen to use both Slackware and OpenBSD these days, depending on what I need to do.

              Comments
              1. By Anonymous Coward (198.208.251.24) on

                > Sine that time, I learned that neither Linux (especially Slackware) nor OpenBSD are hard to maintain if you simply use your brain. I happen to use both Slackware and OpenBSD these days, depending on what I need to do.

                I think you would find the standard commercial linux distro's such as rh or suse to be extraordinarily difficult compared to slackware ;/

                Comments
                1. By Anonymous Coward (151.188.247.104) on

                  > > Sine that time, I learned that neither Linux (especially Slackware) nor OpenBSD are hard to maintain if you simply use your brain. I happen to use both Slackware and OpenBSD these days, depending on what I need to do.
                  >
                  > I think you would find the standard commercial linux distro's such as rh or suse to be extraordinarily difficult compared to slackware ;/
                  >
                  >


                  Hmm..."annoying at times", yeah, for sure, but "extraordinarily difficult," I wouldn't agree there; that description is better reserved for MS Windows. We've also got some RH, Debian, and Ubuntu here at work, and I've used SuSE before. True that each is a little different. But it didn't take me long at all to figure my way around each flavor. That said, I find that I do tend to prefer the Slackware/BSD way of doing things.

          2. By Anonymous Coward (24.46.21.229) on

            > > > Because maintaining linux machines is such a nightmare?
            > >
            > >
            > > Only if you're a MCSE. :-D
            > >
            >
            > How does having an MCSE make openbsd so much easier to maintain than linux distros?

            It looks as if the comment was aimed at the percieved ineptitude of MCSE graduates, in that Linux isn't really hard to maintain, unless you're coming from a Windows (& GUI centric) galaxy. It doesn't seem to have any comment towards OpenBSD at all.

        2. By Anonymous Coward (71.98.179.243) on

          > > Because maintaining linux machines is such a nightmare?
          > Only if you're a MCSE. :-D

          I admined Linux servers for a decade (and never any Windows servers because I wasn't ever interested in that OS). After a decade of dealing with poorly hacked-up distros and lots of security issues I was almost at the point of making my own distro from scratch with lots of mods/patches like GrSec, etc. Then I said "Fuck that" and started using OpenBSD on servers instead of just firewalls. Problem solved, and now I have a lot less grunt work to do. So yes, Linux is a PITA to admin, even taking MSCE or Windows out of the picture.
          Oh, and did you ever try to actually use man pages on a Linux box? Half the time they're empty and say shit like "This program doesn't have a man page" or refer you to read some stuff in /usr/doc or a HOWTO or a website. Fucking hillarious when you're trying to fix something on a box when the network is down. Besides so much of their docs out of of date even when they exist that it's almost a waste of time to read them. I litterally had to refer to several instances of the Root+Boot+LILO HOWTO to figure out how to set that shit up back in 1999, and even that wasn't enough. I ended up having to email the LILO maintainer and ask him questions, because the docs sucked so much ass.
          Linux is great if you like to waste lots of time!

          Comments
          1. By Anonymous Coward (64.231.232.103) on

            > Oh, and did you ever try to actually use man pages on a Linux box?

            It is really astounding. Maybe a visual representation will help explain this to those who are just passing through. :-)

            Why Linux sucks

            Why OpenBSD rocks

          2. By Anonymous Coward (83.5.197.183) on

            > Linux is great if you like to waste lots of time!
            >
            >
            I would concur, what I dislike most about linux is the inconsistency. I setup zenwalk last week, it's slackware + xfce and actually quite nice as a desktop distro, but what drives me nuts are the differing parameters of linux itself. For example I needed to to mount fat32, ext2 and ntfs partitions, but the fstab flags each require different options to have user access, plus everything seems to have config files in different places. Having also installed win2k on the same box though and not being able to install working drivers for acpi or the sata controller, at least you can get things done in linux without trashing your install ten times...

          3. By Anonymous Coward (68.167.146.78) on

            > > > Because maintaining linux machines is such a nightmare?
            > > Only if you're a MCSE. :-D
            >
            > I admined Linux servers for a decade (and never any Windows servers because I wasn't ever interested in that OS). After a decade of dealing with poorly hacked-up distros and lots of security issues I was almost at the point of making my own distro from scratch with lots of mods/patches like GrSec, etc. Then I said "Fuck that" and started using OpenBSD on servers instead of just firewalls. Problem solved, and now I have a lot less grunt work to do. So yes, Linux is a PITA to admin, even taking MSCE or Windows out of the picture.
            > Oh, and did you ever try to actually use man pages on a Linux box? Half the time they're empty and say shit like "This program doesn't have a man page" or refer you to read some stuff in /usr/doc or a HOWTO or a website. Fucking hillarious when you're trying to fix something on a box when the network is down. Besides so much of their docs out of of date even when they exist that it's almost a waste of time to read them. I litterally had to refer to several instances of the Root+Boot+LILO HOWTO to figure out how to set that shit up back in 1999, and even that wasn't enough. I ended up having to email the LILO maintainer and ask him questions, because the docs sucked so much ass.
            > Linux is great if you like to waste lots of time!


            Hmm...salty language, I'll give you that. I don't seem to have the problems that you're describing, whether I'm using either OpenBSD or GNU/Linux. I use what I determine to be the best tool for the job in front of me. You don't like Linux, cool by me, use what floats your boat. I certainly don't blame you for leaving MS Windows alone, though; that "platform", if you can call it that, is truly a nightmare. Talk about lack of docs!

    2. By Anonymous Coward (194.109.22.148) on

      > I'm curious why you just didn't stick with a Linux distribution for this task. I'm sure it will work well, but using OpenBSD for a Linux package installation database is certainly a curious choice. Was there a particular reason you didn't just use another Linux distribution, or did you just set it up on OpenBSD 'for the sheer hell of it'?

      For the same reason Debian GNU/KNetBSD and Debian GNU/KFreeBSD exist: because they can.

      I can imagine a lot of other reasons, but I'm not the author or user, so I'll refrain on that.

      Comments
      1. By Anonymous Coward (68.167.146.78) on

        > > I'm curious why you just didn't stick with a Linux distribution for this task. I'm sure it will work well, but using OpenBSD for a Linux package installation database is certainly a curious choice. Was there a particular reason you didn't just use another Linux distribution, or did you just set it up on OpenBSD 'for the sheer hell of it'?
        >
        > For the same reason Debian GNU/KNetBSD and Debian GNU/KFreeBSD exist: because they can.
        >
        > I can imagine a lot of other reasons, but I'm not the author or user, so I'll refrain on that.


        Sure, why not? "Because they can" is actually the stated reason that the OpenBSD team themselves wove crypto so deeply into the OS. I'm with you; tinkering with Free Software to possibly do new, cool things is a major part of what it's all about (the other being Freedom).

    3. By Anonymous Coward (82.43.92.127) on

      > I'm curious why you just didn't stick with a Linux distribution for this
      > task. I'm sure it will work well, but using OpenBSD for a Linux package
      > installation database is certainly a curious choice. Was there a
      > particular reason you didn't just use another Linux distribution, or did
      > you just set it up on OpenBSD 'for the sheer hell of it'?

      Perhaps it was simply the best tool for the job? A unix-like system with simplicity, security and reliability on its side. Pretty painless Linux emulation for non-portable stuff is a great benefit in my limited experience of using it.

    4. By Stephan A. Rickauer (130.60.5.218) on

      > I'm curious why you just didn't stick with a Linux distribution for this task. I'm sure it will work well, but using OpenBSD for a Linux package installation database is certainly a curious choice. Was there a particular reason you didn't just use another Linux distribution, or did you just set it up on OpenBSD 'for the sheer hell of it'?

      The answer is "life cycle". In my environment I'd like to have the least amount of administrative overhead as possible. Setting up OS xy is always trivial. But having OS xy up and running for several years is not that easy. For me, there are currently only 2 options:

      a) Having an OS with a looong life cycle (SLES10, Ubuntu LTS, CentOS etc.). You can run them 5 to 7 years in low-security environments and patching is easy. BUT: After that period of time, you have a _real_ problem since you have to setup everything from scratch. Might not be big deal in this environment but I know web hosting companies who still didn't upgrade from SuSE 8.2 because of this problem.

      b) You have an OS with a short life cycle but with such an elegant way of upgrading that you don't care: OpenBSD. Since it also comes with a fixed release cycle it just fits totally in my "upgrading schedule" anyway. It is now "just another OpenBSD to upgrade", so it'll take another 15 minutes twice a year.

      Stephan

  3. By Anonymous Coward (204.176.49.46) on

    i used to say "i want apt-get for my openbsd!"
    but now pkg_add rocks!

    Comments
    1. By Justin (216.17.75.74) on

      > i used to say "i want apt-get for my openbsd!" > but now pkg_add rocks! Gentoo for BSD looks neat though it is still a new project.

      Comments
      1. By -Oinfinity (218.126.156.19) on




        > Gentoo for BSD looks neat though it is still a new project.

        VTEC just kicked in yo!!!!

Latest Articles

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]