我正在尝试更新我的VPS上的/etc/apt/sources.list 。 当我运行apt-get update我得到了各种404找不到,例如:
Failed to fetch http://debian.newdream.net/dists/etch/main/binary-amd64/Packages.gz 404 Not Found Failed to fetch http://security.debian.org/dists/etch/updates/main/binary-amd64/Packages.gz 404 Not Found [IP: 149.20.20.6 80] Failed to fetch http://www.ksplice.com/apt/dists/etch/ksplice/binary-amd64/Packages.gz 404 Not Found
当我看着http://www.debian.org/releases/etch/ ,我没有看到有关档案的任何信息。 我在archive.debian.org里面,但是对于如何遵循它的说明/修改源列表我有点困惑。 以下是当前列表的内容:
deb http://debian.di.newdream.net/ etch ndn deb http://www.ksplice.com/apt etch ksplice deb http://debian.newdream.net etch main non-free contrib deb http://www.backports.org/debian/ etch-backports main deb http://archive.debian.org/debian-volatile etch/volatile main contrib non-free deb http://security.debian.org/ etch/updates main deb http://debian.dc-uoit.net/debian-multimedia/ etch main
根据我在档案自述文件中读到的内容,我认为格式是这样的:
deb http://archive.debian.org/debian-security dists/etch/updates/ main
另外,在注释掉大部分(即使不是源文件中的所有行)之后,仍然会得到相同的错误。 是否有需要运行清除caching的命令?
蚀刻现在是超过生命结束的两个版本。 没有安全支持,因为它不被支持。
对于主档案使用这样的一行。
deb http://archive.debian.org/debian etch main
你应该升级到lenny,然后挤压。
安全更新,backports,多媒体和ksplice档案可能已经没有了。
man apt , man apt-cache和man apt-get提供了关于包caching维护的信息。
更新/etc/apt/sources.list文件后,请记住,软件包信息存储在不同的地方,只是运行apt-get clean或apt-get autoclean不会清除这些结垢的软件包(您将继续收到一个404错误的包未find)。 您将需要清除包caching:
/var/lib/apt/lists/ Storage area for state information for each package resource specified in sources.list(5) Configuration Item: Dir::State::Lists.
如果你做了ls /var/lib/apt/lists/你会看到引起404s的资源列表。在/var/lib/apt/lists/partial/也可能有软件包信息。 你可能需要删除(如rm foo-bar )那些导致404s的软件包。 小心不要删除那些正在工作。
那么如果你进入/etc/apt你会注意到sources.list.d 。 在我的情况下,我只是运行sources.list.d/*并删除了所有破损的包(当然在validationsources.list.d/*的内容之后)。
之后你可以依次运行apt-get check , apt-get autoclean和apt-get update ,你应该清理干净。
如果您对列表文件中软件包的命名约定有疑问,则可以始终使用man sources.list 。