1

I know that this problem is talked about on ask ubuntu many times but I still failed to solve it with the solutions I have met.

Output of sudo apt-get purge calibre is:

sudo: unable to resolve host ubuntu
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 click : Depends: python3-click-package (= 0.4.43+16.04.20160203-0ubuntu3) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Any other apt command will lead to "unmet dependencies" error. The methods mentioned in How do I resolve unmet dependencies after adding a PPA?: sudo apt-get -f install or sudo dpkg --configure -a or removing ppa didn't help.

My /etc/apt/sources.list is:

# deb cdrom:[Ubuntu-MATE 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main multiverse restricted  universe
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial main multiverse restricted universe #Added by   software-properties

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial main restricted
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial restricted multiverse #Added by software-properties

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-updates main restricted
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-updates universe restricted main multiverse #Added by   software-properties

## 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://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial universe
# deb-src http://hk.archive.ubuntu.com/ubuntu/ xenial universe
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-updates universe
# deb-src http://hk.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://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial multiverse
# deb-src http://hk.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-updates multiverse
# deb-src http://hk.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://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-backports main restricted universe multiverse #Added by     software-properties

## 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-src http://archive.canonical.com/ubuntu xenial partner

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-security main restricted
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-security universe restricted main multiverse #Added by  software-properties
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

My /etc/apt/sources.list.d/*:

deb http://ppa.launchpad.net/accessibility-dev/ppa/ubuntu xenial main
deb-src http://ppa.launchpad.net/accessibility-dev/ppa/ubuntu xenial main
deb http://ppa.launchpad.net/accessibility-dev/ppa/ubuntu xenial main
deb-src http://ppa.launchpad.net/accessibility-dev/ppa/ubuntu xenial main
deb http://ppa.launchpad.net/flexiondotorg/hal-flash/ubuntu xenial main
deb-src http://ppa.launchpad.net/flexiondotorg/hal-flash/ubuntu xenial main
deb http://ppa.launchpad.net/flexiondotorg/hal-flash/ubuntu xenial main
deb-src http://ppa.launchpad.net/flexiondotorg/hal-flash/ubuntu xenial main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial main
deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial main
deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial main
# deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial main
# deb http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu xenial main
# deb-src http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu xenial main
# deb http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu xenial main
# deb-src http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu xenial main
deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial main
deb-src http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial main
deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial main
deb-src http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial main
# deb http://ppa.launchpad.net/moka/daily/ubuntu xenial main
# deb-src http://ppa.launchpad.net/moka/daily/ubuntu xenial main
# deb http://ppa.launchpad.net/moka/daily/ubuntu xenial main
# deb-src http://ppa.launchpad.net/moka/daily/ubuntu xenial main
# deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_16.04/ /
# deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_16.04/ /
# deb http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /
# deb http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu xenial main
deb-src http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu xenial main
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu xenial main
deb-src http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu xenial main
# deb https://dl.ring.cx/ring-nightly/ubuntu_16.04/ ring main
# deb https://dl.ring.cx/ring-nightly/ubuntu_16.04/ ring main
# deb http://archive.ubuntukylin.com:10006/ubuntukylin trusty main
# deb http://archive.ubuntukylin.com:10006/ubuntukylin trusty main
deb http://repository.spotify.com stable non-free
deb http://repository.spotify.com stable non-free
deb http://ppa.launchpad.net/stellarium/stellarium-releases/ubuntu xenial main
deb-src http://ppa.launchpad.net/stellarium/stellarium-releases/ubuntu xenial main
deb http://ppa.launchpad.net/stellarium/stellarium-releases/ubuntu xenial main
deb-src http://ppa.launchpad.net/stellarium/stellarium-releases/ubuntu xenial main
deb http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial main
deb-src http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial main
deb http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial main
deb-src http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial main

Output of apt-cache policy python3-click-package is

python3-click-package:
  Installed: (none)
  Candidate: 0.4.43+16.04.20160203-0ubuntu2
  Version table:
     0.4.43+16.04.20160203-0ubuntu2 500
        500 http://hk.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Please anyone help me bring my ubuntu back??

lyfeng
  • 11
  • Did you try apt-get update ? What's the output of apt-cache policy python3-click-package? – Ron Jul 30 '16 at 09:10

1 Answers1

0

Check your /etc/hosts to see if you had the correct local address and private ip address (if you are not running dhcp on this system).

But if you are running dhcp, then

sudo /usr/sbin/dhclient eth0
 ## eth0 or the name of your interface

It needs to resolve itself first before the system could begin to proceed downloading. Hopefully you would have a break from this point:

sudo apt-get autoclean ## discards any saved pkgs and start off with fresh ones
sudo dkpg -r calibre
sudo dkpg -r python3-click-package
sudo apt-get remove --purge calibre
sudo apt-get remove --purge python3-click-package
sudo apt-get dist-upgrade

sudo apt-get build-dep python3-click-package
sudo apt-get install python3-click-package
sudo apt-get build-dep calbire
sudo apt-get install calbire

finally, this probably is overkill and unnecessary, but I have found that it's helpful in some situations when i have the difficulty in engingeering the system with apt-get repository, but, who knows. Besides, no harm in being "sure than sorry".

sudo dpkg --configure -a
sudo dpkg-reconfigure -a

I rarely found myself in the position in proceeding to next "last resort" but, it did serve me well every time by doing it in old-fashioned way.

sudo aptitude 

And press g to fetch the dependencies and scan for the rest of others' dependency requirements, then press u to update the system, then finally; ctrl-c (or ctrl-x ?? ) to exit aptitude and reboot.

Hopefully you will find your baby Ubuntu looking for you from this point. ;)

Faron
  • 1,398
  • 10
  • 14
  • Thank you very much for your answer. I did changed my hosts file once and forgot to restore it... Here is what I just did. I restore my hosts file, and I reboot my computer, and I sudo apt-get autoclean which is ok, and I sudo dpkg -r calibre and it seems calibre was successfully removed, and sudo dpkg -r python3-click-package told me it wasn't installed. Following apt commands gave me old results which are "The following packages have unmet dependencies". Apt is still broken. Do you need any more information that may help you understand the situation? – lyfeng Jul 31 '16 at 14:53