unofficial mirror of help-guix@gnu.org 
 help / color / Atom feed
* Repair / reinstall Guix package manager (foreign distro)
@ 2020-06-28 10:22 Zelphir Kaltstahl
  2020-06-28 17:53 ` david larsson
  2020-06-28 18:25 ` Marius Bakke
  0 siblings, 2 replies; 4+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-28 10:22 UTC (permalink / raw)
  To: help-guix

Hi Guix Users!

I would like to repair or reinstall my Guix package manager
installation, because it seems broken and nothing I tried fixes the problem.

The problem:

~~~~
xiaolong@xlx200:~/Downloads$ guix pull
Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/xiaolong/current-guix"
~~~~

It started appearing, when I once ran `guix pull` and `guix package -u`
as `root` user, to update my locales in the root profile.

Now I can only do a `guix pull` as `root` user, no longer as normal user.

I've tried deleting the symlink, thinking: "Well if the error is, that a
file exists in that place, it probably wants to write there and refuses
to overwrite. I'll delete it for you then." That results in another error:

~~~~
xiaolong@xlx200:~/Downloads$ guix pull
Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guix pull: error: Git error: failed open - '/home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/.git/FETCH_HEAD' is locked: Permission denied
~~~~

I can get it back to previous state by running `guix pull` as `root`
user again, but it does not fix the original problem then.

Now I've gone 1 step further in frustration and deleted the whole
`/var/guix/profiles/per-user/xiaolong` folder. OK, now guix does not
know about any installed packages any more and the error becomes:

~~~~
xiaolong@xlx200:~$ guix pull
guile: warning: failed to install locale
Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guix pull: error: Git error: failed open - '/home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/.git/FETCH_HEAD' is locked: Permission denied
~~~~

So I a basically giving up now and want to reinstall. I downloaded the
install script `guix-install.sh` from the website and ran it:

~~~~
xiaolong@xlx200:~/Downloads$ sudo bash guix-install.sh 

(... big GUIX logo here ...)

This script installs GNU Guix on your system

https://www.gnu.org/software/guix/
Press return to continue...
[1593338927.330]: Starting installation (So 28. Jun 12:08:47 CEST 2020)
[1593338927.333]: [ PASS ] verification of required commands completed
[1593338927.364]: [ INFO ] init system is: systemd
[1593338927.368]: [ INFO ] system is x86_64-linux
[1593338928.075]: [ PASS ] Release for your system: guix-binary-1.1.0.x86_64-linux
[1593338928.077]: [ INFO ] Downloading Guix release archive
guix-binary-1.1.0.x86_64 100%[==================================>]  70,14M  4,27MB/s    in 21s     
guix-binary-1.1.0.x86_64 100%[==================================>]     833  --.-KB/s    in 0s      
[1593338949.457]: [ PASS ] download completed.
[1593338950.341]: [ PASS ] Signature is valid.
[1593338959.807]: [ PASS ] unpacked archive
[1593338959.808]: [ FAIL ] A previous Guix installation was found.  Refusing to overwrite.
~~~~

"OK OK! I'll uninstall the previous one!"

But how do I do it exactly? Or is there a flag or anything I can give to
make it overwrite the previous installation?

Regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Repair / reinstall Guix package manager (foreign distro)
  2020-06-28 10:22 Repair / reinstall Guix package manager (foreign distro) Zelphir Kaltstahl
@ 2020-06-28 17:53 ` david larsson
  2020-06-28 18:25 ` Marius Bakke
  1 sibling, 0 replies; 4+ messages in thread
From: david larsson @ 2020-06-28 17:53 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix, Help-Guix

There has been some issues with getting the symlinks ~/.guix-profile and 
~/.config/guix/current right on a foreign distro for me and some other 
users, but Im not sure whether this is a Guix problem, or a 
misunderstanding by the users. A good explanation of guix profiles is 
here: 
https://unix.stackexchange.com/questions/561093/what-is-the-difference-between-guix-profile-and-config-guix-current 
and also make sure to read about the guix pull -p option. After that I 
think you can fix your problem by fixing the symlinks.

Reg reinstall if you wont just fix the symlinks, deleting /gnu/store and 
/var/guix, along with any profiles such as ~/.guix-profile and 
~/.config/guix/ folders I think is enough to begin a reinstall (possibly 
also /etc/guix/profiles/config.scm or similar if they exist - but not 
sure).

