9

I have what I would call a "vanilla" install on Ubuntu Server 12.04LTS (downloaded and installed on the 15th) on Hyper-V.

All seems well with Ubuntu. Synthetic NIC is great. No issues detected.

My plan is to use it as a central GIT repository using Gitolite.

I have SSh correctly installed (at least I think it is because I can "ssh myaccount@mydomain.com".

The key was generated on my Mac in Terminal and copied up. That worked fine.

My problem is that when I attempt to install Gitolite I get the following error:

   No adminkey given - not setting up gitolite.

These are the commands I used to perform the install:

sudo apt-get install git-core
sudo apt-get install gitolite

I've also tried this:

sudo apt-get install git-core

sudo adduser \
  --system \
  --shell /bin/bash \
  --gecos 'git version control' \
  --group \
  --disabled-password \
  --home /home/git \
git

sudo apt-get install gitolite

...same result

Some version info:

Git core: 1:1.7.9.5-1
Gitolite: 2.2-1
Ubuntu: 12.04

Any ideas?
Does Gitolite actually run on Ubuntu 12.04?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
RGI
  • 333
  • 4
  • 10

4 Answers4

57

Yes, when you first install gitolite through apt-get, the error will be shown, as the setup did not ask you for your gitolite admin public key. Then, after setup is finished, you can run the command sudo dpkg-reconfigure gitolite and it will prompt you to provide:

  1. The user which gitolite will use
  2. The directory which that user use to store all its files (gitolite config, gitolite managed repositories, etc)
  3. (And the most important) the public key of the user whom will be the first administrator in gitolite, which you may either put the public key (just a single line starts with ssh-rsa or path to the file which contains the public key)
Raymond Tau
  • 3,429
  • 26
  • 28
0

You need to provide your personal public key (the one you use to connect to the box itself) in the installation. I don't know how exactly it works when using apt, but the gitolite docs are extensive and should contain the information you need.

Femaref
  • 60,705
  • 7
  • 138
  • 176
0

You being able to ssh with your account has nothing to do with gitolite, if you install gitolite with the account 'git'.

If you are using /home/git to manage git, then you need to generate a public/private key there (/home/git/.ssh), and and hope the apt-get process does the gitolite setup -pk "${H}/.ssh/id_rsa.pub" part of the gitolite installation.

... Or you can install it manually in a directory of your choosing: that is what I do.

Again, all the ssh access to the Git server will be done as user 'git' (and using the public keys of the users who have previously been registered in Gitolite).

And yes, gitolite runs just fine on Ubuntu12.04.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Can I simply copy the same id_rsa.pub file that I use to access the server into /home/git ? – RGI Jul 18 '12 at 21:29
  • 1
    @RogerI sure. Copy it to `/home/git/.ssh` and make sure the permissions are setup correctly: see for instance http://stackoverflow.com/questions/3712443/creating-ssh-keys-for-gerrit-and-hudson/3712619#3712619 – VonC Jul 19 '12 at 05:31
-6

I think the package may be broken.

You may be better off installing it from source.

Try following this tutorial: http://www.bigfastblog.com/install-gitolite-to-manage-your-git-repositories

The official docs on the repo itself also recommend installing from source: https://github.com/sitaramc/gitolite

lebreeze
  • 5,094
  • 26
  • 34
  • OK, so I tried these commands: sudo apt-get install git sudo adduser \ --system \ --shell /bin/bash \ --gecos 'git version control' \ --group \ --disabled-password \ --home /home/git \ git sudo cp id_rsa.pub /home/git sudo chown git:git /home/git/id_rsa.pub sudo su git $HOME … shows id_rsa.pub git clone git://github.com/sitaramc/gitolite fatal: could not create work tree dir 'gitolite'.: Permission denied How do I set those permissions correctly? – RGI Jul 18 '12 at 21:22
  • git clone git://github.com/sitaramc/gitolite will be trying to create a folder gitolite within the current folder you are in. You're probably in a location that is owned by root. – lebreeze Jul 18 '12 at 21:36
  • Ah, so added these and seems to have worked: sudo chown git ../git sudo chmod 700 ../git – RGI Jul 18 '12 at 22:12
  • 13
    The package is not broken, you just need to `dpkg-reconfigure gitolite` in order to setup the gitolite-user. – pkhamre Sep 21 '12 at 13:52