无法找到开发工具“cc”

无法找到开发工具“cc”

我尝试使用此命令安装 nvidia 文件

sudo sh NVIDIA-Linux-x86_64-450.80.02.run

并得到

ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the package 'gcc' installed.  If gcc is installed on your system, then please check that `cc` is in your PATH.

我检查了echo $PATH

/usr/bin:/bin:/usr/local/games:/usr/games:opt/openmpi/bin:/usr/local:/usr/lib:/usr/local/bin:/usr/local/lib:/usr/lib64/openmpi/lib:/usr/bin/g++:/usr/bin/gcc

答案1

在标准 20.04 系统中,cc通常是由替代系统处理的到 GNU C 编译器的符号链接(gcc):

$ ls $(which cc) -al
lrwxrwxrwx 1 root root 20 Nov 21  2018 /usr/bin/cc -> /etc/alternatives/cc

$ ls /etc/alternatives/cc -al
lrwxrwxrwx 1 root root 12 Nov 21  2018 /etc/alternatives/cc -> /usr/bin/gcc

您可能没有build-essential安装,NVIDIA 需要编译器位来实际安装和处理驱动程序。sudo apt install build-essential通过该包运行并安装 GCC 编译器等。然后.run再次从 nVidia 运行该文件。

相关内容