files list file for package 'xxx' is missing final newline
#!/usr/bin/python # 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()
Ok, i've had this error for several weeks now and have not been able to install ANY updates. Did some searching and couldn't find much info, so decided to check it out myself. The 'missing final newline' was a bit of a giveaway really, so i created a python script to check how many files inside /var/lib/dpkg/info/ were actually missing the final newline character.
I then modified my script to append a newline to the files that were missing it, which fixed my problem. Not sure how these files managed to get corrupted but hey-ho. Is this a satisfactory answer or will i be misleading new users by posting this script???
refer to: http://ubuntuforums.org/showthread.php?t=1319791
files list file for package 'xxx' is missing final newline的更多相关文章
- 解决 dpkg: warning: files list file for package 'x' missing 问题
参考: dpkg: warning: files list file for package 'x' missing 解决 dpkg: warning: files list file for pac ...
- dpkg: warning: files list file for package `*****' missing, assuming package has no files currently installed解决办法
一个好友的国外VPS由于操作不当,结果装软件的时候总是提示dpkg: warning: files list file for package `*****' missing, assuming pa ...
- RLException: XXX is neither a launch file in package XXX nor is XXX a launch file name问题解决
在运行roslaunch时出现了类似下面的错误: RLException: XXX is neither a launch file in package XXX nor is XXX a launc ...
- 【linux】dpkg info修复及dpkg: warning: files list file for package
mv /var/lib/dpkg/info /var/lib/dpkg/info.bak //现将info文件夹更名 sudo mkdir /var/lib/dpkg/info //再新建一个新的in ...
- file / from install of XXX conflicts with file from package filesystem-XXX
在centos上安装一个偏门软件时出现如下问题: rpm -ivh mNetAssist-0.1.1-2.x86_64.rpm #执行命令 file / from install of XXX con ...
- .ner core InvalidOperationException: Cannot find compilation library location for package 'xxx' 和 SqlException: 'OFFSET' 附近有语法错误。 在 FETCH 语句中选项 NEXT 的用法无效。问题
原文地址:传送门 1.InvalidOperationException: Cannot find compilation library location for package 'xxx'问题: ...
- file /usr/share/mysql/... conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_ 64 MySQL安装
在CentOS 6.5安装MySQL 5.6.17,安装到最后一个rpm文件MySQL-server时 安装命令是:rpm -ivh MySQL-server-5.6.17-1.el6.x86_64. ...
- clang: error: no such file or directory: xxx.pch
今天打开一个下载的例子 报clang: error: no such file or directory: xxx.pch的错 说一下解决方案 1.先在你的工程里找到这.pch文件- 2.把它现在的路 ...
- CentOS中yum安装软件时报错:No package XXX available
yum 安装软件时,报错:No package XXX available. [root@localhost ~]# yum -y install redis Loaded plugins: fast ...
随机推荐
- Struts2第一个入门案例
一.如何获取Struts2,以及Struts2资源包的目录结构的了解 Struts的官方地址为http://struts.apache.org 在他的主页当中,我们可以通过左侧的Apache ...
- Yii2 认证实现原理和示例
Yii的用户认证分为两个部分,一个是User组件,负责管理用户认证状态的,包括登录,登出,检测当前登录状态等,源文件位于vender/yiisoft/yii2/web/User.php.另一个是实现接 ...
- JavaScript数组去重
第一种方法: 思路: 1.创建一个新的数组存放结果 2.创建一个空对象, 3.将数组中的元素作为空对象的属性并对其赋值,每次取出一个元素与对象进行对比,然后到对象中去访问这个属性, 如果能访问到值,则 ...
- C++基础知识(5)---类和对象
终于把C++中的基础在前面的几篇博客中总结完了,可能还有一些语法还没有总结到,没关系,以后用到了再查资料就好.类是C++中的一个非常重要的概念,这是区别你使用的C++到底是面向过程还是面向对象的一个重 ...
- 微信公众帐号开发-消息创建时间long型与标准时间的互相转换
/** * */ package com.hd.admin.wxmeet.utils; /** * @author jymcpp * */ import java.text.DateFor ...
- linux文件对比命令——diff
diff用于比较文件或目录内容,特别是比较两个版本不同的文件以找到改动的地方. 如果指定比较的是文件,则只有当输入为文本文件时才有效,以逐行的方式,比较文本文件的异同处. 如果指定比较的是目录的的时候 ...
- 解决Unsupported major.minor version 51.0错误
解决Unsupported major.minor version 51.0错误使用jdk6运行项目时发生了Unsupported major.minor version 51.0错误.经过网上搜索发 ...
- mysql 性能优化方向
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- 在Eclipse中集成Ant配置
提要:本文将向你展示如何使用Eclipse设置为Ant所用的属性值和环境变量,并简要分析如何配置Ant编辑器以便从Eclipse内部操作Ant文件. 一. 修改Ant Classpath 在使用一个可 ...
- ios 获取文件扩展名备忘
NSString *lastComponent = [cachePath lastPathComponent]; NSString *pathLessFilename = [ ...