Compiler error - msgfmt command not found

GitCompiler ErrorsGettextShared HostingMsgfmt

Git Problem Overview


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?

Git Solutions


Solution 1 - Git

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.

Solution 2 - Git

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

Solution 3 - Git

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

Solution 4 - Git

On Mac Os, this worked for me:

brew install gettext
brew link gettext --force

Solution 5 - Git

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

Solution 6 - Git

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

Solution 7 - Git

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.

Solution 8 - Git

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

$ sudo apt install gettext

Then make commando worked fine.

Solution 9 - Git

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

Solution 10 - Git

There's one more option to obtain the software:

ipkg install gettext

Solution 11 - Git

Try to add -i to your make command.

> make -i ...

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohnView Question on Stackoverflow
Solution 1 - GitBob F.View Answer on Stackoverflow
Solution 2 - GitMax LeskeView Answer on Stackoverflow
Solution 3 - GitManbeardoView Answer on Stackoverflow
Solution 4 - GitludovicoView Answer on Stackoverflow
Solution 5 - GitVijay Kumar KantaView Answer on Stackoverflow
Solution 6 - Gitads1690View Answer on Stackoverflow
Solution 7 - GitWilhem MeignanView Answer on Stackoverflow
Solution 8 - GitEnrique RenéView Answer on Stackoverflow
Solution 9 - GitYaOzIView Answer on Stackoverflow
Solution 10 - GitgrantgwView Answer on Stackoverflow
Solution 11 - GitUmair A.View Answer on Stackoverflow