nRF Connect SDKのインストールが途中で止まった場合に再開する方法

例えばこんな感じでエラーが発生したとすると

<details><summary>エラーログ</summary>

```
[west]: === Initializing in /home/tyano/ncs/v2.9.1
[west]: --- Cloning manifest repository from https://github.com/nrfconnect/sdk-nrf
[west]: Cloning into '/home/tyano/ncs/v2.9.1/.west/manifest-tmp'...
[west]: --- setting manifest.path to nrf
[west]: === Initialized. Now run "west update" inside /home/tyano/ncs/v2.9.1.

[west]: exited with code 0.


[west]: updating /home/tyano/ncs/v2.9.1...

[west]: === updating zephyr (zephyr):
[west]: --- zephyr: initializing
[west]: Initialized empty Git repository in /home/tyano/ncs/v2.9.1/zephyr/.git/
[west]: --- zephyr: fetching, need revision v3.7.99-ncs2-1
[west]: From https://github.com/nrfconnect/sdk-zephyr
[west]:  * tag                       v3.7.99-ncs2-1            -> FETCH_HEAD
[west]:  * [new tag]                 v1.13.99-ncs1             -> v1.13.99-ncs1
[west]:  * [new tag]                 v1.13.99-ncs1-rc1         -> v1.13.99-ncs1-rc1
[west]:  * [new tag]                 v1.13.99-ncs2             -> v1.13.99-ncs2
[west]:  * [new tag]                 v1.13.99-ncs2-rc1         -> v1.13.99-ncs2-rc1
[west]:  * [new tag]                 v1.13.99-ncs2-rc2         -> v1.13.99-ncs2-rc2
[west]:  * [new tag]                 v1.14.99-ncs1             -> v1.14.99-ncs1
[west]:  * [new tag]                 v1.14.99-ncs1-rc1         -> v1.14.99-ncs1-rc1
[west]:  * [new tag]                 v1.14.99-ncs1-rc2         -> v1.14.99-ncs1-rc2
[west]:  * [new tag]                 v1.14.99-ncs2             -> v1.14.99-ncs2
[west]:  * [new tag]                 v1.14.99-ncs2-rc1         -> v1.14.99-ncs2-rc1
[west]:  * [new tag]                 v1.14.99-ncs2-rc2         -> v1.14.99-ncs2-rc2
[west]:  * [new tag]                 v1.14.99-ncs2-rc3         -> v1.14.99-ncs2-rc3
[west]:  * [new tag]                 v1.14.99-ncs2-rc4         -> v1.14.99-ncs2-rc4
[west]:  * [new tag]                 v1.14.99-ncs3-snapshot1   -> v1.14.99-ncs3-snapshot1
[west]:  * [new tag]                 v1.14.99-ncs3-snapshot2   -> v1.14.99-ncs3-snapshot2
[west]:  * [new tag]                 v2.0.99-ncs1              -> v2.0.99-ncs1
[west]:  * [new tag]                 v2.0.99-ncs1-rc1          -> v2.0.99-ncs1-rc1
[west]:  * [new tag]                 v2.0.99-ncs1-rc2          -> v2.0.99-ncs1-rc2
[west]:  * [new tag]                 v2.0.99-ncs1-rc3          -> v2.0.99-ncs1-rc3
[west]:  * [new tag]                 v2.0.99-ncs1-snapshot1    -> v2.0.99-ncs1-snapshot1
[west]:  * [new tag]                 v2.1.0-ncs1-snapshot1     -> v2.1.0-ncs1-snapshot1
[west]:  * [new tag]                 v2.1.99-ncs1              -> v2.1.99-ncs1
[west]:  * [new tag]                 v2.1.99-ncs1-rc1          -> v2.1.99-ncs1-rc1
[west]:  * [new tag]                 v2.1.99-ncs1-rc2          -> v2.1.99-ncs1-rc2
[west]:  * [new tag]                 v2.1.99-ncs1-snapshot1    -> v2.1.99-ncs1-snapshot1
[west]:  * [new tag]                 v2.3.0-rc1-ncs1           -> v2.3.0-rc1-ncs1
[west]:  * [new tag]                 v2.3.0-rc1-ncs1-rc1       -> v2.3.0-rc1-ncs1-rc1
[west]:  * [new tag]                 v2.3.0-rc1-ncs1-rc2       -> v2.3.0-rc1-ncs1-rc2
[west]:  * [new tag]                 v2.3.0-rc1-ncs1-rc3       -> v2.3.0-rc1-ncs1-rc3
[west]:  * [new tag]                 v2.3.0-rc1-ncs1-snapshot1 -> v2.3.0-rc1-ncs1-snapshot1
[west]:  * [new tag]                 v2.3.0-rc1-ncs2           -> v2.3.0-rc1-ncs2
[west]:  * [new tag]                 v2.3.0-rc1-ncs3           -> v2.3.0-rc1-ncs3
[west]:  * [new tag]                 v2.4.0-ncs1               -> v2.4.0-ncs1
[west]:  * [new tag]                 v2.4.0-ncs1-rc1           -> v2.4.0-ncs1-rc1
[west]:  * [new tag]                 v2.4.0-ncs1-rc2           -> v2.4.0-ncs1-rc2
[west]:  * [new tag]                 v2.4.0-ncs1-snapshot1     -> v2.4.0-ncs1-snapshot1
[west]:  * [new tag]                 v2.4.0-ncs2               -> v2.4.0-ncs2
[west]:  * [new tag]                 v2.4.0-ncs2-rc1           -> v2.4.0-ncs2-rc1
[west]:  * [new tag]                 v2.4.99-ncs1              -> v2.4.99-ncs1
[west]:  * [new tag]                 v2.4.99-ncs1-rc1          -> v2.4.99-ncs1-rc1
[west]:  * [new tag]                 v2.4.99-ncs1-snapshot1    -> v2.4.99-ncs1-snapshot1
[west]:  * [new tag]                 v2.4.99-ncs2              -> v2.4.99-ncs2
[west]:  * [new tag]                 v2.4.99-ncs2-1            -> v2.4.99-ncs2-1
[west]:  * [new tag]                 v2.4.99-ncs2-rc1          -> v2.4.99-ncs2-rc1
[west]:  * [new tag]                 v2.6.0-ncs1-rc3           -> v2.6.0-ncs1-rc3
[west]:  * [new tag]                 v2.6.0-rc1-ncs1           -> v2.6.0-rc1-ncs1
[west]:  * [new tag]                 v2.6.0-rc1-ncs1-rc1       -> v2.6.0-rc1-ncs1-rc1
[west]:  * [new tag]                 v2.6.0-rc1-ncs1-snapshot1 -> v2.6.0-rc1-ncs1-snapshot1
[west]:  * [new tag]                 v2.6.99-ncs1              -> v2.6.99-ncs1
[west]:  * [new tag]                 v2.6.99-ncs1-1            -> v2.6.99-ncs1-1
[west]:  * [new tag]                 v2.6.99-ncs1-rc1          -> v2.6.99-ncs1-rc1
[west]:  * [new tag]                 v2.6.99-ncs1-rc2          -> v2.6.99-ncs1-rc2
[west]:  * [new tag]                 v2.6.99-ncs1-snapshot1    -> v2.6.99-ncs1-snapshot1
[west]:  * [new tag]                 v2.7.0-ncs1               -> v2.7.0-ncs1
[west]:  * [new tag]                 v2.7.0-ncs1-rc1           -> v2.7.0-ncs1-rc1
[west]:  * [new tag]                 v2.7.0-ncs1-rc2           -> v2.7.0-ncs1-rc2
[west]:  * [new tag]                 v2.7.0-ncs1-snapshot1     -> v2.7.0-ncs1-snapshot1
[west]:  * [new tag]                 v2.7.0-ncs1-snapshot2     -> v2.7.0-ncs1-snapshot2
[west]:  * [new tag]                 v2.7.99-ncs1              -> v2.7.99-ncs1
[west]:  * [new tag]                 v2.7.99-ncs1-1            -> v2.7.99-ncs1-1
[west]:  * [new tag]                 v2.7.99-ncs1-rc1          -> v2.7.99-ncs1-rc1
[west]:  * [new tag]                 v2.7.99-ncs1-rc2          -> v2.7.99-ncs1-rc2
[west]:  * [new tag]                 v3.0.99-ncs1              -> v3.0.99-ncs1
[west]:  * [new tag]                 v3.0.99-ncs1-1            -> v3.0.99-ncs1-1
[west]:  * [new tag]                 v3.0.99-ncs1-rc1          -> v3.0.99-ncs1-rc1
[west]:  * [new tag]                 v3.0.99-ncs1-rc2          -> v3.0.99-ncs1-rc2
[west]:  * [new tag]                 v3.0.99-ncs1-snapshot1    -> v3.0.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.1.99-ncs1              -> v3.1.99-ncs1
[west]:  * [new tag]                 v3.1.99-ncs1-1            -> v3.1.99-ncs1-1
[west]:  * [new tag]                 v3.1.99-ncs1-2            -> v3.1.99-ncs1-2
[west]:  * [new tag]                 v3.1.99-ncs1-3            -> v3.1.99-ncs1-3
[west]:  * [new tag]                 v3.1.99-ncs1-rc1          -> v3.1.99-ncs1-rc1
[west]:  * [new tag]                 v3.1.99-ncs1-rc2          -> v3.1.99-ncs1-rc2
[west]:  * [new tag]                 v3.1.99-ncs1-snapshot1    -> v3.1.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.2.99-ncs1              -> v3.2.99-ncs1
[west]:  * [new tag]                 v3.2.99-ncs1-rc1          -> v3.2.99-ncs1-rc1
[west]:  * [new tag]                 v3.2.99-ncs1-rc2          -> v3.2.99-ncs1-rc2
[west]:  * [new tag]                 v3.2.99-ncs1-snapshot1    -> v3.2.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.2.99-ncs2              -> v3.2.99-ncs2
[west]:  * [new tag]                 v3.2.99-ncs2-rc1          -> v3.2.99-ncs2-rc1
[west]:  * [new tag]                 v3.2.99-ncs2-rc2          -> v3.2.99-ncs2-rc2
[west]:  * [new tag]                 v3.2.99-ncs2-snapshot1    -> v3.2.99-ncs2-snapshot1
[west]:  * [new tag]                 v3.3.99-ncs1              -> v3.3.99-ncs1
[west]:  * [new tag]                 v3.3.99-ncs1-1            -> v3.3.99-ncs1-1
[west]:  * [new tag]                 v3.3.99-ncs1-2            -> v3.3.99-ncs1-2
[west]:  * [new tag]                 v3.3.99-ncs1-3            -> v3.3.99-ncs1-3
[west]:  * [new tag]                 v3.3.99-ncs1-rc1          -> v3.3.99-ncs1-rc1
[west]:  * [new tag]                 v3.3.99-ncs1-rc2          -> v3.3.99-ncs1-rc2
[west]:  * [new tag]                 v3.3.99-ncs1-snapshot1    -> v3.3.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.4.99-ncs1              -> v3.4.99-ncs1
[west]:  * [new tag]                 v3.4.99-ncs1-1            -> v3.4.99-ncs1-1
[west]:  * [new tag]                 v3.4.99-ncs1-1-rc1        -> v3.4.99-ncs1-1-rc1
[west]:  * [new tag]                 v3.4.99-ncs1-2            -> v3.4.99-ncs1-2
[west]:  * [new tag]                 v3.4.99-ncs1-3            -> v3.4.99-ncs1-3
[west]:  * [new tag]                 v3.4.99-ncs1-rc1          -> v3.4.99-ncs1-rc1
[west]:  * [new tag]                 v3.4.99-ncs1-rc2          -> v3.4.99-ncs1-rc2
[west]:  * [new tag]                 v3.4.99-ncs1-snapshot1    -> v3.4.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.5.99-ncs1              -> v3.5.99-ncs1
[west]:  * [new tag]                 v3.5.99-ncs1-1            -> v3.5.99-ncs1-1
[west]:  * [new tag]                 v3.5.99-ncs1-2            -> v3.5.99-ncs1-2
[west]:  * [new tag]                 v3.5.99-ncs1-3            -> v3.5.99-ncs1-3
[west]:  * [new tag]                 v3.5.99-ncs1-4            -> v3.5.99-ncs1-4
[west]:  * [new tag]                 v3.5.99-ncs1-rc1          -> v3.5.99-ncs1-rc1
[west]:  * [new tag]                 v3.5.99-ncs1-rc2          -> v3.5.99-ncs1-rc2
[west]:  * [new tag]                 v3.5.99-ncs1-snapshot1    -> v3.5.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.6.99-ncs2              -> v3.6.99-ncs2
[west]:  * [new tag]                 v3.6.99-ncs2-rc1          -> v3.6.99-ncs2-rc1
[west]:  * [new tag]                 v3.6.99-ncs2-rc2          -> v3.6.99-ncs2-rc2
[west]:  * [new tag]                 v3.6.99-ncs2-rc3          -> v3.6.99-ncs2-rc3
[west]:  * [new tag]                 v3.6.99-ncs2-snapshot1    -> v3.6.99-ncs2-snapshot1
[west]:  * [new tag]                 v3.7.99-ncs1              -> v3.7.99-ncs1
[west]:  * [new tag]                 v3.7.99-ncs1-rc1          -> v3.7.99-ncs1-rc1
[west]:  * [new tag]                 v3.7.99-ncs1-rc2          -> v3.7.99-ncs1-rc2
[west]:  * [new tag]                 v3.7.99-ncs1-snapshot1    -> v3.7.99-ncs1-snapshot1
[west]:  * [new tag]                 v3.7.99-ncs1-snapshot2    -> v3.7.99-ncs1-snapshot2
[west]:  * [new tag]                 v3.7.99-ncs2              -> v3.7.99-ncs2
[west]:  * [new tag]                 v3.7.99-ncs2-1            -> v3.7.99-ncs2-1
[west]:  * [new tag]                 v3.7.99-ncs2-rc1          -> v3.7.99-ncs2-rc1
[west]:  * [new tag]                 v3.7.99-ncs2-rc2          -> v3.7.99-ncs2-rc2
[west]:  * [new tag]                 v3.7.99-ncs3              -> v3.7.99-ncs3
[west]: HEAD is now at ca954a6216c [nrf fromtree] drivers: clock_control: nrf: Add workaround for XO start anomaly
[west]: HEAD is now at ca954a6216c [nrf fromtree] drivers: clock_control: nrf: Add workaround for XO start anomaly
[west]: === updating bsim (tools/bsim):
[west]: --- bsim: initializing
[west]: Initialized empty Git repository in /home/tyano/ncs/v2.9.1/tools/bsim/.git/
[west]: --- bsim: fetching, need revision 1f242f4ed7fc141fdfcfeca8d21c6d9e801179d7
[west]: fatal: unable to access 'https://github.com/BabbleSim/bsim_west/': Could not resolve host: github.com
[west]: FATAL ERROR: command exited with status 128: fetch -f --tags -- https://github.com/BabbleSim/bsim_west 'refs/heads/*:refs/west/*'

[west]: exited with code 128.

[west]: === Initializing in /home/tyano/ncs/v2.9.1
[west]: --- Cloning manifest repository from https://github.com/nrfconnect/sdk-nrf
[west]: Cloning into '/home/tyano/ncs/v2.9.1/.west/manifest-tmp'...
[west]: --- setting manifest.path to nrf
[west]: === Initialized. Now run "west update" inside /home/tyano/ncs/v2.9.1.

[west]: exited with code 0.


[west]: updating /home/tyano/ncs/v2.9.1...

[west]: === updating zephyr (zephyr):
[west]: --- zephyr: initializing
[west]: Initialized empty Git repository in /home/tyano/ncs/v2.9.1/zephyr/.git/
[west]: --- zephyr: fetching, need revision v3.7.99-ncs2-1
[west]: error: 13798 bytes of body are still expected
[west]: fetch-pack: unexpected disconnect while reading sideband packet
[west]: fatal: early EOF
[west]: fatal: fetch-pack: invalid index-pack output
[west]: FATAL ERROR: command exited with status 128: fetch -f --tags -- https://github.com/nrfconnect/sdk-zephyr v3.7.99-ncs2-1

[west]: exited with code 128.
```

