未能在ubuntu17.04中安装gcc-4.9 [英] Fail to install gcc-4.9 in ubuntu17.04

查看:476
本文介绍了未能在ubuntu17.04中安装gcc-4.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从 Ubuntu 17.04 的源代码构建llvm 3.4时,遇到了与$ strong> gcc 6.3 相关的一些问题(描述为 here ),所以我想用 gcc -4.9 即可。
然而,当我从终端运行时:

  sudo apt install gcc-4.9 --fix-missing 

我收到以下错误:

 阅读软件包列表...完成
构建依赖树
读取状态信息...完成
将安装以下附加软件包:
cpp-4.9 gcc-4.9-base libasan1 libcloog-isl4 libgcc-4.9-dev
建议的软件包:
gcc-4.9-locales gcc-4.9-multilib gcc-4.9-doc libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1 -dbg libasan1-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
libcilkrts5-dbg libquadmath0-dbg
将安装以下新软件包:
cpp-4.9 gcc-4.9 gcc-4.9- base libasan1 libcloog-isl4 libgcc-4.9-dev
升级后的版本,6个新安装版本,0版本删除版本以及128版本未升级版本。
需要获得13.2 MB / 13.2 MB的档案。
在此操作之后,将使用46.7 MB的额外磁盘空间。
你想继续吗? [Y / n] y
错误:1 http://il.archive.ubuntu.com/ubuntu zesty / universe amd64 gcc-4.9-base amd64 4.9.4-2ubuntu1
404找不到
错误:2 http://il.archive.ubuntu.com/ubuntu zesty / universe amd64 cpp-4.9 amd64 4.9.4-2ubuntu1
404未找到
错误:3 http:// il .archive.ubuntu.com / ubuntu zesty / universe amd64 libasan1 amd64 4.9.4-2ubuntu1
404未找到
错误:4 http://il.archive.ubuntu.com/ubuntu zesty / universe amd64 libgcc-4.9-dev amd64 4.9.4-2ubuntu1
404未找到
错误:5 http://il.archive.ubuntu.com/ubuntu zesty / universe amd64 gcc-4.9 amd64 4.9.4- 2ubuntu1
404找不到
无法更正缺失的软件包。
E:无法获取http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/gcc-4.9-base_4.9.4-2ubuntu1_amd64.deb 404未找到
E:无法获取http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/cpp-4.9_4.9.4-2ubuntu1_amd64.deb 404未找到
E:失败获取http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/libasan1_4.9.4-2ubuntu1_amd64.deb 404未找到
E:无法获取http:// il .archive.ubuntu.com / ubuntu / pool / universe / g / gcc-4.9 / libgcc-4.9-dev_4.9.4-2ubuntu1_amd64.deb 404未找到
E:无法获取http://il.archive。 ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/gcc-4.9_4.9.4-2ubuntu1_amd64.deb 404未找到
E:中止安装。

这是怎么回事?感谢!

解决方案

首先想到的是,运行 apt update 并重新设置源列表,如果需要的话,应该修正这个问题:

https://askubuntu.com/questions/903496/error-during-upgrade-on-ubuntu-16-04



然而,这并没有奏效,如果你要遵循存储库链接:
$ b



您会发现gcc 4.9.3的.deb文件,而 apt 会尝试选择4.9.4(这似乎是zesty的正确版本),并因此以 404 Not Found 失败。看起来 apt 会尝试从错误的回购中选择gcc 4.9--可能是因为所需的回购已从 apt 的源列表或 apt 的数据库处于某种不稳定状态。



尝试获取 apt 自行修复,然后安装gcc,你可以试试:

  sudo apt-get update -fix-missing 
sudo apt-get dist-upgrade $ b $ sudo apt-get install gcc-4.9 g ++ - 4.9 gcc-4.9-multilib

如果这样做不起作用,您可以添加一个包含正确gcc 4.9软件包的存储库。



<在Ubuntu 16.04上,我可以顺利使用启动板库安装gcc 4.9.4( 4.9.4-2ubuntu1〜16.04 )。这应该有希望工作(注意 - 没有在测试中测试):

  sudo apt-add-repository -yu'deb http:/ /ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu zesty main'
