0

I am aware that if one googles the error above, then he would get tons of results. However, after trying many of the proposed solutions, and after working on this error for about a week in full-time, it's time to seek some help.

I am using Oracle VirtualBox on my Windows 10 machine. As a guest OS I installed Ubuntu 16.04.04.

This is what I tried:

  • As mentioned here, I have

    deb https://apt.dockerproject.org/repo ubuntu-xenial main line in my sources list. How I checked that? by running

find /etc/apt/ -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

in the command line, which gives:

`/etc/apt/sources.list.d/docker.list

 1  deb https://apt.dockerproject.org/repo ubuntu-xenial main

/etc/apt/sources.list

 1  deb http://de.archive.ubuntu.com/ubuntu/ xenial main universe restricted multiverse
 2  deb-src http://de.archive.ubuntu.com/ubuntu/ xenial main universe restricted multiverse #Added by software-properties
 3  deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe restricted main multiverse
 4  deb http://security.ubuntu.com/ubuntu/ xenial-security universe restricted main multiverse
 5  deb https://packages.ubuntu.com/xenial/screen/ubuntu xenial main
 6  deb-src https://packages.ubuntu.com/xenial/screen/ubuntu xenial main
 7  deb-src https://apt.dockerproject.org/repo ubuntu-xenial main`

However, this did not resolve the error, even after sudo apt-get update which gives:

Reading package lists... Done
W: The repository 'http://de.archive.ubuntu.com/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://de.archive.ubuntu.com/ubuntu xenial-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://security.ubuntu.com/ubuntu xenial-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch https://packages.ubuntu.com/xenial/screen/ubuntu/dists/xenial/InRelease  Could not resolve host: packages.ubuntu.com
W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-xenial/InRelease  Could not resolve host: apt.dockerproject.org
E: Failed to fetch http://de.archive.ubuntu.com/ubuntu/dists/xenial/main/source/Sources  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)
E: Failed to fetch http://de.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/binary-amd64/Packages  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-amd64/Packages  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
W: Some index files failed to download. They have been ignored, or old ones used instead.
  • I should mention that when I add a new source to the list, and press "Reload" in the following pop-up

enter image description here

I get the following error even though I have a working internet for sure.

enter image description here

The E: Unable to locate package XXX error occurs whenever I want to install a new package, not only with screen.

So now when I try to install screen using sudo apt-get install screen, I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package screen

It is also import to note that I am using proxy.

Since this error already overwhelmed me, I would highly appreciate any help

  • 2
    Post the command line output of sudo apt-get update - my guess is there's some type of other issue at play with repository updates or out of date information in your repository data and it not being able to update properly. – Thomas Ward Aug 06 '18 at 13:35
  • @Thomas Ward, please check "UPDATE 1" above. – Alsharif Aug 06 '18 at 13:51
  • Why do you have so many sources - and if it's 16.04 LTS, why in one picture do you have 13.10 (Saucy) enabled - and rightly get errors for it. I'd suggest clean your sources. (13.10 was the 2013.October standard release with a life of 15 months, it's well past EOL & thus isn't in archive.ubuntu.com- hence your errors relating to your saucy.... Also EOL releases don't have country mirrors....) – guiverc Aug 06 '18 at 13:56
  • @Thomas Ward, the output of systemd-resolve --status | grep 'DNS Servers' is systemd-resolve: unrecognized option '--status' – Alsharif Aug 06 '18 at 14:07
  • Oops I didn't see 16.04. Let me dig up finding the DNS Servers in that... – Thomas Ward Aug 06 '18 at 14:08
  • 1
    159 repositories really ? II would clean up your repositories, not need use mixed repositories. See https://packages.ubuntu.com/search?keywords=screen – Panther Aug 06 '18 at 14:39
  • @Panther, as you can see in item 56 in the list above, namely 56 # deb https://packages.ubuntu.com/xenial/screen/ubuntu xenial main, I have tried your suggestion, but unfortunately it did not work. – Alsharif Aug 06 '18 at 14:46
  • 1
    Clean up your repos,, no more mixed repos, then update, then try again. See https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories – Panther Aug 06 '18 at 14:49
  • @Panther, I cleaned the repos, followed the exact steps mentioned here, added Source package: screen, but unfortunately did not work. Same exact error as above. – Alsharif Aug 06 '18 at 15:06
  • Update your question with your current repos and output of sudo apt update && sudo apt install screen – Panther Aug 06 '18 at 15:15
  • @Panther, done. – Alsharif Aug 06 '18 at 15:31
  • @Panther they have DNS Resolution issues, refer to their apt output from earlier where it can't resolve the domain names properly. This issue would happen regardless of the mixed repos problem. – Thomas Ward Aug 06 '18 at 15:37
  • As suggested by @ThomasWard - Check your network connection ping google.com . If your networking is good, run sudo rm /var/lib/apt/lists/* && sudo apt update If that fails, try another mirror. – Panther Aug 06 '18 at 15:43
  • @ThomasWard, @Panther, when I type ping google.com I get ping: unknown host google.com, even though I can surf the internet on the same machine. How can I approach this problem? – Alsharif Aug 07 '18 at 07:43
  • as suggested here, I ran sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf, but the result was that I am not able to reinstall resolvconfig (E: Package 'resolvconf' has no installation candidate), and the browser isn't opening any page anymore. – Alsharif Aug 07 '18 at 07:58

1 Answers1

0

The solution is that apt has to be corrected configured with the proxy, which must be done both in /etc/environment and /etc/apt/apt.conf For example, in /etc/environment I should have something like this:

http_proxy="http://XXX.XX.XXX.XX:XX"
https_proxy="http://XXX.XX.XXX.XX:XX"
no_proxy=1,2,3,4,5,6,7,8,9,0

whereas in /etc/apt/apt.conf

Acquire::http::Proxy "http://XXX.XX.XXX.XX:XX";
Acquire::http::proxy::XX.XXX.X.XXX "DIRECT";
Acquire::https::Proxy "http://XXX.XX.XXX.XX:XX";

of course with the Xs replaced by the correct numbers.

  • You didn't mention in your original question that you use a proxy. That's critical information, and well documented in apt's manpage. The vast majority of folks faced with "E: Unable to locate package" don't have a proxy problem (they have a sources problem), so this solution will send many down the wrong path. Please edit your question and answer to make clear that this is a proxy issue, and explain how folks can tell if they have a proxy issue. – user535733 Aug 12 '18 at 23:29