Debian 10 - Debootstrap not working

New to Debian (Or Linux in general)? Ask your questions here!

Debian 10 - Debootstrap not working

Postby Molipate » 2019-08-16 12:10

Hi everyone

I try to create a chroot with a bash script ; but debootstrap is not working, i've already done that many times, without any problems ...
Here is the (very simple) script :

Code: Select all
#!/bin/bash

ARCHITECTURE=$1 #amd64
DISTRIBUTION=$2 #stretch
PATH=$3 #/srv/test_chroot

debootstrap --arch=$ARCHITECTURE $DISTRIBUTION $PATH


It keeps telling me "./installScript.sh: ligne 10: debootstrap: No such file or directory" ; but when I manually run "debootstrap stable test_chroot" it works fine ...
Does any one knows why ?

Thx
Molipate
 
Posts: 3
Joined: 2019-08-16 12:03

Re: Debian 10 - Debootstrap not working

Postby Dai_trying » 2019-08-16 12:16

Your debootstrap command is #line 7 so the error is three lines further down the script. or it could be that you haven't "quoted" your variables?.?.?. causing a confusion with the line numbers
Dai_trying
 
Posts: 800
Joined: 2016-01-07 12:25

Re: Debian 10 - Debootstrap not working

Postby Molipate » 2019-08-16 12:24

Putting quotes around variables does not change the problem ; but this works fine :
Code: Select all
debootstrap --arch='amd64' 'stable' 'test_chroot'
Molipate
 
Posts: 3
Joined: 2019-08-16 12:03

Re: Debian 10 - Debootstrap not working

Postby Dai_trying » 2019-08-16 12:28

Molipate wrote:Putting quotes around variables does not change the problem ; but this works fine :
Code: Select all
debootstrap --arch='amd64' 'stable' 'test_chroot'


Maybe I misunderstood this but are you saying quotes make no difference but what you posted (with single quotes) does work???

EDIT:
and 'test_chroot' is not the same as /srv/test_chroot
Dai_trying
 
Posts: 800
Joined: 2016-01-07 12:25

Re: Debian 10 - Debootstrap not working

Postby Molipate » 2019-08-16 12:43

Yes if i replace variables by their content,it does work ...
What do you mean by 'is not the same' ? I run script as root if that's you mean
Molipate
 
Posts: 3
Joined: 2019-08-16 12:03

Re: Debian 10 - Debootstrap not working

Postby L_V » 2019-08-16 13:02

The title is wrong. Deboostrap is working fine.
Your problem is not deboostrap which is not working, but your script which seems useless.
Or try this, although I don't see why you need a script.

Code: Select all
#!/bin/bash

# ARCHITECTURE=$1 #amd64
# DISTRIBUTION=$2 #stretch
# PATH=$3 #/srv/test_chroot

debootstrap --arch $1 $2 $3
L_V
 
Posts: 1126
Joined: 2007-03-19 09:04


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable