Unable to locate package libcudnn8 in Ubuntu 18.04

7,242

Certain things like the CPU drivers are preconfigured for you in Docker, but the GPU is not configured when you run a Docker container. Read How to Properly Use the GPU within a Docker Container.


There is no package named libcudnn8 in the default Ubuntu 18.04 repositories, so remove the references to libcudnn8 and prune the command as follows:

sudo apt update && rm -rf /var/lib/apt/lists/*
sudo add-apt-repository multiverse
sudo apt update  
sudo apt install nvidia-cuda-toolkit   
sudo reboot 

If you don't have the proprietary Nvidia graphics driver installed yet, please run this command sudo ubuntu-drivers autoinstall && sudo reboot before you run sudo apt install nvidia-cuda-toolkit

Share:
7,242
DDN
Author by

DDN

Updated on September 18, 2022

Comments

  • DDN
    DDN over 1 year

    When I tried to install sudo apt-get update && apt-get install -y --no-install-recommends libcudnn8=$CUDNN_VERSION-1+cuda11.0 && apt-mark hold libcudnn8 && rm -rf /var/lib/apt/lists/*, I got the error:

    Unable to locate package libcudnn8
    
  • DDN
    DDN over 3 years
    As you suggested I pruned that command, after this command all the packages are up to date. What will be the next step to install nvidia/cuda for ubuntu 18.04
  • karel
    karel over 3 years
    @DDN I added my reply to your comment to my answer.
  • karel
    karel over 3 years
    If you don't have the proprietary Nvidia graphics driver installed yet, please run this command sudo ubuntu-drivers autoinstall && sudo reboot before you run sudo apt install nvidia-cuda-toolkit
  • DDN
    DDN over 3 years
    now I got another error E: Unable to locate package nvidia-cuda-toolkit
  • karel
    karel over 3 years
    Please read my latest revision.
  • DDN
    DDN over 3 years
    Yes, I have followed the steps but still got the same error E: Unable to locate package nvidia-cuda-toolkit
  • karel
    karel over 3 years
    Please add multiverse repository which provides nvidia-cuda-toolkit .
  • DDN
    DDN over 3 years
    Dear karel, multiverse repository Ubuntu Software options were not ticked properly. Now, I have successfully installed all the packages. Thanks a lot for helping me.
  • karel
    karel over 3 years
    @DDN If this answered your question please click the gray checkmark beside this answer to mark it as accepted. The checkmark will change colors from gray to green when it is clicked.