Having a reinstall options or similar for guix-install.sh would be nice, 
but I dont think it exists (btw. it shouldn't be too hard to check the 
bash source for this and see if it exists or not).

Best regards,
David

On 2020-06-28 10:22, Zelphir Kaltstahl wrote:
> Hi Guix Users!
> 
> I would like to repair or reinstall my Guix package manager
> installation, because it seems broken and nothing I tried fixes the 
> problem.
> 
> The problem:
> 
> ~~~~
> xiaolong@xlx200:~/Downloads$ guix pull
> Migrating profile generations to 
> '/var/guix/profiles/per-user/xiaolong'...
> guix pull: error: symlink: File exists:
> "/var/guix/profiles/per-user/xiaolong/current-guix"
> ~~~~
> 
> It started appearing, when I once ran `guix pull` and `guix package -u`
> as `root` user, to update my locales in the root profile.
> 
> Now I can only do a `guix pull` as `root` user, no longer as normal 
> user.
> 
> I've tried deleting the symlink, thinking: "Well if the error is, that 
> a
> file exists in that place, it probably wants to write there and refuses
> to overwrite. I'll delete it for you then." That results in another 
> error:
> 
> ~~~~
> xiaolong@xlx200:~/Downloads$ guix pull
> Migrating profile generations to 
> '/var/guix/profiles/per-user/xiaolong'...
> Updating channel 'guix' from Git repository at
> 'https://git.savannah.gnu.org/git/guix.git'...
> guix pull: error: Git error: failed open -
> '/home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/.git/FETCH_HEAD'
> is locked: Permission denied
> ~~~~
> 
> I can get it back to previous state by running `guix pull` as `root`
> user again, but it does not fix the original problem then.
> 
> Now I've gone 1 step further in frustration and deleted the whole
> `/var/guix/profiles/per-user/xiaolong` folder. OK, now guix does not
> know about any installed packages any more and the error becomes:
> 
> ~~~~
> xiaolong@xlx200:~$ guix pull
> guile: warning: failed to install locale
> Migrating profile generations to 
> '/var/guix/profiles/per-user/xiaolong'...
> Updating channel 'guix' from Git repository at
> 'https://git.savannah.gnu.org/git/guix.git'...
> guix pull: error: Git error: failed open -
> '/home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/.git/FETCH_HEAD'
> is locked: Permission denied
> ~~~~
> 
> So I a basically giving up now and want to reinstall. I downloaded the
> install script `guix-install.sh` from the website and ran it:
> 
> ~~~~
> xiaolong@xlx200:~/Downloads$ sudo bash guix-install.sh
> 
> (... big GUIX logo here ...)
> 
> This script installs GNU Guix on your system
> 
> https://www.gnu.org/software/guix/
> Press return to continue...
> [1593338927.330]: Starting installation (So 28. Jun 12:08:47 CEST 2020)
> [1593338927.333]: [ PASS ] verification of required commands completed
> [1593338927.364]: [ INFO ] init system is: systemd
> [1593338927.368]: [ INFO ] system is x86_64-linux
> [1593338928.075]: [ PASS ] Release for your system:
> guix-binary-1.1.0.x86_64-linux
> [1593338928.077]: [ INFO ] Downloading Guix release archive
> guix-binary-1.1.0.x86_64 100%[==================================>]
> 70,14M  4,27MB/s    in 21s
> guix-binary-1.1.0.x86_64 100%[==================================>]
> 833  --.-KB/s    in 0s
> [1593338949.457]: [ PASS ] download completed.
> [1593338950.341]: [ PASS ] Signature is valid.
> [1593338959.807]: [ PASS ] unpacked archive
> [1593338959.808]: [ FAIL ] A previous Guix installation was found.
> Refusing to overwrite.
> ~~~~
> 
> "OK OK! I'll uninstall the previous one!"
> 
> But how do I do it exactly? Or is there a flag or anything I can give 
> to
> make it overwrite the previous installation?
> 
> Regards,
> Zelphir


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Repair / reinstall Guix package manager (foreign distro)
  2020-06-28 10:22 Repair / reinstall Guix package manager (foreign distro) Zelphir Kaltstahl
  2020-06-28 17:53 ` david larsson
@ 2020-06-28 18:25 ` Marius Bakke
  2020-06-29 16:08   ` Zelphir Kaltstahl
  1 sibling, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2020-06-28 18:25 UTC (permalink / raw)
  To: Zelphir Kaltstahl, help-guix

[-- Attachment #1: Type: text/plain, Size: 3154 bytes --]

Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:

> Hi Guix Users!
>
> I would like to repair or reinstall my Guix package manager
> installation, because it seems broken and nothing I tried fixes the problem.
>
> The problem:
>
> ~~~~
> xiaolong@xlx200:~/Downloads$ guix pull
> Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
> guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/xiaolong/current-guix"
> ~~~~
>
> It started appearing, when I once ran `guix pull` and `guix package -u`
> as `root` user, to update my locales in the root profile.

This can happen if you become root by any other method than 'sudo -i' or
'su -', because the root shell will otherwise inherit variables such as
$HOME, leading to this problem.

[...]

> ~~~~
> xiaolong@xlx200:~/Downloads$ guix pull
> Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
> Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
> guix pull: error: Git error: failed open - '/home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/.git/FETCH_HEAD' is locked: Permission denied
> ~~~~

You can fix this by either deleting the directory, or

   sudo chown -R xiaolong:xiaolong /home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq

Similarly, chowning or deleting /var/guix-profiles/per-user/xiaolong is
the only way to fix the permissions issue on the profile.

[...]

> So I a basically giving up now and want to reinstall. I downloaded the
> install script `guix-install.sh` from the website and ran it:
>
> ~~~~
> xiaolong@xlx200:~/Downloads$ sudo bash guix-install.sh 
>
> (... big GUIX logo here ...)
>
> This script installs GNU Guix on your system
>
> https://www.gnu.org/software/guix/
> Press return to continue...
> [1593338927.330]: Starting installation (So 28. Jun 12:08:47 CEST 2020)
> [1593338927.333]: [ PASS ] verification of required commands completed
> [1593338927.364]: [ INFO ] init system is: systemd
> [1593338927.368]: [ INFO ] system is x86_64-linux
> [1593338928.075]: [ PASS ] Release for your system: guix-binary-1.1.0.x86_64-linux
> [1593338928.077]: [ INFO ] Downloading Guix release archive
> guix-binary-1.1.0.x86_64 100%[==================================>]  70,14M  4,27MB/s    in 21s     
> guix-binary-1.1.0.x86_64 100%[==================================>]     833  --.-KB/s    in 0s      
> [1593338949.457]: [ PASS ] download completed.
> [1593338950.341]: [ PASS ] Signature is valid.
> [1593338959.807]: [ PASS ] unpacked archive
> [1593338959.808]: [ FAIL ] A previous Guix installation was found.  Refusing to overwrite.
> ~~~~
>
> "OK OK! I'll uninstall the previous one!"
>
> But how do I do it exactly? Or is there a flag or anything I can give to
> make it overwrite the previous installation?

Reinstalling still won't fix the permissions on your
~/.cache/guix/checkouts.  But to eradicate Guix and let the script do
its thing you should 'sudo rm -rf /var/guix /gnu'.

Hope this helps!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Repair / reinstall Guix package manager (foreign distro)
  2020-06-28 18:25 ` Marius Bakke
