RichardF
Posts: 5
Joined: Tue Jul 11, 2017 3:38 pm

Raspian 2017-07-05 apt-get install problem

Wed Jul 12, 2017 10:47 pm

I've obtained a new sd card and installed the new Rasbian release of 2017-07-05 in order to start from scratch.

After expanding the file system and enabling VNC, plus changing a few seemingly innocuous things like password, timezone etc, I have moved into installing some packages. After apt-get update, which seems to go OK, I move onto apt-get install.

In case of finger trouble, I've done this a twice now (the whole cycle, including installing the image on the card) and both times I get the same issue with apt-get install: it fails with:

dpkg: unrecoverable fatal error, aborting:
files list file for package 'raspberrypi-net-mods' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

This is the same for several attempted installs.

It seems a rather harsh response to a missing newline. Can I just find this file and edit it, or is it a sign that there is more wrong somewhere?

thanks,
Richard

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5680
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspian 2017-07-05 apt-get install problem

Wed Jul 12, 2017 10:57 pm

How did you flash the image? If you used 'dd', did you 'sync' before taking the card out? If you're on windows or a mac, could you try 'Etcher'?

RichardF
Posts: 5
Joined: Tue Jul 11, 2017 3:38 pm

Re: Raspian 2017-07-05 apt-get install problem

Thu Jul 13, 2017 9:22 am

I'm on a Mac and I used PiBaker -- it's never resulted in any problems before, neither for the Pi or the Red Pitaya (a digital signal processor).

fruitoftheloom
Posts: 19582
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Raspian 2017-07-05 apt-get install problem

Thu Jul 13, 2017 9:28 am

RichardF wrote:I'm on a Mac and I used PiBaker -- it's never resulted in any problems before, neither for the Pi or the Red Pitaya (a digital signal processor).
Maybe you could try Etcher (assuming you are running x86-64 OS X / macOS), it both unzips and writes the image: https://etcher.io/
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

RichardF
Posts: 5
Joined: Tue Jul 11, 2017 3:38 pm

Re: Raspian 2017-07-05 apt-get install problem

Thu Jul 13, 2017 10:19 am

Now I've tried Etcher. Full procedure:

