1. dpkg: 错误: 无法访问归档 “code_1.84.2-1699528352_amd64.deb”:没有那个文件或目录。
解决方案:下载deb文档,选中文件,并拖入命令行中
2. 无法打开终端,显示错误:创建此终端的子进程时出错(错误原因:删除了 /bin/bash 软链接后造成的)
附带影响:虚拟机重启后,在登入界面循环,无法登入。
解决方案:暂时未知,可能要重新安装系统吧。
3. sudo apt install xxx 后,出现:Failed to fetch,错误。
解决方案:将etc/sources.list 中的源注释掉,更改为清华镜像源或者阿里镜像源。
# 注释上方下载源,使用清华镜像源
# https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
再更新一下,是新设置的镜像源生效。
sudo apt-get update
sudo apt-get upgrade
添加程序编译编译环境:
sudo apt-get install build-essential
4. 某文件没有权限:permission denied
开通最高权限:
sudo chmod -R 777 cfd_linux_1208/
5. 显示没有公钥,NO PUBLIC KEY
Ubuntu 设置 SSH 通过密钥登录_ubuntu密钥登录-优快云博客
6、 Failed to configure test project build system.
这个问题一般是在build文件夹下多次构建项目时的报错。
只需要用命令 rm -rf * 删除build文件夹下的所有文件,然后重新cmake 构建即可。
7、Could not find the trilinos library!
If the library is not at a default location, either provide some hints for
autodetection,
$ TRILINOS_DIR="..." cmake <...>
$ cmake -DTRILINOS_DIR="..." <...>
8、安装软件、库等操作时:
在Cmake 构建时不使用该命令设置安装位置,cmake_install_prefix="path\to\xxx" ,则表面安装在Linux系统中,即默认的usr\local 中。
在安装时:使用命令:sudo cmake install ,而不是 make install .
9、在编译Github开源项目时,
报错显示如下:fatal error: mpi.h: No such file or directory
/usr/include/hypre/HYPRE_utilities.h:20:10: fatal error: mpi.h: No such file or directory。
我成功安装并测试了MPI都没有问题,但是编译时仍然出现该错误。
最后解决方法:
1、使用mpicc -showme:incdirs
该命令将显示安装目录以及头文件位置
如上,头文件位置在:/usr/lib/x86_64-linux-gnu/openmpi/include
我们把该头文件位置放到开源项目的CMakeLists.txt中
具体形式如下
重新配置编译后即可消除错误