E:Invalid record in the Invalid record in the preferences file /etc/apt/preferences, no Package header

Asked by snandan

I don't have the experience with command line. The problem started when I tried installing wine through terminal.Followed some commands on the 'ask ubuntu' and ended up with
E:Invalid record in the preferences file /etc/apt/preferences, no Package header
this is the error I get every time I try to install anything. If I try to open the software center it closes before it opens. Then I get recurring window giving crash reoprt.I don't have any experience with command line.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
N1ck 7h0m4d4k15
Solved:
Last query:
Last reply:
Revision history for this message
Best N1ck 7h0m4d4k15 (nicktux) said :
#1

Open a terminal (CTRL+ALT+T) and apply the commands below .. with order .. and one at time.

$ sudo cp /etc/apt/preferences ~/preferences

$ sudo rm /etc/apt/preferences

$ sudo apt-get update ; sudo apt-get dist-upgrade

and post any errors back here.

Thanks

Revision history for this message
snandan (snandansharma) said :
#2

@NIkTh thanks a lot . I think It did sove it. Some advice so that I don't do such mistakes in the future??

Revision history for this message
snandan (snandansharma) said :
#3

Thanks NikTh, that solved my question.

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#4

You created this file .. you or some program (I'm not sure) , this file /apt/preferences . This file is not used anymore.. considered deprecated. This file can cause problems when the non correct options are inside.

So we deleted this file completely (first we took a backcup , you can find the file inside your home directory , you can delete it now) and the problem corrected.

Thanks

Revision history for this message
snandan (snandansharma) said :
#5

Thanks for the information !