The symlinks point to the package which I did not install

I tried to install the KDE Partition Manager in the NixOS

$ nix-env -iA nixos.partition-manager  

However, it occurred to me that there were some errors, so I decided to temporarily uninstall it.

$ nix-env -e partitionmanager  

And the system will launch the program as the OS startup.

$ ps aux | grep part   
gapry       1402  0.0  0.0 1045400 80232 ?       Sl   15:30   0:00 /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0/bin/.partitionmanager-wrapped -session 10e169786f000167091282500000013590017_1670913727_34107 -name .partitionmanager-wrapped
gapry       2907  0.0  0.0 223608  2592 pts/1    S+   15:37   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox part
$ sudo nix-store --query --roots /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0 
/proc/1402/exe -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/1402/environ -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/1402/maps -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/2383/environ -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/2400/environ -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0

For now, I have tried the following approachs

$ nix-channel --update
$ export NIXPKGS_ALLOW_UNFREE=1; nix-env -u --always
$ sudo rm /nix/var/nix/gcroots/auto/*
$ nix-collect-garbage -d
$ nix-store --optimise
$ sudo nix-collect-garbage -d
$ sudo nix-store --optimise
$ nix-store --gc --print-dead
$ sudo nix-store --delete --ignore-liveness /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0

But it doesn’t work, any idea to help me? Thanks

Are you on nixos? or just nix on some other linux distro? If on nixos, it may be running through nixos somehow, independent of what you do with nix-env.

Regardless, nix-env shouldn’t be capable of making something start automatically, afaik. It basically just puts things in PATH.

Also,

$ sudo nix-store --query --roots /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0 
/proc/1402/exe -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/1402/environ -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/1402/maps -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/2383/environ -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
/proc/2400/environ -> /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0

This suggests the only thing keeping you from deleting it with a gc is that it’s running.

2 Likes

Yes, I’m in NixOS

“This suggests the only thing keeping you from deleting it with a gc is that it’s running.”

What do you mean? It seems I miss some concepts, can you explain them to me in more detail?

That output is listing the gcroots keeping the store path from being deleted, and all of them are in /proc, so they’re generated by the dependencies of running processes, not any symlinks on the filesystem. Check ps 1402 2383 2400 and see what those processes are. It may make things clearer.

1 Like

Thank you for hits

$ ps 1402
$ kill -9 1402
$ sudo nix-store --query --roots /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
$ sudo nix-store --delete --ignore-liveness /nix/store/63ymbpcyf5l40v60lik21swz93s2m182-partitionmanager-22.04.0
$ sudo reboot now

For now, the issue is solved. Thanks you !!!