[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cannot "guix pull"

From: Leo Famulari
Subject: Re: cannot "guix pull"
Date: Sun, 21 Mar 2021 20:11:27 -0400

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

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:
>     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:
>     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:
>     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

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

> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]