赞
踩
在给ubuntu安装python opencv库时一直报错,说部分站点无法访问到。在网上查了很多方法都没有解决。最后修改sourses.list文件解决了问题
找到sourses.list文件
在虚拟机下的etc/apt目录中
找到国内的镜像资源
也可以在清华大学的镜像网站上找到
以下是18.04版本的
# 默认注释了源码镜像以提高 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 vim /etc/apt/sources.list
将文件内容替换为镜像内容
执行更新命令
$ sudo apt-get update
更新完成后再次安装opencv,成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。