Linux 使用“sudo apt-get install build-essentials”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6486449/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using 'sudo apt-get install build-essentials'
提问by user785099
I was trying to use sudo apt-get install build-essentials
to install the g++ compiler on my Ubuntu Linux box. But it gave me the following message:
我试图sudo apt-get install build-essentials
在我的 Ubuntu Linux 机器上安装 g++ 编译器。但它给了我以下信息:
Reading package lists... Done
Building dependency tree
Reading state information... DoneE: Unable to locate package build-essentials
阅读包裹清单...完成
构建依赖树
读取状态信息...完成E: 无法找到包 build-essentials
How do I fix this problem?
我该如何解决这个问题?
采纳答案by jncraton
Drop the 's' off of the package name.
去掉包名中的“s”。
You want sudo apt-get install build-essential
你要 sudo apt-get install build-essential
You may also need to run sudo apt-get update
to make sure that your package index is up to date.
您可能还需要运行sudo apt-get update
以确保您的包索引是最新的。
For anyone wondering why this package may be needed as part of another install, it contains the essential tools for building most other packages from source (C/C++ compiler, libc, and make).
对于任何想知道为什么在另一个安装中可能需要这个包的人来说,它包含从源代码(C/C++ 编译器、libc 和 make)构建大多数其他包的基本工具。
回答by ChristopheD
Try
尝试
sudo apt-get update
sudo apt-get install build-essential
(If I recall correctly the package name is without the extra s
at the end).
(如果我没记错的话,包名最后没有多余s
的部分)。
回答by fyr
Try 'build-essential' instead.
尝试使用'build-essential'代替。
回答by Paul
The package is called build-essentialwithout the plural "s". So
该包被称为build-essential,没有复数“s”。所以
sudo apt-get install build-essential
should do what you want.
应该做你想做的。
回答by Magnus
In my case, simply "dropping the s" was not the problem (although it is of course a step in the right direction to use the correct package name).
就我而言,简单地“删除 s”不是问题(尽管使用正确的包名称当然是朝着正确方向迈出的一步)。
I had to first update the package manager indexes like this:
我必须首先像这样更新包管理器索引:
sudo apt-get update
Then after that the installation worked fine:
然后安装工作正常:
sudo apt-get install build-essential
回答by William Everett
I know this has been answered, but I had the same question and this is what I needed to do to resolve it. During installation, I had not added a network mirror, so I had to add information about where a repo was on the internet. To do this, I ran:
我知道这已经得到回答,但我有同样的问题,这就是我需要做的来解决它。在安装过程中,我没有添加网络镜像,所以我必须添加有关 repo 在 Internet 上的位置的信息。为此,我跑了:
sudo vi /etc/apt/sources.list
and added the following lines:
并添加了以下几行:
deb http://ftp.debian.org/debian wheezy main
deb-src http://ftp.debian.org/debian wheezy main
If you need to do this, you may need to replace "wheezy" with the version of debian you're running. Afterwards, run:
如果您需要这样做,您可能需要将“wheezy”替换为您正在运行的 debian 版本。之后,运行:
sudo apt-get update
sudo apt-get install build-essential
Hopefully this will help someone who had the same problem that I did.
希望这会帮助那些和我有同样问题的人。
回答by Mohanad Kaleia
To auto-generate the "source.list" file I suggest to use:
要自动生成“source.list”文件,我建议使用:
https://debgen.simplylinux.ch/
https://debgen.simplylinux.ch/
Where you can select the country, the distribution, ..etc After that, all you need to do is to replace (take a backup of the file first) your original source.list file with the generated one and do as mentioned in other answers:
您可以在哪里选择国家/地区,发行版,..等之后,您需要做的就是用生成的文件替换(首先备份文件)您的原始 source.list 文件,然后按照其他答案中的说明进行操作:
sudo apt-get update
sudo apt-get install build-essential