在Ubuntu 16上安装QGIS:qgis-plugin-grass:取决于:grass760但不可安装

时间:2019-05-06 18:47:23

标签: python python-3.x qgis

我正在尝试在我的Ubuntu 16上安装QGIS,但是我无法做到。

首先,我尝试卸载我的Ubuntu上的任何QGIS版本,例如herehere

在那之后,我尝试按照QGIS Documentationhere之类的其他页面来安装QGIS,但无济于事。控制台引发以下错误:

$ sudo apt-get install qgis python-qgis qgis-plugin-grass

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-qgis is already the newest version (1:3.4.4+24xenial-ubuntugis-1).
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:
 qgis-plugin-grass : Depends: grass760 but it is not installable
E: Unable to correct problems, you have held broken packages.

然后我尝试了以下solution,但是控制台引发了以下错误:

$ sudo aptitude install qgis python-qgis qgis-plugin-grass

python-qgis is already installed at the requested version (1:3.4.4+24xenial-ubuntugis-1)
python-qgis is already installed at the requested version (1:3.4.4+24xenial-ubuntugis-1)
The following NEW packages will be installed:
  libjs-leaflet{a} libqgis-app3.4.4{a} libqgisgrass7-3.4.4{a} qgis qgis-common{a} qgis-plugin-grass{b} qgis-plugin-grass-common{a} qgis-provider-grass{a} 
  qgis-providers{a} qgis-providers-common{a} 
0 packages upgraded, 10 newly installed, 0 to remove and 1 not upgraded.
Need to get 38,2 MB of archives. After unpacking 130 MB will be used.
The following packages have unmet dependencies:
 qgis-plugin-grass : Depends: grass760 which is a virtual package and is not provided by any available package.

The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     qgis-plugin-grass [Not Installed]                  

     Leave the following dependencies unresolved:         
2)     qgis recommends qgis-plugin-grass                  

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

      Install the following packages:                           
1)      libqgis-analysis3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]   
2)      libqgis-app3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]        
3)      libqgis-core3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]       
4)      libqgis-gui3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]        
5)      libqgis-native3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]     
6)      libqgis-server3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]     
7)      libqgisgrass7-3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]     
8)      libqgispython3.4.6 [3.4.6+dfsg-1~xenial1 (xenial)]      
9)      python3-qgis [3.4.6+dfsg-1~xenial1 (xenial)]            
10)     python3-qgis-common [3.4.6+dfsg-1~xenial1 (xenial)]     
11)     qgis [3.4.6+dfsg-1~xenial1 (xenial)]                    
12)     qgis-common [3.4.6+dfsg-1~xenial1 (xenial)]             
13)     qgis-plugin-grass [3.4.6+dfsg-1~xenial1 (xenial)]       
14)     qgis-plugin-grass-common [3.4.6+dfsg-1~xenial1 (xenial)]
15)     qgis-provider-grass [3.4.6+dfsg-1~xenial1 (xenial)]     
16)     qgis-providers [3.4.6+dfsg-1~xenial1 (xenial)]          
17)     qgis-providers-common [3.4.6+dfsg-1~xenial1 (xenial)]   

Accept this solution? [Y/n/q/?] Y
The following NEW packages will be installed:
  libjs-leaflet{a} libqgis-analysis3.4.6{a} libqgis-app3.4.6{a} libqgis-core3.4.6{a} libqgis-gui3.4.6{a} libqgis-native3.4.6{a} libqgis-server3.4.6{a} 
  libqgisgrass7-3.4.6{a} libqgispython3.4.6{a} python3-qgis{a} python3-qgis-common{a} qgis qgis-common{a} qgis-plugin-grass qgis-plugin-grass-common{a} 
  qgis-provider-grass{a} qgis-providers{a} qgis-providers-common{a} 
