我下载了 Mobaxterm 以使用 Bash shell。问题是,我无法用“cc -o file file.c”编译我的 C 文件。它向我展示了这一点:
找不到命令“cc”,但可以安装:
sudo apt install gcc
sudo apt install clang
sudo apt install pentium-builder
sudo apt install tcc
但是每当我键入这些命令时,它都会返回错误消息,例如:
Ign:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 linux-libc-dev
amd64 4.15.0-29.31
Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 linux-libc-dev
amd64 4.15.0-29.31
404 Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-29.31_amd64.deb 404 Not Found [IP: 91.189.
88.162 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
mainuser@DESKTOP-AN5KMJ2:/mnt/c/Users/LEPCDC~1/Desktop$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/