2

Whenever I install, update or uninstall a program in the terminal, this comes up

sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-headers-3.2.0-35-generic-pae
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 11.3 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 251024 files and directories currently installed.)
Removing linux-headers-3.2.0-35-generic-pae ...
dpkg: error processing linux-headers-3.2.0-35-generic-pae (--remove):
 unable to securely remove ': File name too long
Errors were encountered while processing:
 linux-headers-3.2.0-35-generic-pae
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also tried purging dpkg, but the same error from terminal. Aptitude also doesn't work! Any solutions to fix it ?

12
  • I don't have an answer (wish I did) but rather a question - why do you want to remove this package? Jan 21, 2013 at 16:21
  • I don't want to remove them, it runs on its own in the middle of any installation or update. It aborts when I enter 'n'.
    – Andrew
    Jan 21, 2013 at 16:28
  • I see. Sorry not to be able to help further, this is out of my league. Jan 21, 2013 at 16:40
  • Hope somebody else will, Thank you @ClivevanHilten
    – Andrew
    Jan 21, 2013 at 16:44
  • "I also tried purging dpkg" - Hold on a sec! You sould never remove dpkg! It's an essential system package for package management, used by all APT tools. It seems that your dpkg database is screwed up in /var/lib/dpkg/info/linux-headers-3.2.0-35-generic-pae.list. (the cause, not a solution/answer yet)
    – gertvdijk
    Jan 21, 2013 at 16:50

2 Answers 2

1

http://www.iasptk.com/ubuntu-fix-broken-package-best-solution

After trying

sudo dpkg --configure -a

and

sudo apt-get install -f

the problem of a broken package still exist the solution is to edit the dpkg status file manually.

$ sudo gedit /var/lib/dpkg/status    (you can use vi or nano instead of gedit)

Locate the corrupt package, and remove the whole block of information about it and save the file.

4
  • Thank you @ptheo, the problem's gone now but I'm not able to post the answer until 8hrs after I posted the question. Software updater did the work smooth. I referred to that link earlier and I couldn't find which one was corrupt!
    – Andrew
    Jan 21, 2013 at 19:50
  • 1
    Modifying the dpkg/status file yourself is asking for trouble. Now there are several files on your system in system directories the package manager is not aware of. Now it won't be possible to uninstall the package properly and you're likely to run into more issues during upgrades and such.
    – gertvdijk
    Jan 21, 2013 at 23:53
  • Ok. Its my fault posting the same answer in multiple places.
    – ptheo
    Jan 22, 2013 at 10:19
  • @ptheo I recommend deleting (or better, customizing) one. Jan 23, 2013 at 15:40
0

Ubuntu software updater did the work. A partial upgrade option was available and the generic lists were updated automatically.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .