“apt-get source”找不到包,但“apt-get install”和“apt-get cache”可以找到

Gar*_*t R 7 ubuntu squid deb apt

我正在尝试下载包的源代码,但是当我运行时

root@proxy:~# apt-get source squid3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Can not find version '3.3.8-1.1' of package 'squid3'
E: Unable to find a source package for squid3
Run Code Online (Sandbox Code Playgroud)

无法找到。但是当我运行时apt-cache search squid3它会找到它。

root@proxy:~# apt-cache search squid3
squid-cgi - Full featured Web Proxy cache (HTTP proxy) - control CGI
squid3 - Full featured Web Proxy cache (HTTP proxy)
squid3-common - Full featured Web Proxy cache (HTTP proxy) - common files
squid3-dbg - Full featured Web Proxy cache (HTTP proxy) - Debug symbols
squidclient - Full featured Web Proxy cache (HTTP proxy) - control utility
Run Code Online (Sandbox Code Playgroud)

它也很好用apt-get install squid3。我正在使用 Ubuntu 11.04 服务器,这是我的 /etc/apt/sources.list

deb http://old-releases.ubuntu.com/ubuntu natty main restricted universe
deb http://old-releases.ubuntu.com/ubuntu natty-updates main restricted universe
deb http://old-releases.ubuntu.com/ubuntu natty-security main restricted universe
deb http://archive.canonical.com/ubuntu natty partner
deb http://ftp.us.debian.org/debian sid main
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
deb http://archive.ubuntu.com/ubuntu natty universe
deb-src http://archive.ubuntu.com/ubuntu natty universe
Run Code Online (Sandbox Code Playgroud)

我已经 apt-get 更新了很多次。我尝试了许多不同的 deb,但在其他任何地方都没有发现此错误。

md_*_*d_5 10

这里的问题是你的二进制包 (deb) 与你的源包 (deb-src) 不一致。由于 squid3 来自 sid,请添加以下行:

deb-src http://ftp.us.debian.org/debian sid main
Run Code Online (Sandbox Code Playgroud)

这应该解决它