100

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?

andrybak
  • 2,129
  • 2
  • 20
  • 40
John
  • 3,529
  • 14
  • 42
  • 48
  • 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. Feb 29 '12 at 16:18
  • 3
    You're right msgfmt is not vital to run Git. "make -i" worked thanks. – John Mar 04 '12 at 03:27
  • 1
    For OSX you can find the answer here https://stackoverflow.com/a/32821791/1257959 – cgl Apr 13 '19 at 14:41

11 Answers11

276

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.

Bob F.
  • 3,602
  • 1
  • 17
  • 14
19

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

Max Leske
  • 5,007
  • 6
  • 42
  • 54
  • 17
    Preferred this, as I couldn’t install gettext, and -i (ignore errors) is just daft! `make NO_GETTEXT=1` did the trick. – adurdin Aug 12 '13 at 09: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.

Manbeardo
  • 544
  • 4
  • 7
8

On Mac Os, this worked for me:

brew install gettext
brew link gettext --force
ludovico
  • 2,103
  • 1
  • 13
  • 32
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
Vijay Kumar Kanta
  • 1,111
  • 1
  • 15
  • 25
  • 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 Jun 17 '14 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. – Vijay Kumar Kanta Nov 26 '14 at 08: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.

ads1690
  • 49
  • 2
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.

Wilhem Meignan
  • 454
  • 5
  • 12
2

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

$ sudo apt install gettext

Then make commando worked fine.

Enrique René
  • 510
  • 1
  • 5
  • 19
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
YaOzI
  • 16,128
  • 9
  • 76
  • 72
0

There's one more option to obtain the software:

ipkg install gettext
grantgw
  • 41
  • 4
-1

Try to add -i to your make command.

> make -i ...

Umair A.
  • 6,690
  • 20
  • 83
  • 130