Cannot install or uninstall packages

Asked by Naube

Lately i installed sun java in my ubuntu 11.04, after that when ever i try to install or uninstall a package from software center
or synaptic the following message comes :

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 961, in simulate
    trans.unauthenticated = self._simulate_helper(trans)
  File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1085, in _simulate_helper
    return depends, self._cache.required_download, \
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 226, in required_download
    pm.get_archives(fetcher, self._list, self._records)
SystemError: E:I wasn't able to locate file for the sun-java6-bin package. This might mean you need to manually fix this package.

also in the terminal if i try the following message comes :

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  esound-common libesd0 libaudiofile0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  sun-java6-bin sun-java6-jre
Suggested packages:
  sun-java6-plugin ia32-sun-java6-plugin sun-java6-fonts ttf-kochi-gothic
  ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming
Recommended packages:
  gsfonts-x11
The following packages will be REMOVED:
  firefox firefox-globalmenu
The following packages will be upgraded:
  sun-java6-bin sun-java6-jre
2 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
2 not fully installed or removed.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

please help me...!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Odoardo Maria Calamai
Solved:
Last query:
Last reply:
Revision history for this message
Best Odoardo Maria Calamai (odoardo-calamai) said :
#1

Hi Naube
I have solved the trouble using
"System Setting" > "Control Center" > "System" > "Update Manager".
Update Manager found 20 package for update-upgrade and allowed
permisssion confirm at sun-java6-jre.
Now all run fine!
Odoardo Maria Calamai

Revision history for this message
Naube (jagada247) said :
#2

Hi Odoardo Maria Calamai,
Thanks for you'r help,,when i checked there were no updates to install..but the problem is now fixed
i did the same thing as you have said but slitely different i went to synaptic manager & selected sun-java6-jre ,
went to edit , go to fix broken package then press ok to upgrade then applyed after that i had confirm that's it
now i can install & uninstall packages in synaptic also in the terminal thanks for the help all of you ubuntu forum &
all the members specially Odoardo Maria Calamai..