Unable to install updates / packages: missing final newline error on a package

Asked by A.K.Karthikeyan

Hi when ever I select a new software to be installed, its getting downloaded properly but not installing. I am getting the following message

E: /var/cache/apt/archives/libldap-2.4-2_2.4.7-6ubuntu4.1_i386.deb: files list file for package `memtest86+' is missing final newline

Any suggestions and help on how to fix it?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu update-manager Edit question
Assignee:
No assignee Edit question
Solved by:
A.K.Karthikeyan
Solved:
Last query:
Last reply:
Revision history for this message
JacobSteelsmith (jacobsteelsmith) said :
#1

Can you try:
$ sudo apt-get install --reinstall memtest86+

Revision history for this message
Philipp Bönhof (phboe-launchpad) said :
#2

Try to reinstall memtest86+ with

sudo apt-get --reinstall install memtest86+

Then install your new package.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Please try to clean your cache first

sudo apt-get clean all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get --reinstall install memtest86+

Hpe this helps

Revision history for this message
A.K.Karthikeyan (mindaslab) said :
#4

When I typed in sudo apt-get upgrade , this is what I got

karthikeyan@karthikeyan-desktop:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
The following packages will be upgraded:
  libldap-2.4-2 lshw
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 498kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in.archive.ubuntu.com hardy-updates/main libldap-2.4-2 2.4.7-6ubuntu4.1 [181kB]
Get:2 http://in.archive.ubuntu.com hardy-updates/main lshw 02.12.01-2ubuntu1.1 [317kB]
Fetched 498kB in 13s (37.3kB/s)
(Reading database ... dpkg: error processing /var/cache/apt/archives/libldap-2.4-2_2.4.7-6ubuntu4.1_i386.deb (--unpack):
 files list file for package `memtest86+' is missing final newline
Errors were encountered while processing:
 /var/cache/apt/archives/libldap-2.4-2_2.4.7-6ubuntu4.1_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Looks like very very serious problem. Think must reinstall Ubuntu.

Revision history for this message
Philipp Bönhof (phboe-launchpad) said :
#5

I had a similar problem: for me it was not missing final newline, on my system (Ubuntu 8.04) the whole list file was missing.

I used then

sudo apt-get --reinstall install memtest86+

to fix the problem.
You should really try all what marcobra said in order. After the last sudo apt-get see if you still have the problem with the missing newline.

Revision history for this message
A.K.Karthikeyan (mindaslab) said :
#6

I did try exact steps told by marcobra, but still the problem persists. This is what I get the out at last

karthikeyan@karthikeyan-desktop:~$ sudo apt-get --reinstall install memtest86+
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
Need to get 65.2kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in.archive.ubuntu.com hardy/main memtest86+ 1.70-3ubuntu1 [65.2kB]
Fetched 65.2kB in 4s (16.1kB/s)
(Reading database ... dpkg: error processing /var/cache/apt/archives/memtest86+_1.70-3ubuntu1_i386.deb (--unpack):
 files list file for package `memtest86+' is missing final newline
Errors were encountered while processing:
 /var/cache/apt/archives/memtest86+_1.70-3ubuntu1_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
karthikeyan@karthikeyan-desktop:~$

Still the same one. Any way thanks all.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

Now please try

sudo apt-get check
sudo apt-get --fix-missing upgrade
sudo apt-get -f install
sudo apt-get --reinstall install memtest86+

Revision history for this message
A.K.Karthikeyan (mindaslab) said :
#8

Well here is the result

karthikeyan@karthikeyan-desktop:~$ sudo apt-get check
[sudo] password for karthikeyan:
Reading package lists... Done
Building dependency tree... Done
karthikeyan@karthikeyan-desktop:~$ sudo apt-get --fix-missing upgrade
Reading package lists... Done
Building dependency tree... Done
The following packages will be upgraded:
  libldap-2.4-2 lshw
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/498kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... dpkg: error processing /var/cache/apt/archives/libldap-2.4-2_2.4.7-6ubuntu4.1_i386.deb (--unpack):
 files list file for package `memtest86+' is missing final newline
Errors were encountered while processing:
 /var/cache/apt/archives/libldap-2.4-2_2.4.7-6ubuntu4.1_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
karthikeyan@karthikeyan-desktop:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
karthikeyan@karthikeyan-desktop:~$ sudo apt-get --reinstall install memtest86+
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
Need to get 0B/65.2kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... dpkg: error processing /var/cache/apt/archives/memtest86+_1.70-3ubuntu1_i386.deb (--unpack):
 files list file for package `memtest86+' is missing final newline
Errors were encountered while processing:
 /var/cache/apt/archives/memtest86+_1.70-3ubuntu1_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
karthikeyan@karthikeyan-desktop:~$

There is a file called lock in /var/cache/apt/archives/ , will it do any good if I delet it and try again ? Any way I have started to backup my data.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#9

Yes, you can try to delete, it is the same of "sudo apt-get clean all" command, but first try this:
Please using System->Administration->Software sources try to download the packages using "master location"

Then open a terminal and redo:

sudo apt-get clean all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get --fix-missing upgrade
sudo apt-get -f install
sudo apt-get --reinstall install memtest86+

Try...

Revision history for this message
A.K.Karthikeyan (mindaslab) said :
#10

Still not working. In the middle of all this, there was a crash report generated and it reported automatically to Ubuntu. It wil better to report this problem as bug rather than breaking our heads on it. Any way thank you all.

Revision history for this message
A.K.Karthikeyan (mindaslab) said :
#11

The only way to clear this mess is to reinstall Ubuntu. I have filed a bug regarding this issue refer URL : https://bugs.launchpad.net/ubuntu/+bug/227348

Thank you all. Enjoy Ubuntu!

Revision history for this message
Pascal De Vuyst (pascal-devuyst) said :
#12
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#13

Cannot update missing final newline

Open a terminal and type:

echo -en '\n' | sudo tee -a /var/lib/dpkg/info/memtest86+.list

give your user password when requested, you don't see nothing when you type it, then press enter.

Hope this helps

Revision history for this message
vipul (vipulbic) said :
#14

hi, i am new to Ubuntu. i am using 8.1 version on my dell inspiron 1525 series with 2GB RAM. i am having troubles while installing the updates. it shows something like this
W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/u/udev/udev_124-9ubuntu0.2_i386.deb

is there is a net problem. i have installed rest of the repos from the same network( using local domain) then why it is not installing the updates from the same?

secondly, sometimes the windows hang-up and ultimately i have to shut-down the system. plz help me in this regard.
thanks