You are not logged in.

#1 2016-01-22 03:48:07

tarm
Member
Registered: 2016-01-22
Posts: 3

Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

Issue Solved


I have a locked down PC and the only networking is a configured proxy that is for pacman only.    I do not any other programs to directly be able to use it in this config.   I have been searching all the various man pages and forum pages for a few days and trying various ways.been   



In etc/pacman.conf

it does not recognize  http_proxy = as a line added.

I can uncomment the 'XferCommand' line for 'curl'.  Then go to their cofig and add the 'http_proxy = address:port'
The issue with this is that now 'curl' can be used directly to access the network thru the proxy and can connect to any address.   I need only when pacman is used to allow the proxy connection to work.

My question comes down to this:

can you pass the 'http_ proxy =' in the actual XferCommnd' line?

Example:

XferCommand = http_proxy= address:port /usr/bin/curl -C - -f %u > %o

If this can pass then I would think this would only allow pacman cmd to use proxy via the curl but not


It would sure be nice if pacman could recognize http_proxy = itself rather than having to use a agent /wrapper.


Now I do have a final option that does work but would rather keep it as straightforward as possible.    I can use powerpill as it will allow this function but I would much rather just stay with pacman.

Thanks

T

Last edited by tarm (2016-01-24 10:39:40)

Offline

#2 2016-01-22 05:03:25

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,401
Website

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

From curl's man page,

Using an environment variable to set the proxy has the same effect as using the --proxy option.

So try passing the --proxy switch to curl in XferCommand, instead of using http_proxy.

Offline

#3 2016-01-22 06:18:35

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,010

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

You could export http_proxy in ~/.bashrc.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#4 2016-01-22 06:32:05

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,401
Website

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

@nomorewindows,

The issue with this is that now 'curl' can be used directly to access the network thru the proxy and can connect to any address.   I need only when pacman is used to allow the proxy connection to work.

Offline

#5 2016-01-23 06:23:33

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,010

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

I tried curl and wget both with pacman and it was slower than native pacman using http_proxy export. 
Isn't there a way to do http_proxy=xxx.xxx.xxx.xxx:yyyy pacman -Syu?  Of course that's annoying to have to do that everytime.
The only other problem is that the proxy will try to store the package files as well as the sync databasas and probbaly can be used in lieu of something like pacserve.  It practically works the same way.  You add a line to each repo pointing to pacserve.  Do you have other computers that you are sharing the sync database/packages with?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#6 2016-01-24 05:31:20

tarm
Member
Registered: 2016-01-22
Posts: 3

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

Guys thanks for all the help.   As I was looking up and getting ready to try the suggested --proxy I had someone mention I should not have spaces between http_proxy and  = and address.   I should have had XferCommand = http_proxy=address:port not  XferCommand = http_proxy = address:port .  So in the end it was a syntax error. grrrrrrrr   I kick myself for how much time I spent on this.


Thanks again guys for all the quick and helpful responses.   

I use powerpill but I needed to get the proper conf for just pacman for documentation and thus had to get it working.




Nomorewindows:


I really like powerpill.  But to qualify my opinion I am a archlinux newbie very green so take that into consideration.

I like that powerpill allows concurrent and segmented downloading which in many cases can increase overall speed of updates etc..  Further it has very straightforward proxy setup that is universal not protocol dependent.  As well its config file /etc/powerpill/powerpill.json is very powerful in that it can control reflector for mirrorlist conf.  The aria2 downloader app to config concurrent connections, proxy etc..  as well as rsync and pacman.  All of that from one config file and one wrapper.

Just added xnye to my repo list in /etc/pacman.conf

[xyne-x86_64]
# A repo for Xyne's own projects: http://xyne.archlinux.ca/projects/
# Packages for the "x86_64" architecture.
# Added for PowerPill app
# Note that this includes all packages in [xyne-any].
SigLevel = Required
Server = http://xyne.archlinux.ca/repos/xyne



As an example here is how I have my powerpill config file (etc/powerpill/powerpill.json) setup:  I blocked out my proxy addy with xx is the only change.


I set up proxy under the aria2 section with:

"aria2": {
    "args": [
      "--allow-overwrite=true",
      "--always-resume=false",
      "--auto-file-renaming=false",
      "--check-integrity=true",
      "--conditional-get=true",
      "--continue=true",
      "--file-allocation=none",
      "--log-level=error",
      "--max-concurrent-downloads=100",
      "--max-connection-per-server=5",
      "--min-split-size=5M",
      "--remote-time=true",
      "--show-console-readout=true",
      "--all-proxy=xxx.xxx.xxx.xxx:xxxx"
    ],
    "path": "/usr/bin/aria2c"
  },
  "pacman": {
    "config": "/etc/pacman.conf",
    "path": "/usr/bin/pacman"
  },
  "pacserve": {
    "server": null
  },
  "powerpill": {
    "select": true,
    "reflect databases": false
},
  "reflector": {
    "args": [
      "--protocol",
      "https",
      "--latest",
      "50",
      "--fastest",
      "25"
    ]
  },
  "rsync": {
    "args": [
      "--no-motd",
      "--progress"
    ],
    "db only": true,
    "path": "/usr/bin/rsync",
    "servers": []


While I have not tried it I have heard that using rsync enabled servers and using it can increase speed all things being equal otherwise.

Offline

#7 2016-01-24 05:33:03

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 19,096
Website

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_code

And remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#8 2016-01-24 10:38:41

tarm
Member
Registered: 2016-01-22
Posts: 3

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

Sorry about that I will make sure to do those things in the future.   I missed it as those links were inside/apart of the config file I posted. 

I will edit my first post to denote it as " Solved".

Cheers,

T

Offline

#9 2016-01-24 13:16:57

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,010

Re: Pacman.conf: Passing http_proxy = in Xfercommnad line: "Solved"

tarm wrote:

Sorry about that I will make sure to do those things in the future.   I missed it as those links were inside/apart of the config file I posted. 

I will edit my first post to denote it as " Solved".

Cheers,

T

You can go back and edit to make the code blocks, but anyhow, powerpill is usually good on throttled connections, and for full speed connections, doesn't offer any real benefit.  Shared pacman cache, a cached proxy of the sync databases/packages all helps when you have multiple Arch machines laying around.  http_proxy might be useful in tor installations also.  If you mess up or something the proxy can be a lifesaver, but for one machine it's kinda marginal benefit to use proxy.  I have diskless roots and if it is the same architecture, I just symlink those roots back to the main sync databases, and I don't have to do run those through a proxy.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB