Linux 如何修复 Debian Lenny 中的 apt-get 更新以便安装 PostgreSql 9.1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9793116/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:17:28  来源:igfitidea点击:

How to fix apt-get update in Debian Lenny so that PostgreSql 9.1 can installed

linuxpostgresqldebianpostgresql-9.1lenny

提问by Andrus

I tried

我试过

apt-get update

on Debian Lenny but got error below. How to fix this so that PostgreSql 9.1 can installed ?

在 Debian Lenny 上,但在下面出现错误。如何解决此问题以便安装 PostgreSql 9.1?

root:~# apt-get update
Ign http://security.debian.org etch/updates Release.gpg
Get:1 http://archive.debian.org Debian-4.0 Release.gpg [1033B]
Get:2 http://archive.debian.org etch-backports Release.gpg [189B]
Ign http://security.debian.org etch/updates Release
Hit http://archive.debian.org Debian-4.0 Release
Ign http://security.debian.org etch/updates/main Packages/DiffIndex
Ign http://security.debian.org etch/updates/main Sources/DiffIndex
Hit http://archive.debian.org etch-backports Release
Ign http://security.debian.org etch/updates/main Packages
Ign http://archive.debian.org Debian-4.0/main Packages/DiffIndex
Ign http://archive.debian.org Debian-4.0/contrib Packages/DiffIndex
Ign http://archive.debian.org Debian-4.0/non-free Packages/DiffIndex
Ign http://security.debian.org etch/updates/main Sources
Get:3 http://archive.debian.org etch-backports Release [72,9kB]
Err http://security.debian.org etch/updates/main Packages
  404 Not Found [IP: 212.211.132.250 80]
Err http://security.debian.org etch/updates/main Sources
  404 Not Found [IP: 212.211.132.250 80]
Hit http://archive.debian.org Debian-4.0/main Packages
Hit http://archive.debian.org Debian-4.0/contrib Packages
Ign http://archive.debian.org etch-backports Release
Hit http://archive.debian.org Debian-4.0/non-free Packages
Ign http://archive.debian.org etch-backports/main Packages/DiffIndex
Ign http://archive.debian.org etch-backports/contrib Packages/DiffIndex
Ign http://archive.debian.org etch-backports/non-free Packages/DiffIndex
Hit http://archive.debian.org etch-backports/main Packages
Hit http://archive.debian.org etch-backports/contrib Packages
Hit http://archive.debian.org etch-backports/non-free Packages
Fetched 73,1kB in 0s (90,3kB/s)
Failed to fetch http://security.debian.org/dists/etch/updates/main/binary-amd64/Packages.gz  404 Not Found [IP: 212.211.132.250 80]
Failed to fetch http://security.debian.org/dists/etch/updates/main/source/Sources.gz  404 Not Found [IP: 212.211.132.250 80]
Reading package lists... Done
W: There is no public key available for the following key IDs:
9AA38DCD55BE302B
W: Conflicting distribution: http://archive.debian.org Debian-4.0 Release (expected Debian-4.0 but got etch)
W: GPG error: http://archive.debian.org etch-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EA8E8B2116BA136C
W: You may want to run apt-get update to correct these problems
E: Some index files failed to download, they have been ignored, or old ones used instead.

sources.list contains:

sources.list 包含:

deb http://archive.debian.org/debian Debian-4.0 main contrib non-free
deb http://security.debian.org/ etch/updates main
deb-src http://security.debian.org/ etch/updates main
deb http://archive.debian.org/debian-backports etch-backports main contrib non-free

采纳答案by Bubuntux

It looks like you have etch repos in a lenny distro, so why not update your source.list with lenny repos:

看起来您在 lenny 发行版中有 etch 存储库,那么为什么不使用 lenny 存储库更新您的 source.list:

###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free 

###### Debian Update Repos
deb http://security.debian.org/ lenny/updates main contrib non-free 
deb http://ftp.us.debian.org/debian/ lenny-proposed-updates main contrib non-free

This probably fix the problem but postgresql 9.1 is only available in testing distro, so you can try add this line

这可能会解决问题,但 postgresql 9.1 仅在测试发行版中可用,因此您可以尝试添加此行

deb http://ftp.us.debian.org/debian testing main contrib non-free

in the file /etc/apt/source.list

在文件 /etc/apt/source.list 中

Also add

还添加

Package: *
Pin: release n=testing
Pin-Priority: 500

in /etc/apt/preferences

在 /etc/apt/preferences

doing this you will have all the packages for the testing version, but they're not going to be installed unless you specify it, so run

这样做你将拥有测试版本的所有包,但除非你指定它们,否则它们不会被安装,所以运行

apt-get update
apt-get install <package name>=<version>

for example

例如

apt-get install postgresql=9.1+129

you can check the different versions with

你可以检查不同的版本

apt-cache showpkg postgresql