How to repair apt-get command?

When I try to install new package with apt-get install, it doesn't work. apt-get update doesn't work too.

Do you know how to reinstall it to work again?

Output from sudo dpkg --configure -a :

dpkg: dependency problems prevent configuration of tvbrowser:
 tvbrowser depends on sun-java6-jre | sun-java5-jre; however:
  Package sun-java6-jre is not installed.
  Package sun-java5-jre is not installed.
dpkg: error processing tvbrowser (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 tvbrowser

Output from sudo apt-get install sun-java6-jre

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package sun-java6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jre has no installation candidate

This pastebin has the output of find /etc/apt/ -name '*.list' -ls -exec cat {} \; > repositories.txt .


What I am noticing from your output of the error is this:

dpkg: dependency problems prevent configuration of tvbrowser:

Try:

 sudo apt-get -f install

This should satisfy dependencies not met when you installed a .deb file in Ubuntu. It may end up asking you if it is ok to download those dependencies.

Hope this helps, if it helps.


The standard way to repair the dpkg database is to use this command:

sudo dpkg --configure -a

The error you are getting explains what packages are missing.

Do the following in terminal, and it will fix the dependency issue:

sudo apt-get install sun-java6-jre

That should immediately fix any issues you are having.