Search This Blog

Tuesday, July 9, 2013

How to Add a PPA to Ubuntu

How to Add a PPA to Ubuntu | OMG! Ubuntu!
Gitolite on Ubuntu: No admin key given

This adds the extra steps to bring in a ppa, install a new package, and reconfigure something like Gitolite3.

Replace ppa:snapy/ppa with your launchpad.
Replace gitolite3 with your package.

First, find a package you  want. I generally check to see if it's in the next release; easier to upgrade later.
https://launchpad.net/~snapy/+archive/ppa

From a terminal window:

    sudo add-apt-repository ppa:snapy/ppa
    sudo apt-get update
    sudo apt-cache gencaches
    apt-cache search gitolite3
    sudo apt-get install gitolite3

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)
   

Thursday, May 2, 2013

HowTo fix yum error: unpacking of archive failed on nfs4 directory.

Bug 210945 – yum update gives error: unpacking of archive failed on file /home: cpio: chown

My Jenkins yum updates on Fedora 18 have been failing for a while. Finally have a fix that works.

My /var/lib/jenkins directory is an NFS4 mount to a local server.
The first error on yum update was chown permissions. This was fixed by no_root_squash on the server.
To duplicate, from root try to do a chown in /var/lib/jenkins.

(fix no-permission problem)
On the local server:
/etc/exports

/srv  *(rw,fsid=0,sync,nohide,crossmnt,insecure,no_subtree_check,no_root_squash)
/srv/jenkins *(rw,sync,nohide,insecure,no_subtree_check,no_root_squash)

The next error on chown/cpio was "invalid argument". There are some older threads about a kernel problem and null characters in uid/gid, another about nfs4 problems etc. The best fix becomes avoiding the problem :)

(fix chown invalid argument problem in yum)
/etc/rpm/macros.jenkins

%_netsharedpath /var/lib/jenkins

At this point rpm will ignore doing chown's and yum is happy.

You might do the second step first to fix the yum problem, but the no_root_squash fix may avoid other problems if that is how you are using your mounted directory.

Some say no_root_squash is a security problem, so either lock down what servers can mount your directory (change * in /etc/exports above), or avoid the problem with netsharedpath.