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

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

我使用的是 Ubuntu 16.04 版。这一切始于我想测试一款名为 QGIS 的软件的预发布版。我在将其更新到新版本 (2.99) 时遇到了麻烦,它建议我卸载当前版本 (2.18),我照做了。

现在我既不能安装 2.99 版,也不能安装 2.18 版。我只想重新安装 2.18 版,因为我真的需要它。

基本上,要安装 QGIS 2.18,我使用了以下命令:

sudo apt-get update
sudo apt-get install qgis python-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:
 python-qgis : Depends: python-qscintilla2 but it is not going to be installed
 qgis-plugin-grass : Depends: grass703
E: Unable to correct problems, you have held broken packages.

我尝试grass703手动安装(包名称实际上是grass-core),但它说它已经是最新版本(7.2.1-1~xenial1)。

我也尝试使用该命令来查找保留的包dpkg --get-selections | grep hold,但没有返回任何内容。

我发现似乎存在同样的问题这里,但我尝试了唯一答案中的建议,但没有奏效。唯一的其他反馈是(在我看来,这是一种相当尖刻和无益的责骂),告诉他们卸载来自该源的所有软件包。我purge-ppa从非 ubuntu 源(-o ubuntugis,指的是ubuntugis 团队,我之前曾从中安装了一些软件包,试图使 2.99 版的 QGIS 工作。)仍然没有帮助,并且 QGIS 本身无法安装。

似乎没有sudo apt-get update办法解决这个问题,我快绝望了。有人知道我该如何解决这个问题吗?我真的需要重新安装 QGIS 才能正常工作。

这是我的内容/etc/apt/sources.list

# deb cdrom:[Xubuntu 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719)]/ xenial main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://de.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial universe
deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
deb http://qgis.org/debian xenial main
deb-src http://qgis.org/debian xenial main

#deb http://qgis.org/debian-nightly xenial main
#deb-src http://qgis.org/debian-nightly xenial main
#deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main

这是的内容sources.list.d/

-rw-r--r-- 1 root root 146 Jan  5 12:49 colingille-ubuntu-freshlight-xenial.list
-rw-r--r-- 1 root root 146 Jan  5 12:49 colingille-ubuntu-freshlight-xenial.list.save
-rw-r--r-- 1 root root 222 Jan  5 12:49 cooperjona-ubuntu-nitrotasks-xenial.list
-rw-r--r-- 1 root root 222 Jan  5 12:49 cooperjona-ubuntu-nitrotasks-xenial.list.save
-rw-r--r-- 1 root root 158 Jan  5 12:49 fyrmir-ubuntu-livewallpaper-stable-xenial.list
-rw-r--r-- 1 root root 158 Jan  5 12:49 fyrmir-ubuntu-livewallpaper-stable-xenial.list.save
-rw-r--r-- 1 root root 189 Jan  5 12:49 google-chrome.list
-rw-r--r-- 1 root root 189 Jan  5 12:49 google-chrome.list.save
-rw-r--r-- 1 root root 175 Jan  5 12:49 google-earth.list
-rw-r--r-- 1 root root 175 Jan  5 12:49 google-earth.list.save
-rw-r--r-- 1 root root 180 Jan  5 12:49 google-talkplugin.list
-rw-r--r-- 1 root root 180 Jan  5 12:49 google-talkplugin.list.save
-rw-r--r-- 1 root root 150 Jan  5 12:49 kakrueger-ubuntu-openstreetmap-xenial.list
-rw-r--r-- 1 root root 150 Jan  5 12:49 kakrueger-ubuntu-openstreetmap-xenial.list.save
-rw-r--r-- 1 root root 146 Jan  5 12:49 kubuntu-ppa-ubuntu-backports-xenial.list
-rw-r--r-- 1 root root 146 Jan  5 12:49 kubuntu-ppa-ubuntu-backports-xenial.list.save
-rw-r--r-- 1 root root  89 Jan  5 12:49 lightzone.list
-rw-r--r-- 1 root root  89 Jan  5 12:49 lightzone.list.save
-rw-r--r-- 1 root root 501 Jan  5 12:49 mysql.list
-rw-r--r-- 1 root root 500 Jan  5 12:49 mysql.list.save
-rw-r--r-- 1 root root 246 Jan  5 12:49 nathan-renniewaldock-ubuntu-qdirstat-xenial.list
-rw-r--r-- 1 root root 246 Jan  5 12:49 nathan-renniewaldock-ubuntu-qdirstat-xenial.list.save
-rw-r--r-- 1 root root 144 Jan  5 12:49 nilarimogard-ubuntu-webupd8-xenial.list
-rw-r--r-- 1 root root 144 Jan  5 12:49 nilarimogard-ubuntu-webupd8-xenial.list.save
-rw-r--r-- 1 root root 124 Jan  5 12:49 pgdg.list
-rw-r--r-- 1 root root 124 Jan  5 12:49 pgdg.list.save
-rw-r--r-- 1 root root 207 Jan  5 12:49 pipelight-ubuntu-stable-xenial.list
-rw-r--r-- 1 root root 207 Jan  5 12:49 pipelight-ubuntu-stable-xenial.list.save
-rw-r--r-- 1 root root 126 Jan  5 12:49 shutter-ubuntu-ppa-xenial.list
-rw-r--r-- 1 root root 126 Jan  5 12:49 shutter-ubuntu-ppa-xenial.list.save
-rw-r--r-- 1 root root  56 Jan  5 12:49 skype-stable.list
-rw-r--r-- 1 root root  56 Jan  5 12:49 skype-stable.list.save
-rw-r--r-- 1 root root 148 Jan  5 12:49 steam.list
-rw-r--r-- 1 root root 148 Jan  5 12:49 steam.list.save
-rw-r--r-- 1 root root 198 Jan  5 12:49 ubuntugis-ubuntu-ppa-xenial.list
-rw-r--r-- 1 root root 130 Jan  5 12:49 ubuntugis-ubuntu-ppa-xenial.list.save
-rw-r--r-- 1 root root 136 Jan  5 12:49 webupd8team-ubuntu-java-xenial.list
-rw-r--r-- 1 root root 136 Jan  5 12:49 webupd8team-ubuntu-java-xenial.list.save
-rw-r--r-- 1 root root 136 Jan  5 12:49 wine-ubuntu-wine-builds-xenial.list
-rw-r--r-- 1 root root 136 Jan  5 12:49 wine-ubuntu-wine-builds-xenial.list.save