0 packages upgraded, 18 newly installed, 0 to remove and 1 not upgraded.
Need to get 70,6 MB of archives. After unpacking 236 MB will be used.
Do you want to continue? [Y/n/?] y
[...]
Preparing to unpack .../python3-qgis-common_3.4.6+dfsg-1~xenial1_all.deb ...
Unpacking python3-qgis-common (3.4.6+dfsg-1~xenial1) ...
dpkg: error processing archive /var/cache/apt/archives/python3-qgis-common_3.4.6+dfsg-1~xenial1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py', which is also in package python-qgis-common 1:3.4.4+24xenial-ubuntugis-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../python3-qgis_3.4.6+dfsg-1~xenial1_amd64.deb ...
Unpacking python3-qgis (3.4.6+dfsg-1~xenial1) ...
dpkg: error processing archive /var/cache/apt/archives/python3-qgis_3.4.6+dfsg-1~xenial1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3/dist-packages/qgis/__init__.py', which is also in package python-qgis 1:3.4.4+24xenial-ubuntugis-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
[...]
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python3-qgis-common_3.4.6+dfsg-1~xenial1_all.deb
 /var/cache/apt/archives/python3-qgis_3.4.6+dfsg-1~xenial1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package.  Trying to recover:
dpkg: dependency problems prevent configuration of qgis:
 qgis depends on python3-qgis (= 3.4.6+dfsg-1~xenial1); however:
  Package python3-qgis is not installed.

dpkg: error processing package qgis (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of qgis-plugin-grass:
 qgis-plugin-grass depends on qgis (= 3.4.6+dfsg-1~xenial1); however:
  Package qgis is not configured yet.

dpkg: error processing package qgis-plugin-grass (--configure):
 dependency problems - leaving unconfigured
[...]
Errors were encountered while processing:
 qgis
 qgis-plugin-grass

Current status: 1 (+1) broken.

现在在Ubuntu的顶部菜单上显示以下错误消息:Error: BrokenCount > 0unmet dependencies

此后,我尝试使用此solution进行修复,但是不幸的是,当我再次尝试使用sudo apt-get install qgis python-qgis qgis-plugin-grass命令时,会发生相同的错误(即qgis-plugin-grass : Depends: grass760 but it is not installable)。

然后,我尝试添加python3-qgis,但是也会发生错误:

$ sudo apt-get install python3-qgis

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libqgis-analysis3.4.6 libqgis-core3.4.6 libqgis-gui3.4.6 libqgis-native3.4.6 libqgis-server3.4.6 libqgispython3.4.6 python3-qgis-common
The following NEW packages will be installed:
  libqgis-analysis3.4.6 libqgis-core3.4.6 libqgis-gui3.4.6 libqgis-native3.4.6 libqgis-server3.4.6 libqgispython3.4.6 python3-qgis python3-qgis-common
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 31,9 MB of archives.
After this operation, 105 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial/main amd64 libqgis-core3.4.6 amd64 3.4.6+dfsg-1~xenial1 [6.071 kB]
Get:2 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial/main amd64 libqgis-analysis3.4.6 amd64 3.4.6+dfsg-1~xenial1 [2.620 kB]                            
[...]
Unpacking python3-qgis-common (3.4.6+dfsg-1~xenial1) ...
dpkg: error processing archive /var/cache/apt/archives/python3-qgis-common_3.4.6+dfsg-1~xenial1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py', which is also in package python-qgis-common 1:3.4.4+24xenial-ubuntugis-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../python3-qgis_3.4.6+dfsg-1~xenial1_amd64.deb ...
Unpacking python3-qgis (3.4.6+dfsg-1~xenial1) ...
dpkg: error processing archive /var/cache/apt/archives/python3-qgis_3.4.6+dfsg-1~xenial1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3/dist-packages/qgis/__init__.py', which is also in package python-qgis 1:3.4.4+24xenial-ubuntugis-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python3-qgis-common_3.4.6+dfsg-1~xenial1_all.deb
 /var/cache/apt/archives/python3-qgis_3.4.6+dfsg-1~xenial1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

即使存在这些错误,QGIS还是被“安装”了,但恐怕由于上述错误,这种安装将来可能会出现问题。

有人知道会发生什么吗?我该怎么做才能解决它?

谢谢。

编辑1:

当我尝试仅安装qgis-plugin-grass软件包时,我发现此软件包引发了错误。

$ sudo apt-get install qgis-plugin-grass

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:
 qgis-plugin-grass : Depends: grass760 but it is not installable
E: Unable to correct problems, you have held broken packages.

1 个答案:

答案 0 :(得分:1)

这在 Ubuntu 18 上对我有用:

sudo apt install aptitude
sudo aptitude install qgis qgis-plugin-grass