如何在 ubuntu 上安装新版本的 gcc
我使用的是 ubuntu 9.10,它附带 gcc 4.4。 如何安装 gcc 4.5 而不搞砸我的 gcc 4.4。环境。我只需要 gcc 4.5 来编译 1 个应用程序。
谢谢。
I am using ubuntu 9.10 and it comes with gcc 4.4.
How can I install gcc 4.5 without screwing up my gcc 4.4. environment. I just need gcc 4.5 to compile 1 application.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的首选方法是在
/etc/apt/sources.list
中有一个deb-src
条目,例如我可以执行
apt-get source foo
code> 并获取适当的包及其将被解包的源。我通常添加一个本地变更日志条目(由修订号分隔为 1.2-3local0)并重建。这有时需要构建依赖关系。这一切都取决于...我猜 gcc-4.5 目前处于实验阶段 根据此页面 因此您还必须将实验添加到
sources.list
文件中。我没有使用过这个,但它应该也能工作:My preferred method is to have a
deb-src
entry in/etc/apt/sources.list
as e.g.I can then do
apt-get source foo
and fetch the appropriate package with its sources which will be unpackages. I typically add a local changelog entry (set apart by a revision number as 1.2-3local0) and rebuild. This sometimes entails building dependencies. It all depends...I guess gcc-4.5 is currently in experimental as per this page so you would have to add experimental to the
sources.list
file as well. I have not used this but it should work too:最简单的方法是安装到私有前缀中:
在私有前缀中,您覆盖现有文件的机会为零。然后,您需要将前缀添加到您的路径中。
第二种选择是给新的二进制文件一个后缀并使用特定于版本的运行时库:
尽管我不能保证其他文件不会被修改。
The easiest way is to install into a private prefix:
In a private prefix, there is 0 chance you'll overwrite an existing file. You'll then need to add the prefix to your path.
A second option is to give the new binaries a suffix and to use version specific runtime libraries:
although I can't promise some other file won't be modified.