Stian Remvik Datagrafikk

files list for package ‘xxx’ is missing final newline

I got this error when trying to install Pd-extended deb package:

files list for package libjpeg62-turbo-dev:armhf.list is missing final newline

I found this script on the Ubuntu forums which solved the problem:

# 8th November, 2009
# update manager failed, giving me the error:
#       'files list file for package 'xxx' is missing final newline' for every package.
# some Googling revealed that this problem was due to corrupt files(s) in /var/lib/dpkg/info/
# looping though those files revealed that some did not have a final new line
# this script will resolve that problem by appending a newline to all files that are missing it
# NOTE: you will need to run this script as root, e.g. sudo python newline_fixer.py

import os

dpkg_path = '/var/lib/dpkg/info/'
paths = os.listdir(dpkg_path)
for path in paths:
    path = dpkg_path + path
    f = open(path, 'a+')
    data = f.read()
    if len(data) > 1 and data[-1:] != '\n':
        f.write('\n')
        print 'added newline character to:', path
    f.close()  
"BITWaves" iOS app
Raspberry Pi Notes
"Neighbours" video installation
Electronic Vintage Bit20 concert visuals
"Late into that night, and all the following nights" installation
"Bergen Leser" installation
"Cubes" animation
NRK3 identity film
"Hush!" installation
"The sound of pictures" installation
Photographs
Concert visuals Knekklectic
Hulen Bergen posters and design
Notes on programming and other technical difficulties
-----------------------------------------------------

Multi screen video with Multiscreener on Mac
Seamless looping video player on Raspberry Pi using openFrameworks