如何找到一个软件包属于哪个Ubuntu仓库

长话短说,我想安装gcc,但是却遇到了错误,最后发现造成了如下结果:
Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.11) but 5.4.0-6ubuntu1~16.04.12 is to be installed

我试图降级我的 gcc-5-base,这绝对是个坏主意。

所以打算在 source.list 中更改仓库为依赖于 5.4.0-6ubuntu1~16.04.12 的 gcc 候选版本。

我在这个网站上找到了一个:https://launchpad.net/ubuntu/+source/gcc-5/5.4.0-6ubuntu1~16.04.12,但我不知道如何找到相应的 Ubuntu 仓库。


1我根据这个git链接(https://gist.github.com/rohitrawat/60a04e6ebe4a9ec1203eac3a11d4afc1)替换了我的source.list中的一些条目,现在一切都正常了。 - zifan yan
1个回答

也许使用rmadison可以帮助,例如。
rmadison gcc
 gcc | 4:4.6.3-1ubuntu5   | precise         | amd64, armel, armhf, i386, powerpc
 gcc | 4:4.8.2-1ubuntu6   | trusty          | amd64, arm64, armhf, i386, powerpc, ppc64el
 gcc | 4:5.3.1-1ubuntu1   | xenial          | amd64, arm64, armhf, i386, powerpc, ppc64el, s390x
 gcc | 4:7.3.0-3ubuntu2   | bionic          | amd64, arm64, armhf, i386, ppc64el, s390x
 gcc | 4:7.4.0-1ubuntu2.3 | bionic-security | amd64, arm64, armhf, i386, ppc64el, s390x
 gcc | 4:7.4.0-1ubuntu2.3 | bionic-updates  | amd64, arm64, armhf, i386, ppc64el, s390x
 gcc | 4:8.3.0-1ubuntu3   | disco           | amd64, arm64, armhf, i386, ppc64el, s390x
 gcc | 4:9.2.1-3.1ubuntu1 | eoan            | amd64, arm64, armhf, i386, ppc64el, s390x
 gcc | 4:9.3.0-1ubuntu2   | focal           | amd64, arm64, armhf, i386, ppc64el, riscv64, s390x
 gcc | 4:9.3.0-1ubuntu2   | groovy          | amd64, arm64, armhf, i386, ppc64el, riscv64, s390x

or:
madison gcc-9
 gcc-9 | 9-20190402-1ubuntu1  | disco          | source, amd64, arm64, armhf, i386, ppc64el, s390x
 gcc-9 | 9.1.0-2ubuntu2~19.04 | disco-security | source, amd64, arm64, armhf, i386, ppc64el, s390x
 gcc-9 | 9.1.0-2ubuntu2~19.04 | disco-updates  | source, amd64, arm64, armhf, i386, ppc64el, s390x
 gcc-9 | 9.2.1-9ubuntu2       | eoan           | source, amd64, arm64, armhf, i386, ppc64el, s390x
 gcc-9 | 9.3.0-10ubuntu2      | focal          | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x
 gcc-9 | 9.3.0-13ubuntu1      | groovy         | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x

嗨,谢谢回复!我无法通过apt安装madison。这是因为我的源列表有问题吗?看起来仓库的URL是我们公司的URL,有没有办法找到Ubuntu的默认源列表呢? - zifan yan
3信息:rmadison命令由devscripts软件包提供。 - user535733