You are not logged in.

#1 2013-12-14 06:39:00

marc.nelson
Member
Registered: 2013-12-14
Posts: 3

Pacman behind TOR doesn't work

Hi guys,
I was following the brief hint here on the wiki:
https://wiki.archlinux.org/index.php/Tor#Pacman

Unfortunately it doesn't work. I get this:
sudo pacman -Syy

:: Synchronizing package databases...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    163      0  0:00:01  0:00:01 --:--:--   163
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    107      0  0:00:01  0:00:01 --:--:--   107
error: GPGME error: No data
error: failed to update libre (invalid or corrupted database (PGP signature))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    116      0  0:00:01  0:00:01 --:--:--   116
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    116      0  0:00:01  0:00:01 --:--:--   116
error: GPGME error: No data
error: failed to update core (invalid or corrupted database (PGP signature))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    118      0  0:00:01  0:00:01 --:--:--   118
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    114      0  0:00:01  0:00:01 --:--:--   115
error: GPGME error: No data
error: failed to update extra (invalid or corrupted database (PGP signature))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    124      0  0:00:01  0:00:01 --:--:--   124
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    117      0  0:00:01  0:00:01 --:--:--   117
error: GPGME error: No data
error: failed to update community (invalid or corrupted database (PGP signature))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    117      0  0:00:01  0:00:01 --:--:--   117
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    107      0  0:00:01  0:00:01 --:--:--   107
  % Total    % Received % Xferd  Average Speed   Time    Timeerror: database 'pcr' is not valid (invalid or corrupted database (PGP signature))     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    103      0  0:00:01  0:00:01 --:--:--   103
error: GPGME error: No data
error: failed to update pcr (invalid or corrupted database (PGP signature))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  338k  100  338k    0     0  25289      0  0:00:13  0:00:13 --:--:-- 22194
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
error: database 'core' is not valid (invalid or corrupted database (PGP signature))
error: database 'extra' is not valid (invalid or corrupted database (PGP signature))
error: database 'community' is not valid (invalid or corrupted database (PGP signature))

I believe this is because TOR is too slow to catch up with CURL.
Is there a better way of doing this than the one suggested?

XferCommand = /usr/bin/curl --socks5-hostname localhost:9050 -C - -f %u > %o

I tried -m 120 but the connection still resets every second; basically I just need CURL to wait until the file is found and downloaded and forget the 1-5 second timeouts since TOR is a high-latency network as it is.

Thanks.

Offline

#2 2013-12-14 07:21:41

dodo3773
Member
Registered: 2011-03-17
Posts: 814

Re: Pacman behind TOR doesn't work

Rather than -m are you sure the option you are not looking for is "--connect-timeout"? Also, whatever mirrors you have chosen may block tor (a lot of places do); so maybe try some different mirrors (this would be the first place I would look (make sure servers can be accessed through tor first)).

Offline

#3 2013-12-14 14:53:31

marc.nelson
Member
Registered: 2013-12-14
Posts: 3

Re: Pacman behind TOR doesn't work

I tested with "--connect-timeout 120" and also manually going to some mirrors that I was using. It seems not too many are blocking TOR, unfortunately they are still timing out and the connect timeout feature isn't working with the current command:

XferCommand = /usr/bin/curl --connect-timeout 120 --socks5-hostname localhost:9050 -C - -f %u > %o

It still times out in less than 5 seconds. I also tried with --keep-alive 120 and some other variables but no luck ...

Offline

#4 2013-12-14 18:14:21

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Pacman behind TOR doesn't work

Why are you using an external downloader? Just set the proxy in the environment (the internal downloader is curl). If you're calling pacman via sudo, make sure that sudoers config allows passing http_proxy and friends through....

Offline

#5 2013-12-14 21:59:03

marc.nelson
Member
Registered: 2013-12-14
Posts: 3

Re: Pacman behind TOR doesn't work

I found a working solution.
1) sudo pacman -S privoxy
2) sudo nano /etc/privoxy/config
Uncomment this line:

#        forward-socks5             /     127.0.0.1:9050 .

3) Uncomment the following line in /etc/pacman.conf -

#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u

4) sudo nano /etc/wgetrc and add this -

http_proxy = http://127.0.0.1:8118/
https_proxy = http://127.0.0.1:8118

5) sudo pacman -Syu and watch the updates from through TOR, also resolving .onion addresses which are listed under unofficial mirrors on the wiki

Offline

Board footer

Powered by FluxBB