Skip to main content

Debian packages of Hudson

Posted by kohsuke on June 11, 2008 at 5:14 PM PDT

I have started packaging up Hudson as a debian package.

To use it, you have to add the following line to your /etc/apt/sources.list

deb binary/

After that, update your package list once:

$ sudo apt-get update

You can now install and update Hudson by just running

$ sudo apt-get install hudson

This sets up Hudson as a daemon that gets launched at boot. Refer to /etc/default/hudson to tweak some of the parameters. Big thank you goes to Amelia Lewis for sharing the scripts (and it looks like she's a web service person — the world is small!) This is my first Debian packaging effort, so I'm sure I'm doing things incorrectly. If you notice anything I need to do better, please let me know.

But hopefully this would simplify the installation, and more importantly upgrades, because that happens a lot. I think it would be also interesting to do a Ubuntu Live CD that has tools like Hudson, Subversion server, Sventon, Trac, Maven repository manager and so on, which you can either install on a virtual machine or on a real machine, to quickly get to the productive development envirnoment.

With this, Hudson now covers SUSE, FreeBSD, and Ubuntu! And the current plan is to attach OpenSolaris next.

If anyone can volunteer for RPMs or even just send me some pointers, I'd like to do RPMs, too. And oh, does anyone know if Windows have any package system? (And no, I'm not talking about *.msi)

Related Topics >>


status of apt repository?

Hi, Last versions (1.353 and 1.354) are not available thanks to the apt repository. Is there something wrong? Régis

Set hudson's shell to /bin/bash in /etc/passwd

Reiterating this guy's comment: "After installing the hudson deb on Ubuntu server Jaunty 8.10 [Debian Lenny in my case], when I tried to run the init script /etc/init.d/hudson start, nothing would be printed and the server would not start. No log file was created under /var/log/hudson and no pid file was created under /var/run/hudson. I eventually discovered that if i set the hudson user's shell to /bin/bash instead of /bin/false in /etc/passwd everything works fine. Hope this saves someone else some trouble." I also noticed before fixing the problem that /etc/init.d/hudson restart gave a "Restarting Hudson Continuous Integration Server: hudson failed!" error. Setting hudson's shell to /bin/bash in /etc/passwd worked for me.


After setting hudson's shell to /bin/bash in /etc/passwd on Debian Lenny Hudson started without error.

Kohsuke, your packages are STILL not working for the same reasons described by Quibo and chrisspelberg. Could you please update your package jobs as described by keithel on October 29, 2008 at 04:55 PM? I really hope you will do this, as the apt-get install method is much more convenient for us! Thanks a lot! /Jesper Rønn-Jensen

Have you issued an ITP to move towards official Debian packages ?

For me that line seems to work (/etc/init.d/hudson): DAEMON_ARGS="--name=$NAME --env=HOME=$HUDSON_HOME --env=HUDSON_HOME=$HUDSON_HOME --inherit --output=$HUDSON_LOG --user=$HUDSON_USER --pidfile=$PIDFILE"

Could you please set the HUDSON_HOME as HOME, too? This is really helpful for the git plugin because ".gitconfig" is searched in $HOME. I think the ".m2" repository is also searched there...

Hi I am wondering if a similar problem as Qiubo was having is happening again? I get the following Ign binary/ Release.gpg Ign binary/ Translation-en_US Ign binary/ Release Ign binary/ Packages Get:20 binary/ Packages [20B] but an apt-cache search does not find hudson package Thanks

I've received a: ClassNotFoundException: gnu.xml.datatype.JAXPDatatypeFactory error when installing and running hudson for the first time on Ubuntu Hardy (8.04)... I'm unclear which java package this may lie in... I would think it would be the gnu JAXP project, but I don't see that class in there... Anyone have any ideas or possible ways of getting past this? Here's the full error log: (valid for a month from today)

Kohsuke, The Packages.gz in your debian repo 'binary' directory is empty. Could you at some point run: dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz from the debian dir to update the Packages.gz file properly? Thanks! Once that is done, the problem that Quibo and chrisspelberg have encountered will be resolved.

Dear All, I edited the /etc/apt/sources.list with deb binary/ After that, run $ sudo apt-get update, got the below output: ............ Ign binary/ Release.gpg Ign binary/ Translation-en_US Hit hardy-security Release.gpg Ign hardy-security/main Translation-en_US Hit hardy Release.gpg Ign hardy/main Translation-en_US Ign binary/ Release Ign hardy-security/restricted Translation-en_US Ign hardy-security/universe Translation-en_US Ign hardy-security/multiverse Translation-en_US Ign binary/ Packages Ign hardy/restricted Translation-en_US Ign hardy/universe Translation-en_US Ign hardy/multiverse Translation-en_US Get:1 hardy-updates Release.gpg [189B] Ign hardy-updates/main Translation-en_US Hit hardy-security Release Get:2 binary/ Packages [20B] ............ But when I run $ sudo apt-get install hudson, got below output: Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package hudson Can anyone help with this? What did I do wrong? Which steps did I miss? Thanks, Qiubo

It seems that Packages.gz is empty, this means It is not possible to install using apt-get! Is it a bug or intended?

Creating a hudson user with the home directory /var/hudson would be very cool. Debian control file you might add something like: preinst adduser --home /var/hudson hudson Great product Kohsuke!

