使用 apt-cacher 安装 Java 时出错

使用 apt-cacher 安装 Java 时出错

当我尝试更新/安装 oracle-java7 或从 webupd8 ppa 更新/安装时,我得到了这个输出:

Downloading Oracle Java 7...
--2014-11-19 16:35:02--  http://download.oracle.com/otn-pub/java/jdk/7u72-b14/jdk-7u72-    linux-x64.tar.gz
Resolving debiancacherepo.domain.com (debiancacherepo.domain.com)... 192.168.130.129
Connecting to debiancacherepo.domain.com (debiancacherepo.domain.com)|192.168.130.129|:3142... connected.
Proxy request sent, awaiting response... 403 Sorry, not allowed to fetch that type of file: jdk-7u72-linux-x64.tar.gz
2014-11-19 16:35:02 ERROR 403: Sorry, not allowed to fetch that type of file: jdk-7u72-linux-x64.tar.gz.

download failed
Oracle JDK 7 is NOT installed.
dpkg: error processing package oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1

我的/etc/apt-cacher.conf

#package_files_regexp = (?:^[-+.a-z0-9]+_(?:\d:)?[-+.~a-zA-Z0-9]+(?:_?[-a-z0-9]+\.(?:u|d)?    deb|\.dsc|\.tar(?:\.gz|\.bz2|\.xz)|\.diff\.gz)|\.rpm|index\.db-.+\.gz|\.jigdo|\.template)$

#pdiff_files_regexp = ^2\d{3}-\d{2}-\d{2}-\d{4}\.\d{2}\.gz$

#index_files_regexp = ^(?:Index(?:\.bz2)?|(?:Sources|Packages|release)(?:\.gz|\.bz2)?|Release(?:\.gpg)?|InRelease|Contents-(?:[a-z]+-)?[a-zA-Z0-9]+\.gz|(?:srclist|pkglist)\.[a-z-    ]+\.bz2|Translation-[a-z]{2,3}(?:_[A-Z]{2}(?:\.[a-zA-Z0-9-$

我认为 apt-cacher 不喜欢该文件的格式jdk-7u72-linux-x64.tar.gz但我无法更改配置来允许它。

答案1

好的,我终于找到了解决方案邮政。

添加

Acquire::http::Proxy { download.oracle.com DIRECT; }; 

在代理配置 /etc/apt/apt.conf.d/01proxy 中。

相关内容