@ 2020-06-29 16:08   ` Zelphir Kaltstahl
  0 siblings, 0 replies; 4+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-29 16:08 UTC (permalink / raw)
  To: Marius Bakke, david.larsson; +Cc: help-guix

Hi!

Thank you both for your responses!

In the end I had already begun removing everything that

find / -iname '*guix*

would give me and that was not created by me, so I went the route of
reinstallation.

However, I'll archive these e-mails and in case I ever forget the `-i`
in the sudo command again, I have the solution ready : )

Btw.: I deleted a whole lot more files than I thought I would need to. I
make a list and only after the last 2 removals, the Guix installer would
not find a previous installation any longer:

~~~~
   rm --recursive --force /gnu/store || true;
   rm --recursive --force /var/guix || true;
   rm --recursive --force ~/.guix-profile || true;
   rm --recursive --force ~/.config/guix || true;
   rm --recursive --force /etc/guix/profile/config.scm || true;
   rm --recursive --force /tmp/guix.* || true;
   rm --recursive --force /home/xiaolong/.cache/guix || true;
   rm --recursive --force /root/.cache/guix/ || true;
   rm --recursive --force /root/.cache/guile/ || true;
   rm --recursive --force /var/log/guix || true;
   rm --recursive --force /root/.config/guix || true;
   rm --recursive --force /etc/systemd/system/guix-daemon.service || true;
   rm --recursive --force /etc/guix || true;
   rm --recursive --force /usr/local/bin/guix || true;
   rm --recursive --force /etc/systemd/system/multi-user.target.wants/guix-daemon.service || true;
   rm --recursive --force /usr/local/share/info/guix.* || true;
   rm --recursive --force /tmp/guix.Mgm || true;
   # all of the above does not help
   # you need to do also the following
   rm --recursive --force /var/guix || true;
   rm --recursive --force /gnu || true;
~~~~

Thanks for telling me about the need to use `-i` or `su -`, I did not
know about it. I would have run into this problem again and again.

Regards,
Zelphir

On 28.06.20 20:25, Marius Bakke wrote:
> Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:
>
>> Hi Guix Users!
>>
>> I would like to repair or reinstall my Guix package manager
>> installation, because it seems broken and nothing I tried fixes the problem.
>>
>> The problem:
>>
>> ~~~~
>> xiaolong@xlx200:~/Downloads$ guix pull
>> Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
>> guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/xiaolong/current-guix"
>> ~~~~
>>
>> It started appearing, when I once ran `guix pull` and `guix package -u`
>> as `root` user, to update my locales in the root profile.
> This can happen if you become root by any other method than 'sudo -i' or
> 'su -', because the root shell will otherwise inherit variables such as
> $HOME, leading to this problem.
>
> [...]
>
>> ~~~~
>> xiaolong@xlx200:~/Downloads$ guix pull
>> Migrating profile generations to '/var/guix/profiles/per-user/xiaolong'...
>> Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
>> guix pull: error: Git error: failed open - '/home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/.git/FETCH_HEAD' is locked: Permission denied
>> ~~~~
> You can fix this by either deleting the directory, or
>
>    sudo chown -R xiaolong:xiaolong /home/xiaolong/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq
>
> Similarly, chowning or deleting /var/guix-profiles/per-user/xiaolong is
> the only way to fix the permissions issue on the profile.
>
> [...]
>
>> So I a basically giving up now and want to reinstall. I downloaded the
>> install script `guix-install.sh` from the website and ran it:
>>
>> ~~~~
>> xiaolong@xlx200:~/Downloads$ sudo bash guix-install.sh 
>>
>> (... big GUIX logo here ...)
>>
>> This script installs GNU Guix on your system
>>
>> https://www.gnu.org/software/guix/
>> Press return to continue...
>> [1593338927.330]: Starting installation (So 28. Jun 12:08:47 CEST 2020)
>> [1593338927.333]: [ PASS ] verification of required commands completed
>> [1593338927.364]: [ INFO ] init system is: systemd
>> [1593338927.368]: [ INFO ] system is x86_64-linux
>> [1593338928.075]: [ PASS ] Release for your system: guix-binary-1.1.0.x86_64-linux
>> [1593338928.077]: [ INFO ] Downloading Guix release archive
>> guix-binary-1.1.0.x86_64 100%[==================================>]  70,14M  4,27MB/s    in 21s     
>> guix-binary-1.1.0.x86_64 100%[==================================>]     833  --.-KB/s    in 0s      
>> [1593338949.457]: [ PASS ] download completed.
>> [1593338950.341]: [ PASS ] Signature is valid.
>> [1593338959.807]: [ PASS ] unpacked archive
>> [1593338959.808]: [ FAIL ] A previous Guix installation was found.  Refusing to overwrite.
>> ~~~~
>>
>> "OK OK! I'll uninstall the previous one!"
>>
>> But how do I do it exactly? Or is there a flag or anything I can give to
>> make it overwrite the previous installation?
> Reinstalling still won't fix the permissions on your
> ~/.cache/guix/checkouts.  But to eradicate Guix and let the script do
> its thing you should 'sudo rm -rf /var/guix /gnu'.
>
> Hope this helps!

-- 
repositories: https://notabug.org/ZelphirKaltstahl


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 10:22 Repair / reinstall Guix package manager (foreign distro) Zelphir Kaltstahl
2020-06-28 17:53 ` david larsson
2020-06-28 18:25 ` Marius Bakke
2020-06-29 16:08   ` Zelphir Kaltstahl

unofficial mirror of help-guix@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git