Multipass的Ubuntu20.04中libgdal-dev的安装

4 篇文章 0 订阅

1. 更新apt-get的源为国内源

自带的apt-get源,下载速度慢。最好更新为国内源。
要更新为国内源,需要编辑配置文件/etc/apt/sources.list

$ sudo vim /etc/apt/sources.list

安装的Ubuntu的版本为20.04,需要找到与版本相匹配的国内源。

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

在更新国内源时,需要注意国内源所提供的版本是否与安装的Ubuntu一致。否则会出现无法安装的问题。

root@go-gdal:~# apt-get install libgdal-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgdal-dev : Depends: libc6-dev but it is not going to be installed
               Depends: libarmadillo-dev but it is not going to be installed
               Depends: libdap-dev but it is not going to be installed
               Depends: libexpat1-dev but it is not going to be installed
               Depends: libgeotiff-dev but it is not going to be installed
               Depends: libhdf4-alt-dev but it is not going to be installed
               Depends: libhdf5-dev but it is not going to be installed
               Depends: libjpeg-dev
               Depends: libkml-dev but it is not going to be installed
               Depends: libltdl-dev but it is not going to be installed
               Depends: liblzma-dev but it is not going to be installed
               Depends: default-libmysqlclient-dev but it is not going to be installed
               Depends: libnetcdf-dev but it is not going to be installed
               Depends: libpcre3-dev but it is not going to be installed
               Depends: libpng-dev but it is not going to be installed
               Depends: libspatialite-dev but it is not going to be installed
               Depends: libsqlite3-dev but it is not going to be installed
               Depends: libtiff-dev but it is not going to be installed
               Depends: libxerces-c-dev but it is not going to be installed
               Depends: libxml2-dev but it is not going to be installed
               Depends: unixodbc-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

参考

[1] Ubuntu 20.04 阿里云镜像、国内源
[2] ubuntu使用apt安装包提示 g++ : Depends: g+±5 (>= 5.3.1-3~) but it is not going to be installed 缺少依赖包
[3] go gdal库 配置应用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值