结果aptitude search ?obsolete

i   fme-desktop-2017                                       - FME Desktop 2017.1.2 Full Installer                             
i   geoda                                                  - GeoDa Software                                                  
i   google-earth-stable                                    - Explore, search and discover the planet                         
i   hl3040cncupswrapper:i386                               - Brother CUPS Inkjet Printer Definitions                         
i   hl3040cnlpr:i386                                       - Brother lpr Inkjet Printer Definitions                          
i   projectlibre                                           - A desktop replacement for Microsoft Project                     
i   rainlendar2-lite                                       - Customizable desktop calendar                                   
i   rstudio                                                - RStudio   

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

/etc/apt/sources.list:
/etc/apt/sources.list.d/colingille-ubuntu-freshlight-xenial.list:deb http://ppa.launchpad.net/colingille/freshlight/ubuntu xenial main
/etc/apt/sources.list.d/cooperjona-ubuntu-nitrotasks-xenial.list:deb http://ppa.launchpad.net/cooperjona/nitrotasks/ubuntu xenial main
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial multiverse
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial universe
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
/etc/apt/sources.list:deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe
/etc/apt/sources.list:deb http://qgis.org/debian xenial main
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security universe
/etc/apt/sources.list:deb-src http://qgis.org/debian xenial main
/etc/apt/sources.list.d/fyrmir-ubuntu-livewallpaper-stable-xenial.list:deb http://ppa.launchpad.net/fyrmir/livewallpaper-stable/ubuntu xenial main
/etc/apt/sources.list.d/google-chrome.list:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/etc/apt/sources.list.d/google-earth.list:deb http://dl.google.com/linux/earth/deb/ stable main
/etc/apt/sources.list.d/google-talkplugin.list:deb http://dl.google.com/linux/talkplugin/deb/ stable main
/etc/apt/sources.list.d/kakrueger-ubuntu-openstreetmap-xenial.list:deb http://ppa.launchpad.net/kakrueger/openstreetmap/ubuntu xenial main
/etc/apt/sources.list.d/kubuntu-ppa-ubuntu-backports-xenial.list:deb http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial main
/etc/apt/sources.list.d/lightzone.list:deb http://download.opensuse.org/repositories/home:/ktgw0316:/LightZone/xUbuntu_15.10/ /
/etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.7
/etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-apt-config
/etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-tools
/etc/apt/sources.list.d/mysql.list:deb-src http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.7
/etc/apt/sources.list.d/nathan-renniewaldock-ubuntu-qdirstat-xenial.list:deb http://ppa.launchpad.net/nathan-renniewaldock/qdirstat/ubuntu xenial main
/etc/apt/sources.list.d/nilarimogard-ubuntu-webupd8-xenial.list:deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial main
/etc/apt/sources.list.d/pgdg.list:deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
/etc/apt/sources.list.d/pipelight-ubuntu-stable-xenial.list:deb http://ppa.launchpad.net/pipelight/stable/ubuntu xenial main
/etc/apt/sources.list.d/shutter-ubuntu-ppa-xenial.list:deb http://ppa.launchpad.net/shutter/ppa/ubuntu xenial main
/etc/apt/sources.list.d/skype-stable.list:deb [arch=amd64] https://repo.skype.com/deb stable main
/etc/apt/sources.list.d/steam.list:deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
/etc/apt/sources.list.d/steam.list:deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
/etc/apt/sources.list.d/ubuntugis-ubuntu-ppa-xenial.list:deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu xenial main
/etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list:deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
/etc/apt/sources.list.d/wine-ubuntu-wine-builds-xenial.list:deb http://ppa.launchpad.net/wine/wine-builds/ubuntu xenial main

答案1

期间聊天我们采取了以下步骤来解决这个问题:

  1. 禁用来自的过时存储库software-properties-gtk

下载.opensuse.org/...
ppa.launchpad.net/colingille/...
ppa.launchpad.net/cooperjona/...
ppa.launchpad.net/kakrueger/...

  1. 清除了两个 PPA,

    sudo ppa-purge ppa:ubuntugis/ppa
    sudo ppa-purge ppa:kubuntu-ppa/backports
    sudo apt-get install -f
    sudo dpkg --configure -a
    

第二个人提出了问题python-qscintilla2

  1. 然后使用以下命令从 qgis.org 存储库安装 QGIS

    sudo apt-get install qgis python-qgis qgis-plugin-grass
    
  2. 启动 QGIS 并使用以下工具检查系统完整性

    sudo apt-get check
    

相关内容