Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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:
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 ?

share|improve this question
I don't have an answer (wish I did) but rather a question - why do you want to remove this package? – Clive van Hilten Jan 21 '13 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 '13 at 16:28
I see. Sorry not to be able to help further, this is out of my league. – Clive van Hilten Jan 21 '13 at 16:40
Hope somebody else will, Thank you @ClivevanHilten – Andrew Jan 21 '13 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 '13 at 16:50

After trying

sudo dpkg --configure -a


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.

share|improve this answer
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 '13 at 19:50
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 '13 at 23:53
Ok. Its my fault posting the same answer in multiple places. – ptheo Jan 22 '13 at 10:19
@ptheo I recommend deleting (or better, customizing) one. – Eliah Kagan Jan 23 '13 at 15:40
up vote 0 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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