109

I'm trying to update Git from my shared hosting. For that I'm following these steps:

  1. Download latest Git version
  2. Unpack and place it on the server
  3. Configure and create the Makefile -> ./configure --prefix=$HOME/dev/git/src --without-tcltk
  4. Build the package -> make then make install
  5. Update PATH .bash_profile

I'm stuck at point 4. When I run the make command, I get the following:

user@ssh1:~/dev/git/src$ make
SUBDIR gitweb
SUBDIR ../
make[2]: ? GIT-VERSION-FILE ? est ? jour.
GEN git-instaweb
SUBDIR perl
SUBDIR git_remote_helpers
SUBDIR templates
MSGFMT po/build/locale/is/LC_MESSAGES/git.mo
/bin/sh: msgfmt: command not found
make: *** [po/build/locale/is/LC_MESSAGES/git.mo] Erreur 127

Compiler throws a msgfmt command not found error.

I Googled it and it seems to be related to the gettext package.

Any idea how to fix that error on a shared hosting?

3
  • 7
    Quick hack: try "make -k" or "make -i" to skip compiling this, may be you will get Git, but without localization and/or documents.
    – Vi.
    Commented Feb 29, 2012 at 16:18
  • 3
    You're right msgfmt is not vital to run Git. "make -i" worked thanks.
    – John
    Commented Mar 4, 2012 at 3:27
  • 1
    For OSX you can find the answer here stackoverflow.com/a/32821791/1257959
    – cgl
    Commented Apr 13, 2019 at 14:41

11 Answers 11

295

I had the same issue. Thanks to your work on finding it was related to gettext, a simple apt-get install gettext fixed it for me.

7
  • 10
    This should be acceped answer ;)
    – Dennis
    Commented Jul 29, 2013 at 15:33
  • 1
    This certainly seems like the best answer, however, on cygwin, installing gettext did not help. Perhaps a version issue there?
    – Lucas
    Commented Oct 24, 2013 at 16:44
  • 7
    This is not the right answer on shared hosting, where you don't have sudo access. Commented Jan 17, 2014 at 13:40
  • 2
    @Lucas on cygwin you need gettext-devel for msgfmt (see this helpful answer)
    – Boris
    Commented Jun 17, 2014 at 17:08
  • When installing from source/on a system without root access, run ./configure && make && make install in the gettext-tools subdirectory below the gettext source root. Commented Mar 10, 2017 at 13:18
19

While building Git with Xcode (using Makefile), I had to define NO_GETTEXT = YesPlease in the Makefile to resolve this issue.

1
  • 19
    Preferred this, as I couldn’t install gettext, and -i (ignore errors) is just daft! make NO_GETTEXT=1 did the trick.
    – adurdin
    Commented Aug 12, 2013 at 9:35
18

msgfmt is included in the gettext-devel cygwin package. Install that (via setup.exe or apt-cyg) and the error should go away.

2
  • 1
    The question is not about Cygwin Commented Mar 9, 2015 at 11:46
  • gettext-devel is also the package for centos 6 Commented Nov 13, 2017 at 23:00
8

On Mac Os, this worked for me:

brew install gettext
brew link gettext --force
4
make -i
make -i install

..worked flawlessy for this problem. Also if anyone's having trouble with http/https helper, during configure do not forget to add the following thing

./configure --with-curl --with-expat
2
  • 6
    It should be noted that "-i" is short for "--ignore-errors", so any other error will be ignored too and may be overlooked because of the many gettext-related errors. So -i should be the last resort if nothing else works.
    – Boris
    Commented Jun 17, 2014 at 17:11
  • @Boris Yes, it's a wrong work-around, but not everyone's a hacker. You obviously need gettext lib for the error to go. Commented Nov 26, 2014 at 8:14
4

On cygwin, you need to install the gettext-devel package as well. The gettext package alone is not enough to resolve this problem.

2

You can install gettext in the same way you are installing git. By downloading, extracting, building and installing it to a given location in your home folder:

curl -O https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz
tar xvf gettext-0.20.1.tar.gz
cd gettext-0.20.1/
./configure --prefix=/home/$HOME/opt
make
make install

Set the prefix to the location you want for the installation.

2

In Debian 10 to me was missing package gettext. Solved as follow:

$ sudo apt install gettext

Then make commando worked fine.

1

xgettext, msgfmt and etc. belong to GNU gettext toolset. On macOS, you could use MacPort's port command to install these tools on your system:

port install gettext
0

There's one more option to obtain the software:

ipkg install gettext
-1

Try to add -i to your make command.

> make -i ...

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