Problem upgrading nixos

sudo nixos-rebuild switch --upgrade
unpacking channels...
error: failed to open archive: Unrecognized archive format
(use '--show-trace' to show detailed location information)
building Nix...
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
/tmp/nixos-rebuild.9ljtSS/nix
error: failed to open archive: Unrecognized archive format
building the system configuration...
error: failed to open archive: Unrecognized archive format

[think@nixos:~]$ sudo nixos-rebuild switch --upgrade --show-trace
unpacking channels...
error:
       … while realising the context of a path

       at «string»:1:6:

            1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
             |      ^

       error: failed to open archive: Unrecognized archive format
building Nix...
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
/tmp/nixos-rebuild.lhpCjD/nix
error: failed to open archive: Unrecognized archive format
building the system configuration...
error: failed to open archive: Unrecognized archive format

This looks like the downloaded channel info is corrupted. Wait a few hours and retry.

I get too the same error

NIX_PATH=nixpkgs=nixos-23.05 release nixos-23.05.5533.70bdadeb94ff nixos-install --verbose --root /mnt/nixOs
building the configuration in /mnt/nixOs/etc/nixos/configuration.nix…
downloading ‘nixos-23.05 release nixos-23.05.5533.70bdadeb94ff’…
error: failed to open archive: Unrecognized archive format

NIX_PATH="nixpkgs=channel:nixos-23.05" nixos-install --root /mnt/nixOs resolve it