$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 450.102.04 Tue Dec 29 06:51:23 UTC 2020
GCC version: gcc version 7.5.0 (Ubuntu 7.5.0-6ubuntu2)
$ pkg-config --modversion opencv
2.4.9.1
例如:清华源 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
换源之后可能的问题:
root@9ff72f3b6504:/etc/apt# apt-get update
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
Ign:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease
Ign:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease
Ign:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease
Err:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic Release
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Err:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates Release
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Err:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports Release
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Err:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security Release
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Reading package lists... Done
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-updates/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-backports/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-security/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@9ff72f3b6504:/etc/apt# apt install ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ca-certificates is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ca-certificates' has no installation candidate
解决方案:
默认的源是http的,但替换用的镜像源是https,所以休要额外的安装关于HTTPS的包。
apt install apt-transport-https
apt install ca-certificates
apt update
参考:https://www.caorui.net/blog/103683375281209344.html
如果没有装PPA,则会无法使用,会出现这样的错误。
root@9ff72f3b6504:/# add-apt-repository
bash: add-apt-repository: command not found
解决方案:
apt-get install software-properties-common
解决方法:
sudo apt-get install ubuntu-drivers-common
若安装后再次报错,如下:
root@9ff72f3b6504:/# ubuntu-drivers devices
Traceback (most recent call last):
File "/usr/bin/ubuntu-drivers", line 480, in
greet()
File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 676, in main
_verify_python3_env()
File "/usr/lib/python3/dist-packages/click/_unicodefun.py", line 118, in _verify_python3_env
'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps.
This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
解决方案:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
安装opencv报错
Traceback (most recent call last):
File "" , line 1, in <module>
File "/tmp/pip-build-nWnHUR/opencv-python/setup.py", line 9, in <module>
import skbuild
ImportError: No module named skbuild
解决方案:
pip install opencv-python==4.1.1.26 -i https://pypi.tuna.tsinghua.edu.cn/simple
运行代码,错误:
File "/usr/local/lib/python2.7/dist-packages/skimage/util/__init__.py", line 7, in <module>
from .arraycrop import crop
File "/usr/local/lib/python2.7/dist-packages/skimage/util/arraycrop.py", line 8, in <module>
from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name _validate_lengths
numpy版本太高,我对numpy进行了重新安装:
pip install numpy==1.15.0
参考:ImportError: cannot import name ‘_validate_lengths’
在使用apt-get update
时,出现如图错误。
解决方案:
rm /var/lib/apt/lists/lock
参考:在Ubuntu下解决E: 无法对目录 /var/lib/apt/lists/ 加锁的问题
在使用apt-get update
指令时,卡在了Waiting for headers不动。
解决方案:
rm /var/lib/apt/lists/*
rm /var/lib/apt/lists/partial/*
apt-get update
参考:apt-get update时卡在 waiting for headers
安装tensorflow或caffe过程中,会安装bazel. 该处因为PPA key expired
.
解决方案:
sudo apt install apt-transport-https curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
参考:https://docs.bazel.build/versions/master/install-ubuntu.html#install-on-ubuntu
%0D
编码修改文件格式,vim
打开设置如下
:set ff=unix
解决方案参考:https://www.jianshu.com/p/fe8ec5f5792d