卸载了 QGIS,现在无法重新安装:qgis-plugin-grass

卸载了 QGIS,现在无法重新安装:qgis-plugin-grass

似乎与以下相同:

已卸载 QGIS,现在无法重新安装(“E:无法纠正问题,您持有损坏的软件包。”)

但我没有成功解释。

我正在使用 Ubuntu 20.04.3 LTS。我在一台计算机上使用 QGis 版本 3.16,遇到了 SRC 问题。在其他使用相同 ubuntu 但使用 QGis 3.22 的计算机上没有遇到此问题。所以我想安装 Qgis 3.22。我已经安装了 3.22,没有卸载 3.16,但出现了一些安装问题。所以我卸载了 3.16 并尝试安装 3.22,但遇到了一些问题,经过一番研究后我知道无法解决。

我已按照此教程安装 QGis: https://www.qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu

因此在此命令行之后:

sudo apt install qgis 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: grass782
E: Unable to correct problems, you have held broken packages.

我曾尝试手动安装grass782:

sudo apt install grass782

返回:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package grass782 is a virtual package provided by:
  grass-core 7.8.2-1build3 [Not candidate version]
E: Package 'grass782' has no installation candidate

我曾尝试手动安装 Grass-core:

sudo apt install grass-core

返回:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
grass-core is already the newest version (7.8.6-1~focal2).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

当我做 :

