[Nix-dev] NixOS rebuild error: can't install grub

James Cook james.cook at utoronto.ca
Tue Mar 18 04:51:00 CET 2014


Hi Anderson (cc list for web-search-ability),

I looked at /nix/store/g0hwyp1ip5q399hppgb8mzpxfy6fhq7f-install-grub.pl
line 213 (the same file exists on my system).  It looks like that
error would be caused if you have any profile
(/nix/var/nix/profiles/system-###-link) which are abnormal.  So see if
any of your profiles are missing the file "nixos-version" -- e.g. if
the following command produces any output, then some of your profiles
are missing it*.

  for i in $(echo /nix/var/nix/profiles/system-*-link); do test -f
$i/nixos-version || echo missing in $i; done

If some profiles are missing that file, and you don't need them,
consider deleting those or just moving them somewhere else if you
don't want to lose them (but then the next garbage collection will get
them if you move them).

James


*Even if some are missing nixos-version, they ought to still work as
long as another complicated test works (I'm continuing to read after
line 213). The complicated test is: there should be a file called
kernel, and if you ls -l that file to see which directory it really
lies in, e.g:
    $ ls -l system-272-link/kernel
    lrwxrwxrwx 3 root nixbld 64 Dec 31  1969 system-272-link/kernel ->
/nix/store/0bp0h8m0zh2dnv9s8j9fdmagpjxwb9lw-linux-3.13.3/bzImage
then you should see a directory under lib/modules there, e.g. in my case,
    $ ls /nix/store/0bp0h8m0zh2dnv9s8j9fdmagpjxwb9lw-linux-3.13.3/lib/modules
    3.13.3

On 17 March 2014 19:45, Anderson Torres <torres.anderson.85 at gmail.com> wrote:
> 1 - I am updating the channels now, and I will try again later - I am very
> busy in real life now!
> 1a - My internet connection is slow. Maybe tomorrow I can post some
> progress...
>
> 2 - Just for the case, I will post my configuration files - I use a modular
> approach:
>
(link removed in case it was just for me)
>
> 2014-03-17 2:41 GMT-03:00 James Cook <james.cook at utoronto.ca>:
>
>> On 16 March 2014 18:43, Anderson Torres <torres.anderson.85 at gmail.com>
>> wrote:
>> > Hello!
>> >
>> > I am with a problem here: NixOS refuses to update the system with a GRUB
>> > error:
>> >
>> >
>> > root at janis-nixos ~ # nixos-rebuild switch
>> >
>> > building Nix...
>> > building the system configuration...
>> > updating GRUB 2 menu...
>> > Use of uninitialized value $_[0] in substitution (s///) at
>> >
>> > /nix/store/z1krxp2hwph8fypchf2b0ssnyp6z8k9l-perl-5.16.3/lib/perl5/5.16.3/File/Basename.pm
>> > line 341.
>> > fileparse(): need a valid pathname at
>> > /nix/store/g0hwyp1ip5q399hppgb8mzpxfy6fhq7f-install-grub.pl line 213.
>> >
>> > Can someone help me?
>>
>> I don't have any ideas, but can you post a minimal configuration.nix
>> that reproduces the problem, and which revision of nixpkgs you're at
>> (or when you last ran nix-changel --update)?
>>
>> James
>
>


More information about the nix-dev mailing list