6

I'm not sure how to set up authenticated proxy access with rpm. But I have it set up with wget and yum.

When I run rpm -Uvh http://dl.fedoraproject.org/etc...

It just says 'Retrieving http://...' and I have no idea what's going on.

Any help?

AlxVallejo
  • 1,086
  • 4
  • 11
  • 19
  • 2
    I think the simple answer is you CAN'T. You have to download the repo from wget / yum and then rpm -Uvh the repo without http'ing. – AlxVallejo Mar 30 '12 at 21:42

2 Answers2

4

For RPM, what you provide to --httpproxy will be forwarded to curl --proxy.

So rpm --httpproxy http://foo:bar@proxy.example.com:3128.

If you want to troubleshoot, you can edit /usr/lib/rpm/macros and remove --silent in there:

%__urlhelpercmd         /usr/bin/curl
%__urlhelperopts        --silent --show-error --fail --location -o
%__urlhelper_proxyopts   %{?_httpproxy:--proxy %{_httpproxy}%{?_httpport::%{_httpport}}}%{!?_httpproxy:%{nil}}
Pierre Carrier
  • 2,617
  • 18
  • 28
1

You can use the usual way of exporting the http_proxy (and/or https_proxy) variable. I believe this will also work with "wget". RPM seems to use "curl" to get the files, so "man curl" may be also useful.

$ rpm -qp http://ftp.jaist.ac.jp/pub/Linux/CentOS/6/os/i386/Packages/centos-release-6-2.el6.centos.7.i686.rpm
curl: (7) Failed to connect to 2001:200:141:feed::feed: Network is unreachable
error: http://ftp.jaist.ac.jp/pub/Linux/CentOS/6/os/i386/Packages/centos-release-6-2.el6.centos.7.i686.rpm: open failed: No such file or directory

$ export http_proxy="http://${proxy_user}:${proxy_pass}@${proxy_server}:${proxy_port}/"
$ rpm -qp http://ftp.jaist.ac.jp/pub/Linux/CentOS/6/os/i386/Packages/centos-release-6-2.el6.centos.7.i686.rpm
centos-release-6-2.el6.centos.7.i686
chutz
  • 7,888
  • 1
  • 29
  • 59