Ubuntu 16.04 "A problem occurred when checking for the updates"
I'm running Ubuntu 16.04 and all of a sudden, APT is broken and I can't open a terminal. More specifically, I'm getting the red circle with a white minus sign in the toolbar at the top and when I click on it, it says A problem occurred when checking for the updates
. When I click on Terminal, the mouse pointer changes to a circle for a few seconds and nothing happens.
I realize this has been asked many times, but I have tried a few of the other solutions (e.g. running apt-get -f install, apt-get update, apt-get upgrade, commenting out PPA's in sources.list).
Here is the contents of my sources.list
# deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution. deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team. deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://us.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://us.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://us.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-src http://us.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-src 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
I also have PPA's under /etc/apt/sources.list.d:
- dropbox.list
- gerardpuig-ubuntu-ppa-xenial.list
- atlassian-hipchat4.list
- jonathonf-ubuntu-python-3_6-xenial.list
- libreoffice-ubuntu-ppa-xenial.list
- pgdg.list
I also noticed that even though I ran update/upgrade/dist-upgrade and rebooted, when I log into TTY1, it still says I have 94 packages to upgrade.
The only thing I was doing prior to this was working with some python code. I don't think I made any changes though. I did change the default Python symlink to point to Python2, but I switched it back to Python3 and unfortunately that did not fix anything.
Thanks.
Solution 1:
To alternate between python 3.X version just run:
sudo update-alternatives --config python3
To restore software updates just type the number of python 3.5.
Solution 2:
Turns out, at some point after installing python3, I switched the /usr/bin/python3 symlink to point to python3.6 instead of the default python3.5 runtime.
Resetting the symlink to point to /usr/bin/python3.5 fixed everything.
Solution 3:
to be precise, in my case helped: open Terminal (or UXTerm or Xterm if Terminal doesn't work) and type two commands:
sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.5 /usr/bin/python3