Installing Hudson on Ubuntu

On Debian-based distributions, such as Ubuntu, you can install Hudson through apt-get.

Recent versions are available in  http://hudson-ci.org/downloads/debian/

Installation

  • sudo sh -c "echo 'deb http://hudson-ci.org/debian binary/' > /etc/apt/sources.list.d/hudson.list"
  • sudo apt-get update
  • sudo apt-get install hudson

Upgrade

  • sudo apt-get update

and then after a backup

  • sudo apt-get upgrade

What does this package do?

  • Hudson will be launched as a daemon up on start. See /etc/init.d/hudson for more details.
  • The 'hudson' user is created to run this service.
  • Log file will be placed in /var/log/hudson/hudson.log. Check this file if you are troubleshooting Hudson.
  • /etc/default/hudson will capture configuration parameters for the launch.

Where to go from here?

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Sep 16, 2009

    Benjamin Boudreau says:

    On Jaunty (9.04) Server, the daemon dependency is picked up correctly. But Huds...

    On Jaunty (9.04) Server, the daemon dependency is picked up correctly.

    But Hudson doesn't start. Changing hudson user's shell to /bin/bash instead of /bin/false in /etc/passwd seems to fix it.

  2. Sep 18, 2009

    Jose Salvador says:

    My case: I work on a Debian Lenny dist (stable) I have updated the sources lis...

    My case:

    I work on a Debian Lenny dist (stable)

    I have updated the sources list following the instructions above and have applied the patch attached to the bug

    Then, I have had to install the sun-java6-bin package to get working. In my experience the hudson does not start with the debian gnu java. I obtained an exception related to this message:

    " Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter : null"

    Of course, I have changed the symbolic link at /usr/bin/java by one which links directly to the java from sun.

    Cheers.

  3. Sep 24, 2009

    Ben Standefer says:

    This fix worked for me when installing Hudson on Debian Lenny: "After installing...

    This fix worked for me when installing Hudson on Debian Lenny: "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."

    Also, this is a good resource: http://weblogs.java.net/blog/2008/06/11/debian-packages-hudson

  4. Aug 28, 2010

    Max V.K. says:

    hi there. I've noticed the debian repository responds with response "302", which...

    hi there.
    I've noticed the debian repository responds with response "302", which is redirect related.
    apt does not support redirects as of now. Debian stabe apt does not.
    I am currently forced to download the file manually, although it is found in the repository.

    Can somebody please change the setup so that not a redirect is returned, but the file?

    Thanks.

  5. Nov 08, 2010

    Stefan Seidel says:

    Here's a workaround for lenny: you need: apache2, mod_proxy. Then create a file...

    Here's a workaround for lenny: you need: apache2, mod_proxy.

    Then create a file /etc/apache2/sites-available/hudson-deb with this content:

    <VirtualHost *:80>
      ServerName hudson-deb.local
      RewriteEngine On
      RewriteRule ^/debian/binary/(.+\.deb) http://download.hudson-labs.org/debian/$1 [P]
      RewriteRule ^(.*)$ http://pkg.hudson-labs.org$1 [P]
      <Proxy *>
        Order Deny,Allow
        Allow from all
      </Proxy>
    </VirtualHost>
    

    Edit /etc/hosts and add hudson-deb.local as the last term on the line containing 127.0.0.1 (separate it with a space).

    Then enable the proxy and the site and restart the apache:

    a2enmod proxy_http
    a2ensite hudson-deb
    /etc/init.d/apache2 restart
    

    Then you just add the file /etc/apt/sources.list.d/hudson.list with the following content:

    deb http://hudson-deb.local/debian binary/
    

    And off you go with:

    apt-get update && apt-get install hudson
    
  6. Jan 17, 2012

    Patrik Fors says:

    There is an error in Packages.gz I get the following message when trying to ins...

    There is an error in Packages.gz

    I get the following message when trying to install on ubuntu:

    Get:2 http://hudson-ci.org/debian/ binary/ hudson 2.2.0 [608MB]
    Fetched 60.9MB in 10min 13s (99.2kB/s)
    Failed to fetch http://hudson-ci.org/debian/binary/hudson_2.2.0_all.deb Size mismatch
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

    This is an extract from http://hudson-ci.org/debian/binary/Packages.gz :

    Installed-Size: 60806
    Depends: daemon, adduser, java-virtual-machine, java2-runtime, psmisc
    Filename: binary/hudson_2.2.0_all.deb
    Size: 608066698

    The size is obviously wrong. I thought one used tools for generating the package contents..

  7. Jan 25, 2012

    Carlos D. says:

    I am trying to install Hudson on Ubuntu 10.04 and having the same issue as Patri...

    I am trying to install Hudson on Ubuntu 10.04 and having the same issue as Patrick.  Any ideas?  Thanks.

    sudo apt-get install hudson

    Reading package lists... Done

    Building dependency tree

    Reading state information... Done

    The following packages were automatically installed and are no longer required:

      linux-headers-2.6.32-37-generic linux-headers-2.6.32-33-server

      linux-headers-2.6.32-33 linux-headers-2.6.32-37

      linux-headers-2.6.32-37-server

    Use 'apt-get autoremove' to remove them.

    The following extra packages will be installed:

      daemon gcj-4.4-base gcj-4.4-jre-headless gcj-4.4-jre-lib libgcj-common

      libgcj10

    Suggested packages:

      fastjar gcj-4.4-jdk libgcj10-awt libgcj10-dbg

    The following NEW packages will be installed:

      daemon gcj-4.4-base gcj-4.4-jre-headless gcj-4.4-jre-lib hudson

      libgcj-common libgcj10

    0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.

    Need to get 632MB of archives.

    After this operation, 130MB of additional disk space will be used.

    Do you want to continue [Y/n]? y

    WARNING: The following packages cannot be authenticated!

      hudson

    Install these packages without verification [y/N]? y

    Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/universe daemon 0.6.3-1 [112kB]

    Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main gcj-4.4-base 4.4.3-1ubuntu4.1 [109kB]

    Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/main libgcj-common 1:4.4.3-1ubuntu1 [122kB]

    Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libgcj10 4.4.3-1ubuntu4.1 [13.6MB]

    Get:5 http://hudson-ci.org/debian/ binary/ hudson 2.2.0 [608MB]

    Get:6 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main gcj-4.4-jre-headless 4.4.3-1ubuntu4.1 [59.3kB]

    Get:7 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main gcj-4.4-jre-lib 4. 4.3-1ubuntu4.1 [10.5MB]

    Fetched 85.2MB in 3min 43s (381kB/s)

    Failed to fetch http://hudson-ci.org/debian/binary/hudson_2.2.0_all.deb  Size mismatch

    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

    1. Feb 06, 2012

      Robert Bjærum says:

      Carlos, I got the same error. Ended up downloading hudson_2.2.0_all.deb manuall...

      Carlos,

      I got the same error. Ended up downloading hudson_2.2.0_all.deb manually from http://hudson-ci.org/downloads/debian/ and using:

      sudo apt-get install daemon

      sudo dpkg -i hudson_2.2.0_all.deb

      Checking http://localhost:8080/hudson. Well. It's installed alright but with error:

      Status Code: 404

      Exception:
      Stacktrace: (none)


      Generated by Winstone Servlet Engine v0.9.10 at Sun Feb 05 17:27:44 CET 2012

      By the way, I ended up downloading war-file and installing in tomcat6 manually. Works fine and I configured HUDSON_HOME

      to be /srv/hudson (away from install) in the startup script of tomcat.

  8. Jan 25, 2012

    thusitha nuwan says:

    I had the same error Failed to fetch http://hudson-ci.org/debian/binary/hudson...

    I had the same error

    Failed to fetch http://hudson-ci.org/debian/binary/hudson_2.2.0_all.deb  Size mismatch

    But I have workaround for this (this guide is for dummies), For advances users ; just download .deb and use -f switch to get broken dependencies!!

    First download the hudson_x.x.all.deb file by navigating in to this url:  http://hudson-ci.org/

    Click on the Ubuntu/Debian link

    After downloading save it in to a convenient place

    Navigate to that place and use following commands one after the other

    • sudo sh -c "echo 'deb http://hudson-ci.org/debian binary/' > /etc/apt/sources.list.d/hudson.list"
    • sudo apt-get update
    • sudo apt-get install hudson

    if system complains

    use this command

    sudo apt-get -f install hudson

    Now it should download the hudson for you now. If you have java already configured it should start hudson in port 80 in your localhost

    feel free to correct me if theres anything wrong

    thanks

    1. Jan 27, 2012

      Murali says:

      I had the same error as Carlos. The fix suggested by thusitha nuwan didn't work ...

      I had the same error as Carlos. The fix suggested by thusitha nuwan didn't work for me. i get the same below error

      Failed to fetch http://hudson-ci.org/debian/binary/hudson_2.2.0_all.deb&nbsp; Size mismatch
      E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

  9. Jan 29, 2012

    thusitha says:

    Sorry for the confusion. Try running the hudson_x.x.all.deb as sudo System wil...

    Sorry for the confusion.

    Try running the hudson_x.x.all.deb as sudo

    System will complain about missing dependencies ask you try an alternative command with -f switch..

    Try that

    That should work.