apt-get 403 Forbidden


15

我今天开始一项新工作,并且试图将我的机器设置为通过其Windows服务器运行。

我现在设法通过服务器建立了Internet连接,但是现在apt-get update由于出现“ 403 Forbidden”错误而无法运行。

除翻译(?)外,这是我来源列表下的每个回购。

我确实有一个代理apt.conf,如果没有,则会收到407权限被拒绝错误。

这是我的apt.conf文件(我已经省略了用户名和密码)

Acquire::http::proxy "http://username:password@192.168.0.2:8080/";

这是我的 sources.list

#deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/main/binary-i386/

#deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/restricted/binary-i386/
#deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ precise main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise universe
deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

我可以排序的改变所有修复此http在的sources.list来ftp,但我仍然有购电协议问题

Answers:


15

此错误是由于服务器造成的,完全不是您的错。可能是因为该存储库处于脱机状态以进行维护。

但是,您应该稍后再试,或者/并且我建议还原到其他国家/地区的服务器,而不是主要的archive.ubuntu.com,因为该服务器已被限制并且无法全速运行。

选择服务器udate


我将尝试这些解决方案并尽快标记答案,我目前在双启动中遇到其他一些问题,因此无法对其进行测试。
Lerp 2013年

您是正确的,服务器已关闭。我现在不需要代理或任何东西。谢谢!
Lerp 2013年

抱歉,忘记了!
Lerp 2013年


0

即使使用主服务器,我也经常遇到此错误。我注意到当apt-get进程由于某种原因中断时会发生这种错误。例如,运行apt-get update某些文件时,可能无法完成下载。您将在那之后得到该特定文件的403错误。

我了解到,在apt-get更新期间,这些部分下载的文件(我不确定它们是否完全是文件)存储在 /var/lib/apt/lists/partial/

所以我做了 sudo rm -r /var/lib/apt/lists/partial/*(删除了目录中的所有文件)

之后,我不会收到403错误。

如果您收到错误运行时apt-get installapt-get upgradeapt-get dist-upgrade

尝试 sudo rm -r /var/cache/apt/archives/partial/*


/var/cache/apt/archives/partial/是一个空目录,但我仍然
遇到
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.