Today it actually works. I see the file Packages.gz ( is no longer empty :) Thanks! I hope that this service will prevail and will be working continuously as I'm writing it into an automated script for setting up my servers. Thanks! /Jesper

I meant java.lang.ClassNotFoundException: gnu.xml.datatype.JAXPDatatypeFactory, sorry.

Okay, the above message occurs only on Debian 4, with my particular settings. gij is java 1.4.2, so it won't include the concurrency package. So the hudson package should have a java version dependency >= 1.5. The error I'm getting on Ubuntu is actually different: gnu.xml.datatype.JAXPDatatypeFactory java.lang.ClassNotFoundException: I'll try to find out what's happening there.

On Debian-derived systems (tested on Ubuntu 8 and Debian 4), this error message occurs on startup: Caused by: java.lang.ClassNotFoundException: java.util.concurrent.CopyOnWriteArrayList not found in{urls=[],{urls=[file:/tmp/winstonenr3b4ljar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/hudson/hudson.war], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}} Apparently the CopyOnWriteArrayList contains some non-free code that was removed by the Debian maintainers. Could you either use a different class or figure out the proper Debian dependencies? I'll try and figure them out by myself, but perhaps you could also take a look.

Kohsuke, that URL for openSUSE packages is outdated, by a large margin :-)

And if there's only room for a single link, then this one

If you want to package RPMs for many distributions, it can be done in the openSUSE Build Service (openSUSE, SLE, Fedora, CentOS, Mandriva, RHEL). Debian/Ubuntu packages can be built there too. You don't need to have any local resources, there's a build farm behind it, it is free (just need to register an openSUSE account, which is also free), it has web and CLI interfaces, etc...

More details here: (and an openSUSE RPM of hudson is already available there ;-))

About the openSUSE RPMs (post above): if you're looking for the RPM file itself and not the repository to add, just dive into the "noarch" subdirectory.

And last but not least, as a starting point, here are the files I'm using to build the openSUSE hudson rpm.

As you publish releases so often, I also hacked a script (mix of Python, curl and lftp) that scrapes the Hudson changelog and download URL (as, unfortunately, cannot provide proper URLs), modifies the .spec file (the recipe for building RPMs) and downloads hudson.war

One of the best resources to get started with building RPM packages is the official RPM Guide (from chapter 8 on), which is hosted by Fedora.

Basically, in order to port my RPM to other distros, it is just a matter of proper dependency naming for the java package, writing an init script for each distro that differs in that area (i.e. one for Mandriva, one for CentOS+RHEL+Fedora) and the appropriate RPM "Group" tag for each.

Mate, are you building the packages with hudson? :)

You said: "I think it would be also interesting to do a Ubuntu Live CD that has tools like Hudson, Subversion server, Sventon, Trac, Maven repository manager and so on, which you can either install on a virtual machine or on a real machine, to quickly get to the productive development envirnoment. " This is *exactly* what I'm looking for for a demo I'm giving on these type of tools. Has anyone done this? Ideally, I'd love VMWare image configured with all of these tools up and running...then I'd be off to the races.

Torsten, good to hear from you! I'll definitely look at your plugin. Hudson package has /etc/init.d/hudson and so on, and I'm not quite sure how those things are handled by debhelper. Does your stuff work for that?

lacostej -- I didn't know about this plugin either, but if it doesn't support init script, it's not usable for me.

Pascal, thank you for the pointer to the newer stuff. I captured your information here. Now, I have to admit I've never touched SUSE, but how do you install them? There's an equivalent of yum/apt-get in SUSE, right?

pepijnve -- Yes. Now, the only question is, how do I do that? I looked at a list of dh_* commands but coudln't find anything obvious like "dh_adduser"

Thanks Kohsuke, this will make it a lot easier to keep hudson up to date. It might be a good idea to by default make a user named hudson and run under that user instead of as root though.

Can't help you there I'm afraid. Maybe some inspiration can be found in for instance the tomcat package source. It creates a tomcat55 user on installation.

Just out of curiosity, are you using the maven debian plugin (from codehaus Mojo ?)

kdocki -- any chance you can write it in a patch? I wonder if it matters where I put those two lines in the "rules" file (it's not "control" file, right?

dmacpher -- I'm looking for people who'd be interested in working on this. If you know someone or yourself interested in this, let me know!

I finally figured out why Packages.gz become empty --- I had a Hudson job that was trying to update this file, which wasn't working. I removed that, so this problem should be fixed once and for all. is empty again. Can you fix this?

For me the is empty again.

Thanks Kohsuke! I have Ubuntu 9.04 running hudson 1.308 perfectly. Make sure you run the sudo apt-get update as suggested!

Some correction in the /etc/init.d/hudson script I have some problems with the maven svn-plugin. svn check-in / check-out does not work correctly with https urls if I start build process from hudson. The problem was in the HOME variable. After start it references to the /root and does not allow to import/read info in/from /.subversion directory. I add two entries into inid.d script, start part before daemon start export HOME=$HUDSON_HOME export USER=$HUDSON_USER Important: daemon params--env don't work correctly Of course you need login as hudson and import https certificate manually by svn checkout https://.... or another svn command (p)ermanently

Thanks, I fixed to put hudson.war in /usr/share/hudson/hudson.war.

According to the FHS (, you must not put the hudson.war into the /usr/local/bin directory. It is reserved for local administrators. According to the FHS you should place it into the /usr/share/hudsor/hudson.war (because it is architecture-independent file).