How can I update my system and applications

Hello I wanted to know how to update my NixOS system and it’s applications. Also if I update it and I have the following kernel version: 6.16.10 that might cause some issues or no?

Assuming you are doing a basic install from the NixOS Manual (and therefore not using flakes),

sudo nixos-rebuild switch --upgrade

Thank you very much, and if I use flakes. What should I do?

Oooo i search it on the web and it says that if I have a flake i should do it: sudo nix flake update?

For flakes you’d want to use:

sudo nixos-rebuild switch --flake .#[HOSTNAME]

nix flake update in the directory with your flake.nix for your config. sudo shouldn’t be necessary unless the flake.lock is owned by root.

Then rebuild as normal.

1 Like

Thank you very much, but my PyCharm and Idea keeps saying that there is an update. What can I do?

Ignore the messages and/or configure the applications not to warn you. They may be correct, but nixpkgs packages simply update on a different cadence. Sometimes nixpkgs packages will even patch this kind of version check out.

Being on a slightly older version of something isn’t a problem, as long as you don’t need a new feature and there are no security issues. Nixpkgs ensures the latter isn’t true (though if you install software from a source other than your Linux distro you should indeed be paying attention to their warnings), and you haven’t complained about a missing feature, so I assume the former isn’t true either.

If you’re asking because you’re unsure it worked, you can double check the contents of /etc/os-release after a reboot. This contains a variable called BUILD_ID.

For example in my case, it’s BUILD_ID="25.05.20251001.5b5be50". The first two numbers are the NixOS release (25.05), the third number is the date (2025-10-01) and the last is the nixpkgs commit (5b5be50). If the date roughly lines up with the date of your most recent update (not usually the exact same date, there can be up to a couple of days delay), you can be pretty sure your updates are working correctly.

You can also look at the lastModified timestamp of the nixpkgs input in your flake.lock, but this is a bit less reliable since your flake input might be specified wrong and just never update, so I suggest using /etc/os-release as a more foolproof option.

The Linux kernel has a very strict “don’t break userspace” policy. Kernel updates are very unlikely to cause any visible issues, or even changes, for you. The only exception is using a non-LTS kernel with third party kernel modules. It looks like you’re using the default, though, which is LTS on NixOS.

Generally, assuming you’re using stable, it’s unlikely that a normal update will cause any issues - not entirely impossible, but if it does it should in theory be fixed with another update not long after.

Currently updating stable won’t mean updating the Linux kernel for you anyway, though I think it will at least one more time before the next NixOS release.

When there is a new NixOS release (every 6 months, though the next release is scheduled at the end of this month/early December) you should follow a slightly different update procedure, and that will involve reading the release notes - those updates can cause issues, but the release notes should tell you about them and how to avoid them.

For flakes the procedure is mostly changing the version number in your nixpkgs input (25.05 → 25.11 this time), and looking up the most recent release notes.

Okay, thank you very much :slight_smile: if I had another question im going to let you know