grep -v "^#" -r /etc/apt/sources.list /etc/apt/sources.list.d/*.list | sort | uniq    /etc/apt/sources.list

我得到:

etc/apt/sources.list:deb [arch=amd64] https://qgis.org/ubuntu focal main
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal main restricted
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal multiverse
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal universe
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal-updates main restricted
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal-updates multiverse
/etc/apt/sources.list:deb http://fr.archive.ubuntu.com/ubuntu/ focal-updates universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu focal-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu focal-security multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu focal-security universe
/etc/apt/sources.list.d/spotify.list:deb http://repository.spotify.com stable non-free

使用命令查找保留的包dpkg --get-selections | grep hold,它没有返回任何内容。

命令之后apt-cache policy grass782

grass782:
  Installed: (none)
  Candidate: (none)
  Version table:

命令之后apt-cache policy grass-core

grass-core:
   Installed: 7.8.6-1~focal2
   Candidate: 7.8.6-1~focal2
   Version table:
 *** 7.8.6-1~focal2 100
        100 /var/lib/dpkg/status
     7.8.2-1build3 500
        500 http://fr.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

aptitude search ?obsolete

i   atom                                                       - A hackable text editor for the 21st Century.                         
i   forticlient                                                - FortiClient, now available on Linux, is an endpoint protection applic
i A libgdal30                                                  - Geospatial Data Abstraction Library                                  
i A libgeos3.10.1                                              - Geometry engine for Geographic Information Systems - C++ Library     
i A libotbapplicationengine-7.2-1                              - ORFEO Toolbox library - OTBApplicationEngine                         
i A libotbcarto-7.2-1                                          - ORFEO Toolbox library - OTBCarto                                     
i A libotbcommandline-7.2-1                                    - ORFEO Toolbox library - OTBCommandLine                               
i A libotbcommon-7.2-1                                         - ORFEO Toolbox library - OTBCommon                                    
i A libotbcurladapters-7.2-1                                   - ORFEO Toolbox library - OTBCurlAdapters                              
i A libotbextendedfilename-7.2-1                               - ORFEO Toolbox library - OTBExtendedFileName                          
i A libotbfuzzy-7.2-1                                          - ORFEO Toolbox library - OTBFuzzy                                     
i A libotbgdaladapters-7.2-1                                   - ORFEO Toolbox library - OTBGdalAdapters                              
i A libotbice-7.2-1                                            - ORFEO Toolbox library - OTBIce                                       
i A libotbimagebase-7.2-1                                      - ORFEO Toolbox library - OTBImageBase                                 
i A libotbimageio-7.2-1                                        - ORFEO Toolbox library - OTBImageIO                                   
i A libotbimagemanipulation-7.2-1                              - ORFEO Toolbox library - OTBImageManipulation                         
i A libotbiobsq-7.2-1                                          - ORFEO Toolbox library - OTBIOBSQ                                     
i A libotbiogdal-7.2-1                                         - ORFEO Toolbox library - OTBIOGDAL                                    
i A libotbiokml-7.2-1                                          - ORFEO Toolbox library - OTBIOKML                                     
i A libotbiolum-7.2-1                                          - ORFEO Toolbox library - OTBIOLUM                                     
i A libotbiomstar-7.2-1                                        - ORFEO Toolbox library - OTBIOMSTAR                                   
i A libotbioonera-7.2-1                                        - ORFEO Toolbox library - OTBIOONERA                                   
i A libotbiorad-7.2-1                                          - ORFEO Toolbox library - OTBIORAD                                     
i A libotblearningbase-7.2-1                                   - ORFEO Toolbox library - OTBLearningBase                              
i A libotbmapla-7.2-1                                          - ORFEO Toolbox library - OTBMapla                                     
i A libotbmathparser-7.2-1                                     - ORFEO Toolbox library - OTBMathParser                                
i A libotbmathparserx-7.2-1                                    - ORFEO Toolbox library - OTBMathParserX                               
i A libotbmetadata-7.2-1                                       - ORFEO Toolbox library - OTBMetadata                                  
i A libotbmonteverdi-7.2-1                                     - ORFEO Toolbox library - OTBMonteverdi                                
i A libotbmonteverdicore-7.2-1                                 - ORFEO Toolbox library - OTBMonteverdiCore                            
i A libotbmonteverdigui-7.2-1                                  - ORFEO Toolbox library - OTBMonteverdiGUI                             
i A libotbossimadapters-7.2-1                                  - ORFEO Toolbox library - OTBOssimAdapters                             
i A libotbossimplugins-7.2-1                                   - ORFEO Toolbox library - OTBOssimPlugins                              
i A libotbpolarimetry-7.2-1                                    - ORFEO Toolbox library - OTBPolarimetry                               
i A libotbprojection-7.2-1                                     - ORFEO Toolbox library - OTBProjection                                
i A libotbqtadapters-7.2-1                                     - ORFEO Toolbox library - OTBQtAdapters                                
i A libotbqtwidget-7.2-1                                       - ORFEO Toolbox library - OTBQtWidget                                  
i A libotbsampling-7.2-1                                       - ORFEO Toolbox library - OTBSampling                                  
i A libotbsiftfast-7.2-1                                       - ORFEO Toolbox library - OTBSiftFast                                  
i A libotbstatistics-7.2-1                                     - ORFEO Toolbox library - OTBStatistics                                
i A libotbstreaming-7.2-1                                      - ORFEO Toolbox library - OTBStreaming                                 
i A libotbsupervised-7.2-1                                     - ORFEO Toolbox library - OTBSupervised                                
i A libotbtestkernel-7.2-1                                     - ORFEO Toolbox library - OTBTestKernel                                
i A libotbvectordatabase-7.2-1                                 - ORFEO Toolbox library - OTBVectorDataBase                            
i A libotbvectordataio-7.2-1                                   - ORFEO Toolbox library - OTBVectorDataIO                              
i A libotbwavelet-7.2-1                                        - ORFEO Toolbox library - OTBWavelet                                   
i A libpdal-base12                                             - Point Data Abstraction Library - libpdal_base                        
i A libpdal-plugin-e57                                         - Point Data Abstraction Library - E57 plugin                          
i A libpdal-plugin-hdf                                         - Point Data Abstraction Library - HDF plugin                          
i A libpdal-plugin-i3s                                         - Point Data Abstraction Library - I3S plugin                          
i A libpdal-util12                                             - Point Data Abstraction Library - libpdal_util                        
i A libproj22                                                  - Cartographic projection library                                      
i   rstudio                                                    - RStudio                                                              
i   zoom                                                       - Zoom Cloud Meetings

如果有人能帮助我,我将非常感激。谢谢!

正在解决...

我已经执行: sudo apt -s install --reinstall grass-core=7.8.2-1build3 -->没有错误

sudo apt install --reinstall grass-core=7.8.2-1build3 --> 好的

因此我重新启动: sudo apt install qgis qgis-plugin-grass

但 :

Aborted (core dumped)
dpkg: error processing package qgis-providers (--configure):  
   installed qgis-providers package post-installation script subprocess returned error exit status 134

dpkg: dependency problems prevent configuration of qgis:
   qgis depends on qgis-providers (= 1:3.22.2+32focal); however:
Package qgis-providers is not configured yet.
    
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 (= 1:3.22.2+32focal); however: 
   Package qgis is not configured yet.
    
dpkg: error processing package qgis-plugin-grass (--configure):  
   dependency problems - leaving unconfigured 
dpkg: dependency problems prevent configuration of python3-qgis: 
   python3-qgis depends on qgis-providers (= 1:3.22.2+32focal); however:
Package qgis-providers is not configured yet.
    
dpkg: error processing package python3-qgis (--configure):  
   dependency problems - leaving unconfigured No apport report written because the error message indicates it's a follow-up error from a previous failure.                                                                                                                   

No apport report written because the error message i ndicates it's a follow-up error from a previous failure.
                                                                
No apport report written because MaxReports has already been reached
Processing triggers for shared-mime- info (1.15-1) ... 
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... 
Processing triggers for mime-support (3.64ubuntu1) ... 
Processing triggers for hicolor-icon-theme (0.17-2) ... 
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... 
Processing triggers for libc-bin (2.31-0ubuntu9.2) ... 
Processing triggers for man-db (2.9.1-1) ... 
Errors were encountered while processing:  
qgis-providers  
qgis  
qgis-plugin-grass  
python3-qgis 
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt list --installed | grep qgis

libqgis-3d3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgis-analysis3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgis-app3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgis-core3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgis-customwidgets/now 1:3.22.2+32focal amd64 [installed,upgradable to: 1:3.22.3+32focal]
libqgis-gui3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgis-native3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgis-server3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgisgrass7-3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
libqgispython3.22.2/focal,now 1:3.22.2+32focal amd64 [installed,automatic]
otb-qgis/now 7.2.0+dfsg-1~focal3 amd64 [installed,local]
python3-qgis-common/now 1:3.22.2+32focal all [installed,upgradable to: 1:3.22.3+32focal]
python3-qgis/now 1:3.22.2+32focal amd64 [installed,upgradable to: 1:3.22.3+32focal]
qgis-common/now 1:3.22.2+32focal all [installed,upgradable to: 1:3.22.3+32focal]
qgis-plugin-grass-common/now 1:3.22.2+32focal all [installed,upgradable to: 1:3.22.3+32focal]
qgis-plugin-grass/now 1:3.22.2+32focal amd64 [installed,upgradable to: 1:3.22.3+32focal]
qgis-provider-grass/now 1:3.22.2+32focal amd64 [installed,upgradable to: 1:3.22.3+32focal]
qgis-providers-common/now 1:3.22.2+32focal all [installed,upgradable to: 1:3.22.3+32focal]
qgis-providers/now 1:3.22.2+32focal amd64 [installed,upgradable to: 1:3.22.3+32focal]
qgis/now 1:3.22.2+32focal amd64 [installed,upgradable to: 1:3.22.3+32focal]

sudo dpkg --dry-run -P $(dpkg -l | grep qgis | awk '{print $2}')

(Reading database ... 252958 files and directories currently installed.)
Would remove or purge otb-qgis (7.2.0+dfsg-1~focal3) ...
Would remove or purge qgis-plugin-grass (1:3.22.2+32focal) ...
Would remove or purge qgis-plugin-grass-common (1:3.22.2+32focal) ...
Would remove or purge qgis-provider-grass (1:3.22.2+32focal) ...
Would remove or purge libqgisgrass7-3.22.2 (1:3.22.2+32focal) ...
Would remove or purge qgis (1:3.22.2+32focal) ...
Would remove or purge qgis-common (1:3.22.2+32focal) ...
Would remove or purge libqgis-app3.22.2 (1:3.22.2+32focal) ...
Would remove or purge python3-qgis (1:3.22.2+32focal) ...
Would remove or purge python3-qgis-common (1:3.22.2+32focal) ...
Would remove or purge qgis-providers (1:3.22.2+32focal) ...
Would remove or purge qgis-providers-common (1:3.22.2+32focal) ...
Would remove or purge libqgis-3d3.22.2 (1:3.22.2+32focal) ...
Would remove or purge libqgis-analysis3.22.2 (1:3.22.2+32focal) ...
Would remove or purge libqgis-customwidgets (1:3.22.2+32focal) ...
Would remove or purge libqgis-gui3.22.2 (1:3.22.2+32focal) ...
Would remove or purge libqgis-native3.22.2 (1:3.22.2+32focal) ...
Would remove or purge libqgis-server3.22.2 (1:3.22.2+32focal) ...
Would remove or purge libqgispython3.22.2 (1:3.22.2+32focal) ...
Would remove or purge libqgis-core3.22.2 (1:3.22.2+32focal) ...

dpkg -l| egrep -v '^ii|rc'

iU  python3-qgis                               1:3.22.2+32focal                      amd64        Python bindings to QGIS
iU  qgis                                       1:3.22.2+32focal                      amd64        Geographic Information System (GIS)
iU  qgis-plugin-grass                          1:3.22.2+32focal                      amd64        GRASS plugin for QGIS
iF  qgis-providers                             1:3.22.2+32focal                      amd64        collection of data providers to QGIS

答案1

我犯了和你一样的错误。

qgis-plugin-grass:依赖:grass782 E:无法纠正问题,您持有损坏的包裹。

我已经卸载了 qgis 和 grass,并删除了损坏的软件包。然后我按照他们网站上的步骤重新安装了 qgis。但我在以下帮助下使用了不同的存储库:此评论,即:

deb [ arch=amd64 ] https://qgis.org/ubuntugis-ltr focal main

请注意,这是针对 LTR 版本 (3.16.xx)。对于您来说,您需要:

deb [ arch=amd64 ] https://qgis.org/ubuntugis focal main

因为我们遇到了同样的错误,而且这似乎解决了我的问题,我希望它也能解决你的问题!

注意:在他们网站上的步骤中,我遇到了无法添加密钥的错误。我不知道这是否与我们的问题有关,但为了确保万无一失,我还是会提一下。这这里的回答对我有帮助。

相关内容