SD card is a DanDisk Ultra 32 Gb (I know it's unnecessarily large, but I asked my wife to get a fast one and this is the fastest she found at the local supermarket: 80 MB/s is claimed).

1. Erase, using Apple's Disk Utility, with MS-DOS(FAT) (but I got the same result with the original empty card)
2. Use Etcher to flash 2017-07-05-rasbian-jessie.img
3. Install in pi and apply power
4. Using raspi-config change password, timezone (Europe/Paris), WiFi country (France), enable VNC and SSH (since the pi is on the other side of the room) and expand filesystem
5. Reboot
6. Connect with VNC
7. apt-get update -- No errors
8. apt-get install libglib2.0-dev -- no reported errors!
9. apt-get install libusb-dev -- no errors
10 apt-get install libdbus-1-dev -- no errors
11 apt-get install libudev-dev -- couldn't resolve 'mirrordirector.raspian.org', resulting in error: failed to fetch ...
12 since our internet is a bit flakey, I repeated the previous command and this time it worked, with no errors.
13 apt-get install libical-dev -- no errors
14 apt-get install libreadline-dev -- no errors

There were 3 changes in this procedure compared to what I did before:
1. previously I used Pi-Baker to burn the card
2. previously I used the desktop's preferences tool to change the password, timezone, wifi country and enable VNC and SSH
3. previously, when running apt-get install I had earlier tried to install more packages at the same time:
sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
and when this failed I tried them individually, these also failing (you may recognise this as part of the Adafruit recipe to update BlueZ)

However, now I have managed to install all of them, individually, for one or a combination of reasons, my problem is resolved. Thanks for the pointer.
cheers,
Richard

PS: sorry for the long post, but since I didn't expect it to work I wanted to document every step!

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5680
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspian 2017-07-05 apt-get install problem

Thu Jul 13, 2017 10:52 am

That's the second report where I've seen PiBaker being the common factor. The other is that people take the card out after running dd without running 'sync' first. jojopi has noticed that the files some people are reporting as corrupted are at the very end of the sd card.

Milliways
Posts: 392
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: Raspian 2017-07-05 apt-get install problem

Fri Jul 14, 2017 6:19 am

ShiftPlusOne wrote:That's the second report where I've seen PiBaker being the common factor. The other is that people take the card out after running dd without running 'sync' first. jojopi has noticed that the files some people are reporting as corrupted are at the very end of the sd card.
I decided to perform a clean install of the latest Raspbian, and experienced the same problem.

I am using the same script I have used hundreds of times (just changing the name of the image).

I am not convinced that lack of sync is a possible issue (I am doing this on macOS and copying in raw disk mode i.e. NO buffering).

The following is the actual copy line from my script:-

Code: Select all

time unzip -p $IMG.zip | dd of=/dev/r$DSK bs=4m
I have repeated the process 4 times; I tried unzipping first, rather than piping (and included sync just in case) and got a similar error, but about python3.4; I tried reducing block size to 1M with similar results.

In the end I tried Etcher, which seems better than the other packaged options (although I prefer command line, and my own checks to prevent accidentally choosing the wrong target).

This seemed to work, so far, but leaves me worrying about what is so different about this image.

PS It would be good to list the checksum for the unzipped img file, just to enable an extra check.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5680
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspian 2017-07-05 apt-get install problem

Fri Jul 14, 2017 10:49 am

Milliways wrote:
ShiftPlusOne wrote:That's the second report where I've seen PiBaker being the common factor. The other is that people take the card out after running dd without running 'sync' first. jojopi has noticed that the files some people are reporting as corrupted are at the very end of the sd card.
I decided to perform a clean install of the latest Raspbian, and experienced the same problem.

I am using the same script I have used hundreds of times (just changing the name of the image).

I am not convinced that lack of sync is a possible issue (I am doing this on macOS and copying in raw disk mode i.e. NO buffering).

The following is the actual copy line from my script:-

Code: Select all

time unzip -p $IMG.zip | dd of=/dev/r$DSK bs=4m
I have repeated the process 4 times; I tried unzipping first, rather than piping (and included sync just in case) and got a similar error, but about python3.4; I tried reducing block size to 1M with similar results.

In the end I tried Etcher, which seems better than the other packaged options (although I prefer command line, and my own checks to prevent accidentally choosing the wrong target).

This seemed to work, so far, but leaves me worrying about what is so different about this image.

PS It would be good to list the checksum for the unzipped img file, just to enable an extra check.
Yeah, you're quite right. I forgot that Mac OS has two ways of referring to block devices. Is it possible then that it drops the last incomplete block instead of trying to pad it? In that case the conv=sync options might be correct.

Milliways
Posts: 392
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: Raspian 2017-07-05 apt-get install problem

Fri Jul 14, 2017 11:58 am

Milliways wrote:
ShiftPlusOne wrote:That's the second report where I've seen PiBaker being the common factor. The other is that people take the card out after running dd without running 'sync' first. jojopi has noticed that the files some people are reporting as corrupted are at the very end of the sd card.
I decided to perform a clean install of the latest Raspbian, and experienced the same problem.

I am using the same script I have used hundreds of times (just changing the name of the image).

I am not convinced that lack of sync is a possible issue (I am doing this on macOS and copying in raw disk mode i.e. NO buffering).

The following is the actual copy line from my script:-

Code: Select all

time unzip -p $IMG.zip | dd of=/dev/r$DSK bs=4m
I have repeated the process 4 times; I tried unzipping first, rather than piping (and included sync just in case) and got a similar error, but about python3.4; I tried reducing block size to 1M with similar results.

In the end I tried Etcher, which seems better than the other packaged options (although I prefer command line, and my own checks to prevent accidentally choosing the wrong target).

This seemed to work, so far, but leaves me worrying about what is so different about this image.

PS It would be good to list the checksum for the unzipped img file, just to enable an extra check.
The image has a size 4661483821 (which looks odd). Unfortunately I did not keep a log of the dd, but I just calculated the no of 1M blocks this would correspond to i.e 4445 and this does seem familiar. If so this would indicate quite a few ~300k bytes missing.

Whenever I make an image I align on 4M boundaries (which matches the Erase Block size) so have never experienced loss, but I am sure I have seen partial blocks reported in dd, but even here this is from images with 1M bs.

User avatar
jojopi
Posts: 3069
Joined: Tue Oct 11, 2011 8:38 pm

Re: Raspian 2017-07-05 apt-get install problem

Sun Jul 16, 2017 8:48 am

Milliways wrote:The image has a size 4661483821 (which looks odd).
I had been looking at that number myself and failing to spot the issue. It is not even even.

So, it is not dd's fault if the output is truncated. When using a raw device or oflag=direct, the kernel will reject the whole of the last write for not being a multiple of the native sector size (probably 4096).

The odd number appears to result from the use of du --apparent-size in pi-gen. It thinks that a 13 byte file occupies 13 bytes, which is basically nonsense.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5680
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspian 2017-07-05 apt-get install problem

Sun Jul 16, 2017 9:09 am

The next image will just start at 10GB and then shrink to the appropriate size at the end to avoid such issues. Yes, I know, I can fix the use of du and round the image size correctly, but du has been a headache in other ways too.

clem151
Posts: 21
Joined: Wed Mar 13, 2013 8:25 pm
Location: Chicago, IL
Contact: Website

Re: Raspian 2017-07-05 apt-get install problem

Tue Aug 01, 2017 8:37 pm

Wow, thank you for this thread. I was trying to install a package on a new Raspbian install and was having the following errors:

Selecting previously unselected package cpp-4.6.
dpkg: unrecoverable fatal error, aborting:
files list file for package `wolfram-engine' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)

Usually when there is an issue with an SD image the thing won't boot. I have made 100's of SD cards using DD and have never had a problem.

Per above, I tried etcher to make the image and it worked fine. Thanks again!

regards,
Craig

Return to “Raspbian”