From: Marius Bakke <mbakke@fastmail.com>
To: "Clément Lassieur" <clement@lassieur.org>,
"Chris Marusich" <cmmarusich@gmail.com>
Cc: 30728@debbugs.gnu.org
Subject: bug#30728: guix-install.sh doesn't work if run with "sudo"
Date: Mon, 26 Mar 2018 11:18:50 +0200 [thread overview]
Message-ID: <87muyvjith.fsf@fastmail.com> (raw)
In-Reply-To: <87efk79s81.fsf@lassieur.org>
[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]
Clément Lassieur <clement@lassieur.org> writes:
> Hi Chris,
>
> Chris Marusich <cmmarusich@gmail.com> writes:
>
>> Clément Lassieur <clement@lassieur.org> writes:
>>
>>> Clément Lassieur <clement@lassieur.org> writes:
>>>
>>>> Hi,
>>>>
>>>> My system is Ubuntu 16.04.
>>>>
>>>> I ran './guix-install.sh' and got the message: "This script must be run
>>>> as root.". So I ran 'sudo ./guix-install.sh' and got an error message
>>>> saying that:
>>>>
>>>> GUIX_PROFILE="${HOME}/.guix-profile"
>>>> source "${GUIX_PROFILE}/etc/profile"
>>>>
>>>> the 'source' command doesn't work because ${GUIX_PROFILE} was never
>>>> created, ${HOME} being /home/clement, not /root.
>>>>
>>>> To recover from this I had to manually delete /var/guix and /gnu, log as
>>>> root with 'su', and start again.
>>>>
>>>> Clément
>>>
>>> I believe the script should install Guix in the user's home directory,
>>> not in ~root.
>>
>> The manual says (see: (guix) Binary Installation):
>>
>> 3. Make ‘root’’s profile available under ‘~/.guix-profile’:
>>
>> # ln -sf /var/guix/profiles/per-user/root/guix-profile \
>> ~root/.guix-profile
>
> I think the manual is wrong here. This only makes sense if the user is
> 'root'. Otherwise, the user would expect Guix to be installed in their
> home, not in root's home. We could use the HOME and USER environment
> variables like this:
>
> # ln -sf /var/guix/profiles/per-user/$USER/guix-profile $HOME/.guix-profile
>
> Thus, even if 'sudo' decides to change these environment variables, it
> will still be consistent.
The binary installation tarball only comes with a profile for 'root'.
The problem is that the installation script assumes $HOME will expand to
~root when sourcing the profile, but as you found that isn't always the
case.
~root/.guix-profile is "hard-coded" many other places in the script, so
Tatianas solution seems sensible to me.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2018-03-26 9:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87zi3lh6mb.fsf@lassieur.org>
2018-03-23 13:20 ` bug#30728: guix-install.sh doesn't work if run with "sudo" Clément Lassieur
2018-03-25 5:16 ` Chris Marusich
2018-03-26 8:05 ` Clément Lassieur
2018-03-26 9:18 ` Marius Bakke [this message]
2018-03-27 7:46 ` Ricardo Wurmus
2018-03-27 9:11 ` Clément Lassieur
2018-03-27 16:08 ` Chris Marusich
2018-03-28 19:24 ` Ricardo Wurmus
2018-03-29 5:07 ` Chris Marusich
2018-03-29 8:26 ` Clément Lassieur
2018-03-29 7:48 ` Clément Lassieur
2018-03-29 10:07 ` Ricardo Wurmus
2018-03-30 22:07 ` Clément Lassieur
2018-03-29 8:04 ` Clément Lassieur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87muyvjith.fsf@fastmail.com \
--to=mbakke@fastmail.com \
--cc=30728@debbugs.gnu.org \
--cc=clement@lassieur.org \
--cc=cmmarusich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.