Unable to Install Correct TensorRT Version

I have followed the Debian installation from:

Installation Guide :: NVIDIA Deep Learning TensorRT Documentation

to install TensorRT 7.2.2 on my Ubuntu18.04 WSL2 on windows. But when I run sudo apt-get install tensorrt, it installs the newest version of TensorRT instead of TensorRT 7.2.2. The log is as follows:


I need TensorRT 7.2.2 to use TensorRT on Tensorflow, which expects libnvinfer7 and not libnvinfer8.

Alternatively, how can I let my Tensorflow TensorRT uses libnvinfer8 which is in the newest version of TensorRT 8.4.3?


If you would like to install an older version,
we recommend you to please try the Tar installation method.

Thank you.