安装了一天,一把辛酸泪
Ctrl+Alt+T
打开命令窗,然后输入如下命令
sudo apt-get install -y software-properties-common && \
# add-apt-repository ppa:ubuntugis/ppa && \
sudo apt-get update && \
sudo apt-get install -y gdal-bin && \
sudo apt-get install -y libgdal-dev && \
export CPLUS_INCLUDE_PATH=/usr/include/gdal && \
export C_INCLUDE_PATH=/usr/include/gdal && \
pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com GDAL==$(gdal-config --version)
遇到的问题
- Connection failed [IP: 91.189.91.39 80]
解决办法:需要修改国内更新源,这个文件在/etc/apt 下
那么,如今进入并修改呢?
cd /etc/apt # 进入文件夹下
ls -l # 查看文件夹下所有文件
sudo cp sources.list sources.list_backup # 备份源文件
sudo gedit sources.list # 以root身份打开文件,文件才能保存,否则以只读方式打开
添加的内容如下
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
保存成功后,需要运行sudo apt-get update
进行更新
如果换源还是无法解决问题,可以参考文档4
进行服务器更新,可能就好了。更新之前可能需要将之前改的sources.list还原,否则可能会更新失败
参考文档
1. Ubuntu安装东西报错Connection failed [IP: 91.189.88.152 80]
2. Ubuntu 6.04修改source.list
3. ubuntu中安装GDAL
4. 404 Not Found [IP: 91.189.91.39 80] 解决办法:换源,还是换源 !!