在Ubuntu 10.04上安装Mercurial 1.5.4


9

我已经下载了源代码并尝试通过README说明进行安装:

sudo make install

但出现以下错误:

python setup.py  build
running build
running build_mo
warning: hgbuildmo: could not find msgfmt executable, no translations will be built
running build_py
running build_ext
building 'mercurial.base85' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c mercurial/base85.c -o build/temp.linux-x86_64-2.6/mercurial/base85.o
mercurial/base85.c:12:20: error: Python.h: No such file or directory
mercurial/base85.c: In function ‘b85prep’:
mercurial/base85.c:23: warning: implicit declaration of function ‘memset’
mercurial/base85.c:23: warning: incompatible implicit declaration of built-in function ‘memset’
mercurial/base85.c: At top level:
mercurial/base85.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
mercurial/base85.c:76: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
mercurial/base85.c:147: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘methods’
mercurial/base85.c:156: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initbase85’
error: command 'gcc' failed with exit status 1
make: *** [build] Error 1

请记住,我知道我可以使用以下方法进行安装:

sudo apt-get install mercurial

但这给了我一个旧版本(1.4.3-1)。

发生什么了?

Answers:


4

从该行:

mercurial/base85.c:12:20: error: Python.h: No such file or directory

似乎您没有python的开发工具。解决:

sudo apt-get install python-dev

16

您无需手动构建Mercurial即可在Ubuntu上获得最新版本。在https://launchpad.net/~mercurial-ppa/+archive/releases有一个PPA存储库

sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial

顺便说说。还有一个用于TortoiseHG的PPA,它在Nautilus中提供了很好的Mercurial功能集成:https : //launchpad.net/~tortoisehg-ppa/+archive/releases

sudo add-apt-repository ppa:tortoisehg-ppa/releases
sudo apt-get update
sudo apt-get install tortoisehg-nautilus

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.