You are not logged in.

#1 2015-04-29 23:07:55

Caocoa
Member
Registered: 2010-11-11
Posts: 27

Custom dowload manager for pacman in chroot env

Hello smile
As this is the place for pacman in general I post here. Feel free to move that thread if you feel it would have a more suitable place.
I'm willing to install Arch on my computer from the live disk of another distro (Tails, based on Debian). I follow these guidelines but an issue is risen because of Tor wich makes resolving DNS less straightforward. Thus I've tried to use the option XferCommand in /etc/pacman.conf in the following way:

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

but I just get errors.

# pacman -S arch-install-scripts
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
error: target not found: arch-install-scripts
# pacman -Syu                   
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
:: Synchronizing package databases...
sh: /usr/bin/curl: No such file or directory
error: failed to update core (error invoking external downloader)
sh: /usr/bin/curl: No such file or directory
error: failed to update extra (error invoking external downloader)
sh: /usr/bin/curl: No such file or directory
error: failed to update community (error invoking external downloader)
error: failed to synchronize any databases
error: failed to init transaction (error invoking external downloader)

Would you have any idea to solve this problem? Of course I've checked that /usr/bin contains curl with this line:

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

but it seems to be very contradictory:

 # pacman -Syu                   
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
:: Synchronizing package databases...
bsdtar	curl  env  ex  nano  pacman  ping  vi
sh: /usr/bin/curl: No such file or directory
error: failed to update core (error invoking external downloader)
bsdtar	curl  env  ex  nano  pacman  ping  vi
sh: /usr/bin/curl: No such file or directory
error: failed to update extra (error invoking external downloader)
bsdtar	curl  env  ex  nano  pacman  ping  vi
sh: /usr/bin/curl: No such file or directory
error: failed to update community (error invoking external downloader)
error: failed to synchronize any databases
error: failed to init transaction (error invoking external downloader)

Last edited by Caocoa (2015-04-29 23:13:26)


caocoa@C40C04 ~:

Offline

#2 2015-04-29 23:22:33

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Custom dowload manager for pacman in chroot env

moved to "Installation"


The wiki page specifies different methods. Can you tell us exactly what you have done?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2015-04-30 00:23:25

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Custom dowload manager for pacman in chroot env

If you want to install Arch, why not do it in a more straightforward way?

You're creating issues that have nothing to do with Arch.

Offline

#4 2015-04-30 11:07:58

Caocoa
Member
Registered: 2010-11-11
Posts: 27

Re: Custom dowload manager for pacman in chroot env

Here is what I've done:

ARCHI=$(uname -m)
ARCH_MINI="$HOME/tmp_arch"
mkdir "$ARCH_MINI"
cd "$ARCH_MINI"
alias curl="torsocks curl"
curl -O http://mir.archlinux.fr/~tuxce/chroot/archlinux.chroot.$ARCHI.tgz
tar zxf archlinux.chroot.$ARCHI.tgz
cp /etc/resolv.conf "$ARCH_MINI/etc/"
mount -B /proc "$ARCH_MINI/proc"
mount -B /dev "$ARCH_MINI/dev"
mount -B /sys "$ARCH_MINI/sys"
mount -B /dev/pts "$ARCH_MINI/dev/pts"
ARCH_SYS="$ARCH_MINI/mnt"
mount /dev/sda4 "$ARCH_SYS"
mkdir -p "$ARCH_SYS"/var/{cache/pacman/pkg,lib/pacman} "$ARCH_SYS"/{dev,proc,sys,run,tmp,etc,boot,root,home}
mount -B /proc "$ARCH_SYS/proc"
mount -B /dev "$ARCH_SYS/dev"
mount -B /sys "$ARCH_SYS/sys"
lsblk
mount /dev/sda2 "$ARCH_SYS"/boot
mount /dev/sda1 "$ARCH_SYS"/efi
mount /dev/sda5 "$ARCH_SYS"/home
echo 'PS1="(installation) \w \\$ "' > "$ARCH_SYS/root/.bashrc"
chroot "$ARCH_MINI" /bin/bash

The main issue is I can't use pacman:

(Arch mini) / # pacman -Syu  
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
:: Synchronizing package databases...
error: failed retrieving file 'core.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Unknown error
error: failed to update core (download library error)
error: failed retrieving file 'extra.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Unknown error
error: failed to update extra (download library error)
error: failed retrieving file 'community.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Unknown error
error: failed to update community (download library error)
error: failed to synchronize any databases
error: failed to init transaction (download library error)

Even if I try to copy curl binary from the host to the chroot and pass it socks option (like in my first message) it says:

/usr/bin/curl: No such file or directory

By default, pacman can't resolve repo name:

(Arch mini) / # pacman -Syu
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
:: Synchronizing package databases...
error: failed retrieving file 'core.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Unknown error
error: failed to update core (download library error)
error: failed retrieving file 'extra.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Unknown error
error: failed to update extra (download library error)
error: failed retrieving file 'community.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Unknown error
error: failed to update community (download library error)
error: failed to synchronize any databases
error: failed to init transaction (download library error)

If I want to change the adress of the repo in mirrorlist to the resolved IP address

Server = http://91.121.141.57/$repo/os/$arch

it's doesn't work either but says:

(Arch mini) / # pacman -Syu
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
:: Synchronizing package databases...
error: failed retrieving file 'core.db' from 91.121.141.57 : couldn't connect to host
error: failed to update core (download library error)
error: failed retrieving file 'extra.db' from 91.121.141.57 : couldn't connect to host
error: failed to update extra (download library error)
error: failed retrieving file 'community.db' from 91.121.141.57 : couldn't connect to host
error: failed to update community (download library error)
error: failed to synchronize any databases
error: failed to init transaction (download library error)

Last edited by Caocoa (2015-04-30 11:15:15)


caocoa@C40C04 ~:

Offline

#5 2015-04-30 13:12:27

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Custom dowload manager for pacman in chroot env

sh: /usr/bin/curl: No such file or directory

This is most likely because you only copied the binary, and are missing several libraries; have a look at output from `ldd`

error: failed retrieving file 'core.db' from 91.121.141.57 : couldn't connect to host

This is caused by pacman being unable to find your proxy.

So put the XferCommand back in but keep the torsocks prefix; resolving and connecting should be done by the torified curl, because pacman can't use tor directly. The alias you define in your shell is not passed through to pacman

Last edited by Spider.007 (2015-04-30 13:13:28)

Offline

Board footer

Powered by FluxBB