unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Sergiu Ivanov <sivanov@colimite.fr>
Cc: help-guix@gnu.org, Adam Kandur <rndd@tuta.io>
Subject: Re: cannot "guix pull"
Date: Sun, 21 Mar 2021 20:11:27 -0400	[thread overview]
Message-ID: <YFfgr1MiJyy3yNP4@jasmine.lan> (raw)
In-Reply-To: <87k0q0ewtb.fsf@colimite.fr>

I'm happy to help, but unfortunately, the paste that included the error
messages is no longer online:

https://lists.gnu.org/archive/html/help-guix/2021-03/msg00184.html

This illustrates why it is important to include all relevant details of
a problem in the email, rather than linking to external sites.

Can any of you share the error messages, to refresh my memory?

I was hoping to use the following info to see if you were using a
version of Guix that preceded a bug fix, but now I can't tell. I do
think your bug has been fixed recently, and that `guix pull && sudo guix
system reconfigure ...` will fix your problem, but I wanted to be sure.

Here are some general observations and advice:

On Sun, Mar 21, 2021 at 09:27:12AM +0100, Sergiu Ivanov wrote:
> Thus quoth  Leo Famulari  on Sat Mar 20 2021 at 23:10 (+0100):
> > $ guix describe
> 
> Generation 5    Mar 16 2021 10:31:09    (current)
>   [blurred]
>   guix db87d6d
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: db87d6ddafd26c5ad657178cf7fdab524d05c522

Okay. This is a recent version of Guix.

> > $ sudo --login guix describe
> 
> Generation 1	Feb 02 2021 10:36:19	(current)
>   [blurred]
>   guix 625708b
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: 625708b03a37fc2a33c437b8e27856ca76965f43

This is probably the Guix at '/root/.config/guix/current/bin/guix'. That
is the root user's Guix command, created and updated with `guix pull` as
root. It's from early February.

>   $ sudo su
>   $ guix describe
> 
> which gave me
> 
>     guix c8887a5
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: c8887a5c6e8f6a19d54ffa428c6fe88a797b867a

This is probably the system's Guix command, at
'/run/current-system/profile/bin/guix'. It's recent.

Based on this, I guess you are updating the system by `guix pull` as
your regular user and then `sudo guix system reconfigure ...`. Is that
correct?

The different results between those two sudo commands shows an important
and confusing issue with privilege elevation on Linux:

There is a difference between plain `sudo` and `sudo --login`.

`su` is an entirely different command, and it also does something
different than `su --login`.

Basically, plain `sudo` and `su` put the user into an incomplete and
typically unexpected environment, as compared to using the "--login"
options. One could say they turn you into "nobody", but with privileges.

In general, I recommend to learn the difference between them and use
them accordingly.

On old-school distros, there is not usually a big problem, but on Guix
it really matters, because we use the login shell initialization to
export some environment variables, and the resulting environment is what
provides the per-user view of installed packages. 

So, if you don't login when elevating privileges, you get a weird
environment and your view of Guix will be unexpected. As you noticed,
the environment you got from `sudo su` lacked any user's packages or
channels.

> I think I did guix pull as root once at the beginning of the
> installation of this machine 3 months ago.  I ran sudo guix pull
> a couple of times, before I managed to remember that guix pull should be
> run as normal user (I think?).

`guix pull` should be run as any user that you use. So, if you ever use
the root user, we highly recommend you update root's packages sometimes,
too. If you never login as root, and do not run any programs as root,
then it doesn't matter very much.

> The blurred parts of the output are due to the fact that Linux Libre
> does not detect all my devices.
> 
> By the way, please tell me if there is anything inappropriate in my
> message: I'm still not sure how to talk about certain things, as you can
> see :-)

No worries :) I don't think those other channels are relevant to your
problem.


  reply	other threads:[~2021-03-22  0:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20 17:14 cannot "guix pull" Adam Kandur via
2021-03-20 17:47 ` Andreas Enge
2021-03-20 19:00   ` Patricio Martínez
2021-03-20 20:37     ` Sergiu Ivanov
2021-03-20 22:10       ` Leo Famulari
2021-03-21  8:27         ` Sergiu Ivanov
2021-03-22  0:11           ` Leo Famulari [this message]
2021-03-22 20:03             ` Sergiu Ivanov
2021-03-22  2:02         ` Adam Kandur via

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YFfgr1MiJyy3yNP4@jasmine.lan \
    --to=leo@famulari.name \
    --cc=help-guix@gnu.org \
    --cc=rndd@tuta.io \
    --cc=sivanov@colimite.fr \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).