etckeeper + git issue on trusty

latest Git version requires manually setting the user.email, if the email cannot be auto-detected.

In combination with etckeeper configured with Git, this can give an error (example bellow).

To prevent this, make sure “/etc/hosts” contains a FQDN for the current hostname of your machine.

From man hostname:

The recommended method of setting the FQDN is to make the hostname be an alias for the fully qualified name using /etc/hosts, DNS, or NIS. For example, if the hostname was
“ursula”, one might have a line in /etc/hosts which reads

127.0.1.1 ursula.example.com ursula

linked bug on launchpad: https://bugs.launchpad.net/ubuntu/+source/etckeeper/+bug/1267564

Example error:

*** Please tell me who you are.

Run

  git config --global user.email "<email address hidden>"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address

Fix: “perl: warning: Setting locale failed.”

On Ubuntu, if you have the following error:


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = "nl_NL.UTF-8",
LC_MONETARY = "nl_NL.UTF-8",
LC_COLLATE = "C",
LC_ADDRESS = "nl_NL.UTF-8",
LC_TELEPHONE = "nl_NL.UTF-8",
LC_NAME = "nl_NL.UTF-8",
LC_MEASUREMENT = "nl_NL.UTF-8",
LC_IDENTIFICATION = "nl_NL.UTF-8",
LC_NUMERIC = "nl_NL.UTF-8",
LC_PAPER = "nl_NL.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

check which locales are autogenerated with:
$ dpkg-reconfigure locales

(this should also generate the error again)

generate the missing locales with locale-gen, example:
$ locale-gen nl_NL.UTF-8

you can check if the error is solved with:
$ dpkg-reconfigure locales

if you want to change your system locale settings
$ vim /etc/default/locale

(not in “/etc/environment”, should be deprecated?)

dpkg conflict libmagic1 /etc/magic.mime


Preconfiguring packages ...
(Reading database ... 131336 files and directories currently installed.)
Preparing to replace libmagic1 4.26-1 (using .../libmagic1_5.04-5_i386.deb) ...
Unpacking replacement libmagic1 ...
dpkg: error processing /var/cache/apt/archives/libmagic1_5.04-5_i386.deb (--unpack):
trying to overwrite '/etc/magic.mime', which is also in package file 5.04-5
Selecting previously deselected package libdb4.8.
Unpacking libdb4.8 (from .../libdb4.8_4.8.30-2_i386.deb) ...
Processing triggers for man-db ...
Errors were encountered while processing:
/var/cache/apt/archives/libmagic1_5.04-5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

this is a debian squeeze problem, you can fix this by:

  1. (re)moving /etc/magic.mime
  2. install the libmagic package manually with force options

dpkg --force-overwrite -i /var/cache/apt/archives/libmagic1_5.04-5_i386.deb