</details>

一回ディレクトリを削除して再インストールする必要がある

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3786381/296ef013-3577-4629-82b1-ade04b57027a.png)

toolchainのインストールを先にやっているはずなので
westがあれば再開出来る
`${HOME}/ncs/v2.9.1`にインストールしたとすると

`west update --narrow`で再開出来る
ただし、パスの指定をしないといけないので以下で実行する
`b77d8c1312`の部分はtoolchainのバージョンによって変わるので
インストール済みのtoolchainのバージョンに合わせて変更する

```shell
pushd ~/ncs/v2.9.1

PYTHONPATH=../toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/ \
 PATH=../toolchains/b77d8c1312/usr/local/bin:$PATH \
 LD_LIBRARY_PATH=../toolchains/b77d8c1312/usr/local/lib:$LD_LIBRARY_PATH \
 ../toolchains/b77d8c1312/usr/local/bin/west update --narrow

 PYTHONPATH=../toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/ \
  PATH=../toolchains/b77d8c1312/usr/local/bin:$PATH \
  LD_LIBRARY_PATH=../toolchains/b77d8c1312/usr/local/lib:$LD_LIBRARY_PATH \
  ../toolchains/b77d8c1312/usr/local/bin/west zephyr-export
```

`west zephyr-export` することでvscodeに認識される

![nrfsdk.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3786381/fe6e1422-9df0-406f-80c8-096b68d312a5.png)


認識されると `Open SDK Directory` が表示される

あとは`Create a new application`-> `Copy a sample`などで