I'm interested in installing etckeeper with Mercurial in my Ubuntu system. My reason is that I don't know how to use Git and don't want to learn at the moment. If I check the package description it sounds promising:

kent@rat:~$ apt-cache search etckeeper
etckeeper - store /etc in git, mercurial, or bzr

I'm wondering how to continue on from here? I've tried Googling but I haven't found anything for the Ubuntu + etckeeper + Mercurial combination.

(If you know of a good tutorial for this situation, a link is an excellent answer. No need to re-iterate.)

  • +1 Thank you for unintentionally advising an interesting tool. Feb 13 '10 at 20:39

I am using etckeeper on both debian and ubuntu. It's painless.

Just do a sudo etckeeper init and you're done!

Actually, you may need to edit /etc/etckeeper/etckeeper.conf to check that hg is selected as your VCS command. But that's all that you need to do.

Once that is done etckeeper will begin tracking every change that you make to files in /etc and commit those changes to the local repository. This happens automatically whenever you run apt-get on anything and also as a nightly cron-job.

However, if you wish to push your changes to a remote repository, you will need to do it manually or setup something else to do it for you.

  • Ah. Good to know! Now I feel ready to try it.
    – Deleted
    Aug 14 '09 at 18:48
  • 2
    Worth noting (for rookies) that "sudo apt-get install mercurial" will be needed if it's not already installed, followed by appropriate configuration (probably of ~/.hgrc) as described in the output of "hg help config". Jul 26 '10 at 20:30
  • I don't think hg needs much configuration for use with etckeeper - all I did was install hgk (for "hg view"), on Ubuntu 8.04. For more recent Ubuntus, just apt-get install hgview for the (improved) "hgview". Both provide a GUI to browse or search commits to the repository, which is handy for those who aren't skilled in use of Mercurial (hg).
    – RichVel
    Apr 13 '12 at 9:27

On my system (Ubuntu Karmic), besides setting VCS="hg", I had to edit /etc/etckeeper/etckeeper.conf and add the following or else etckeeper commit would complain about a missing username:

HG_COMMIT_OPTIONS="-u etckeeper@aeolus"

Also, in /etc/.hg/hgrc, I added the following:

username = root@aeolus

That way, when I do a commit through etckeeper, the username on that commit will be etckeeper@aeolus, and if I do a commit manually via mercurial, it will show up as root@aeolus.

  • I just set up a new system with the advice from @sybreon, and had the same "missing username" error. Your second step, adding the username to the [ui] section of (in my case) ~/.hgrc, was sufficient to get past the problem. I don't think the HG_COMMIT_OPTIONS part is required. Jul 26 '10 at 20:29
  • 3
    No, it isn't. I just added that so that automatic and manual commits would show up with different user names. That way I know which commits in the log were done manually by me, after making some change. Jul 27 '10 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.