sudo apt update
sudo apt-get install gcc-4.9 g ++ - 4.9 gcc-4.9-multilib

如果这不起作用,您可以直接从.deb包安装gcc,但这更加痛苦(您还需要安装相关软件包,并将它们保持在正确的顺序)。


While trying to build llvm 3.4 from source on Ubuntu 17.04, I have encountered some problems related to gcc 6.3 (described here), so I want to use gcc-4.9. However, when I run from terminal:

sudo apt install gcc-4.9 --fix-missing

I get the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
cpp-4.9 gcc-4.9-base libasan1 libcloog-isl4 libgcc-4.9-dev
Suggested packages:
gcc-4.9-locales gcc-4.9-multilib gcc-4.9-doc libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan1-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
libcilkrts5-dbg libquadmath0-dbg
The following NEW packages will be installed:
cpp-4.9 gcc-4.9 gcc-4.9-base libasan1 libcloog-isl4 libgcc-4.9-dev
0 upgraded, 6 newly installed, 0 to remove and 128 not upgraded.
Need to get 13.2 MB/13.2 MB of archives.
After this operation, 46.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://il.archive.ubuntu.com/ubuntu zesty/universe amd64 gcc-4.9-base amd64 4.9.4-2ubuntu1
404  Not Found
Err:2 http://il.archive.ubuntu.com/ubuntu zesty/universe amd64 cpp-4.9 amd64 4.9.4-2ubuntu1
404  Not Found
Err:3 http://il.archive.ubuntu.com/ubuntu zesty/universe amd64 libasan1 amd64 4.9.4-2ubuntu1
404  Not Found
Err:4 http://il.archive.ubuntu.com/ubuntu zesty/universe amd64 libgcc-4.9-dev amd64 4.9.4-2ubuntu1
404  Not Found
Err:5 http://il.archive.ubuntu.com/ubuntu zesty/universe amd64 gcc-4.9 amd64 4.9.4-2ubuntu1
404  Not Found
Unable to correct missing packages.
E: Failed to fetch http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/gcc-4.9-base_4.9.4-2ubuntu1_amd64.deb  404  Not Found
E: Failed to fetch http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/cpp-4.9_4.9.4-2ubuntu1_amd64.deb  404  Not Found
E: Failed to fetch http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/libasan1_4.9.4-2ubuntu1_amd64.deb  404  Not Found
E: Failed to fetch http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/libgcc-4.9-dev_4.9.4-2ubuntu1_amd64.deb  404  Not Found
E: Failed to fetch http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9/gcc-4.9_4.9.4-2ubuntu1_amd64.deb  404  Not Found
E: Aborting install.

What is going on here? Thanks!

解决方案

First thing that came to mind was, running apt update and resetting the sources list if needed, as described here, should fix this:

https://askubuntu.com/questions/903496/error-during-upgrade-on-ubuntu-16-04

However, that didn't work, and if you'll follow the repository link:

http://il.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9

You'll find the .deb files for gcc 4.9.3, while apt tries to pick 4.9.4 (which seems to be the correct version for zesty), and therefore fails with 404 Not Found. It seems apt tries to pick gcc 4.9 from the wrong repo - perhaps since the needed repo was removed from apt's sources list, or apt's database is in some unstable state.

Trying to get apt to repair itself, then install gcc, you could try:

sudo apt-get update --fix-missing
sudo apt-get dist-upgrade
sudo apt-get install gcc-4.9 g++-4.9 gcc-4.9-multilib

If that won't work, you could go about adding a repository that contains the correct gcc 4.9 packages.

On Ubuntu 16.04, I was able to install gcc 4.9.4 (4.9.4-2ubuntu1~16.04) smoothly with apt using the launchpad repository. This should hopefully work (note - not tested on zesty):

sudo apt-add-repository -yu 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu zesty main'
sudo apt update
sudo apt-get install gcc-4.9 g++-4.9 gcc-4.9-multilib

If that won't work, you could install gcc directly from the .deb packages, but that's more of a pain (you'll need to install dependent packages as well and keep them in the right order).

这篇关于未能在ubuntu17.04中安装gcc-4.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