How to installl pytorch nightly version in ubuntu

I am trying to install pytorch-nightly but I met error.

My dev env is
Ubuntu 18.04.5, Conda 4.10.1 with python 3.6, CUDA :11.1.1

To install pytorch-nightly version typed as below but I met error. How can I install pytorch-nightly version. Could anyone give me the way to install torch nightly.

pip install --pre torch torchvision torchaudio torch-nightly -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html

Looking in links: https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
Requirement already satisfied: torch in /home/anthony/anaconda3/envs/rotated_maskrcnn3/lib/python3.6/site-packages (1.10.0.dev20210831+cu111)
Requirement already satisfied: torchvision in /home/anthony/anaconda3/envs/rotated_maskrcnn3/lib/python3.6/site-packages (0.11.0.dev20210831+cu111)
Requirement already satisfied: torchaudio in /home/anthony/anaconda3/envs/rotated_maskrcnn3/lib/python3.6/site-packages (0.10.0.dev20210831)
Collecting torch-nightly
  ERROR: HTTP error 403 while getting https://download.pytorch.org/whl/nightly/torch_nightly-1.2.0.dev20190731%2Bcu92-cp36-cp36m-linux_x86_64.whl (from https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html)
ERROR: Could not install requirement torch-nightly from https://download.pytorch.org/whl/nightly/torch_nightly-1.2.0.dev20190731%2Bcu92-cp36-cp36m-linux_x86_64.whl because of HTTP error 403 Client Error: Forbidden for url: https://download.pytorch.org/whl/nightly/torch_nightly-1.2.0.dev20190731%2Bcu92-cp36-cp36m-linux_x86_64.whl for URL https://download.pytorch.org/whl/nightly/torch_nightly-1.2.0.dev20190731%2Bcu92-cp36-cp36m-linux_x86_64.whl (from https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html)

Kernel infomation

cat /proc/version

Linux version 5.4.0-81-generic (buildd@lgw01-amd64-051) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #91~18.04.1-Ubuntu SMP Fri Jul 23 13:36:29 UTC 2021

nvidia graphic information

nvidia-smi

Wed Sep  1 15:57:22 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.91.03    Driver Version: 460.91.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 307...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   40C    P8    18W /  N/A |    521MiB /  7982MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1241      G   /usr/lib/xorg/Xorg                 26MiB |
|    0   N/A  N/A      2693      G   /usr/bin/gnome-shell               88MiB |
|    0   N/A  N/A      3281      G   /usr/lib/xorg/Xorg                182MiB |
|    0   N/A  N/A      3422      G   /usr/bin/gnome-shell               59MiB |
|    0   N/A  N/A      4279      G   ...b/thunderbird/thunderbird        2MiB |
|    0   N/A  N/A      4981      G   ...AAAAAAAAA= --shared-files      156MiB |
+-----------------------------------------------------------------------------+

CUDA Information

nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0

Based on the log the used install command tries to download PyTorch 1.2.0 with CUDA9.2:

HTTP error 403 while getting https://download.pytorch.org/whl/nightly/torch_nightly-1.2.0.dev20190731%2Bcu92-cp36-cp36m-linux_x86_64.whl

I’m not sure, if you need to update pip, but the command properly downloads the latest nightly in my setup (I’ve created a new virtual environment to test it):

pip install --pre torch torchvision torchaudio torch-nightly -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
Looking in links: https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
Collecting torch
  Downloading https://download.pytorch.org/whl/nightly/cu111/torch-1.10.0.dev20210831%2Bcu111-cp38-cp38-linux_x86_64.whl (2133.4 MB)