如何安装autoconf

我需要安装Tesseract,这需要安装autoconf automake libtool, 然而我遇到了以下错误:
sahu@sahu-desktop:/$ sudo apt-get install autoconf
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package autoconf is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'autoconf' has no installation candidate

所以请帮帮我。

你的Ubuntu版本是什么? - thefourtheye
3个回答

确保您已启用所有必要的软件源。在网站上进行“如何启用软件源”搜索。启用软件源后,打开终端并使用以下命令安装autoconf。
sudo apt-get update
sudo apt-get install autoconf

您的错误消息表明,您已禁用存储库。


Autoconf是一个GPLv2许可的宏包,用于生成一个名为"configure"的shell脚本,以便为项目生成Makefile和配置头文件。Autoconf生成的配置脚本是自包含的,因此您的项目用户不需要Autoconf、M4或perl来运行configure。1 要下载最新版本,请点击这里,有关安装说明,请点击这里
您需要提取Autoconf,构建它,并安装Autoconf(必须使用root用户)。
另一种方法是从Ubuntu软件中心安装,
此外,要下载并安装,请点击下面的图像。

Install via the software center

你也可以跟随安瓦尔的回答。
1来源:Autoconf

2自动配置(autoconf)不是在软件仓库里吗...? - Thomas Ward
1这种方法是错误的,除非你真的需要一个特定(新)版本。 - Chris
@Chris 有没有兴趣分享正确的方法? - Mitch
1显然,OP在apt设置方面遇到了问题。正确的做法是修复这个问题,而不是仅仅手动安装软件包(除非你的安装中没有可用的特定版本,有一个非常特殊的原因需要它)。 - Chris

我使用的是Ubuntu 20.04。执行autoconf --version命令显示autoconf (GNU Autoconf) 2.69,但我需要至少2.71版本。以下是如何构建最新版本的autoconf源码:
在此处找到最新版本: https://ftp.gnu.org/gnu/autoconf/ --> "Downloading Autoconf"部分,然后 跳转至:https://ftp.gnu.org/gnu/autoconf/。在上述链接中找到最新版本的链接,并在下面的命令中使用它。
# check version
autoconf --version
wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz
tar -xf autoconf-2.71.tar.xz
cd autoconf-2.71/
./configure
time make 
sudo make install 
. ~/.profile
autoconf --version  # you should see your new version now!

  • 相关问题