I messed up my repository and I can't rebuild a new one successfully. This is what happens with the repository I have. (It is the only way I can try to install something.)

sudo apt-get install apache2
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:
 apache2 : Depends: apache2-bin (= 2.4.10-10+deb8u4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Otherwise I just have this message

E: Unable to locate package

->This is my sources.list at the moment:


My Ubuntu version is:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:        16.04
Codename:       xenial
  • Any updates? Did you solve your issue? – dufte Sep 15 '16 at 7:15
  • Yes it helps but it is different than before, it asks me if I want to install throw a non secure package, or something like that. – Daniel Alves Sep 16 '16 at 9:22
  • "or something like that" is always a bad description - as it makes helping a mess. Please update your question above with additional informations what you changed, how your sources.list now looks like and the error-message you get now and lets hope we can THEN help further. – dufte Sep 16 '16 at 9:59
  • Is not an error is a warning, it's a valid solution for me. Thank you very much for your time and patience. But I will update my entries soon. – Daniel Alves Sep 16 '16 at 10:14
  • Alright - glad it helped. Feel free to mark the related answer as solution then - if it helped. – dufte Sep 16 '16 at 10:31

How to re-generate a clean sources.list

Please use the following sources generator to generate the content for your sources.list (the file itself is located at /etc/apt/sources.list)

Errors in your current sources.list

Just trying to explain some errors:

enter image description here

What is sources.list used for

Your operating system knows based on its sources.list which software/packages it can find (from where) and based on that make it available for your computer. Its somehow a critical part of your package manager.

General hint/warning

It might be dangerous to edit system-relevant files without knowing what you are doing.

For me it seems like you added apt sources from Debian Etch (which is a really old debian version) to your Ubuntu 16.04 sources.list. This is really far away from things you should do as starter. You might compare it with using DLLs from Windows 98 and trying to use them in Windows 7 or something.

If it comes to Ubuntu or other Linux distributions - if a command needs sudo permissions - please read and try to understand what the command is supposed to do - before you even consider executing it.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.