files list file for package '*****' is missing final newline的解决
2012-09-09 01:34
399 查看
root@ubuntu:/opt# apt-get install unrar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
unrar
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 0 B/107 kB of archives.
After this operation, 266 kB of additional disk space will be used.
Selecting previously unselected package unrar.
(Reading database ... 90%dpkg: unrecoverable fatal error, aborting:
files list file for package 'texlive-base' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@ubuntu:/opt#
root@ubuntu:/opt# apt-get install texlive-base --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded.
Need to get 0 B/14.7 MB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 90%dpkg: unrecoverable fatal error, aborting:
files list file for package 'texlive-base' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@ubuntu:/opt#
参考
http://www.linuxquestions.org/questions/debian-26/apt-get-dpkg-error-5dpkg-788082/ http://ubuntuforums.org/showthread.php?t=1319791
的牛人写了这么一个脚本:
root@ubuntu:/home/zhangbin# chmod +x fixAPT.py
root@ubuntu:/home/zhangbin# ./fixAPT.py
./fixAPT.py: line 9: import: command not found
./fixAPT.py: line 11: dpkg_path: command not found
./fixAPT.py: line 12: syntax error near unexpected token `('
./fixAPT.py: line 12: `paths = os.listdir(dpkg_path)'
root@ubuntu:/home/zhangbin# ./fixAPT.py
added newline character to: /var/lib/dpkg/info/texlive-latex-extra-doc.md5sums
added newline character to: /var/lib/dpkg/info/texlive-latex-recommended.md5sums
added newline character to: /var/lib/dpkg/info/bash.preinst
added newline character to: /var/lib/dpkg/info/texlive-base.md5sums
added newline character to: /var/lib/dpkg/info/dictionaries-common.postinst
added newline character to: /var/lib/dpkg/info/texlive-latex-extra.list
added newline character to: /var/lib/dpkg/info/texlive-latex-extra.md5sums
added newline character to: /var/lib/dpkg/info/texlive-latex-recommended.list
added newline character to: /var/lib/dpkg/info/texlive-base.list
added newline character to: /var/lib/dpkg/info/lmodern.md5sums
added newline character to: /var/lib/dpkg/info/texlive-latex-base.md5sums
root@ubuntu:/home/zhangbin#
root@ubuntu:/home/zhangbin# apt-get install unrar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
unrar
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 0 B/107 kB of archives.
After this operation, 266 kB of additional disk space will be used.
Selecting previously unselected package unrar.
(Reading database ... 247526 files and directories currently installed.)
Unpacking unrar (from .../unrar_1%3a4.0.3-1_i386.deb) ...
(Noting disappearance of texlive-latex-extra, which has been completely replaced.)
Processing triggers for man-db ...
Processing triggers for tex-common ...
Running mktexlsr. This may take some time... done.
Running updmap-sys. This may take some time... done.
Running mktexlsr /var/lib/texmf ... done.
Setting up unrar (1:4.0.3-1) ...
update-alternatives: using /usr/bin/unrar-nonfree to provide /usr/bin/unrar (unrar) in auto mode.
The following package disappeared from your system as
all files have been overwritten by other packages:
texlive-latex-extra
Note: This is done automatic and on purpose by dpkg.
root@ubuntu:/home/zhangbin#
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
unrar
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 0 B/107 kB of archives.
After this operation, 266 kB of additional disk space will be used.
Selecting previously unselected package unrar.
(Reading database ... 90%dpkg: unrecoverable fatal error, aborting:
files list file for package 'texlive-base' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@ubuntu:/opt#
root@ubuntu:/opt# apt-get install texlive-base --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded.
Need to get 0 B/14.7 MB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 90%dpkg: unrecoverable fatal error, aborting:
files list file for package 'texlive-base' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@ubuntu:/opt#
参考
http://www.linuxquestions.org/questions/debian-26/apt-get-dpkg-error-5dpkg-788082/ http://ubuntuforums.org/showthread.php?t=1319791
的牛人写了这么一个脚本:
#!/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()
root@ubuntu:/home/zhangbin# chmod +x fixAPT.py
root@ubuntu:/home/zhangbin# ./fixAPT.py
./fixAPT.py: line 9: import: command not found
./fixAPT.py: line 11: dpkg_path: command not found
./fixAPT.py: line 12: syntax error near unexpected token `('
./fixAPT.py: line 12: `paths = os.listdir(dpkg_path)'
root@ubuntu:/home/zhangbin# ./fixAPT.py
added newline character to: /var/lib/dpkg/info/texlive-latex-extra-doc.md5sums
added newline character to: /var/lib/dpkg/info/texlive-latex-recommended.md5sums
added newline character to: /var/lib/dpkg/info/bash.preinst
added newline character to: /var/lib/dpkg/info/texlive-base.md5sums
added newline character to: /var/lib/dpkg/info/dictionaries-common.postinst
added newline character to: /var/lib/dpkg/info/texlive-latex-extra.list
added newline character to: /var/lib/dpkg/info/texlive-latex-extra.md5sums
added newline character to: /var/lib/dpkg/info/texlive-latex-recommended.list
added newline character to: /var/lib/dpkg/info/texlive-base.list
added newline character to: /var/lib/dpkg/info/lmodern.md5sums
added newline character to: /var/lib/dpkg/info/texlive-latex-base.md5sums
root@ubuntu:/home/zhangbin#
root@ubuntu:/home/zhangbin# apt-get install unrar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
unrar
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 0 B/107 kB of archives.
After this operation, 266 kB of additional disk space will be used.
Selecting previously unselected package unrar.
(Reading database ... 247526 files and directories currently installed.)
Unpacking unrar (from .../unrar_1%3a4.0.3-1_i386.deb) ...
(Noting disappearance of texlive-latex-extra, which has been completely replaced.)
Processing triggers for man-db ...
Processing triggers for tex-common ...
Running mktexlsr. This may take some time... done.
Running updmap-sys. This may take some time... done.
Running mktexlsr /var/lib/texmf ... done.
Setting up unrar (1:4.0.3-1) ...
update-alternatives: using /usr/bin/unrar-nonfree to provide /usr/bin/unrar (unrar) in auto mode.
The following package disappeared from your system as
all files have been overwritten by other packages:
texlive-latex-extra
Note: This is done automatic and on purpose by dpkg.
root@ubuntu:/home/zhangbin#
相关文章推荐
- dpkg:warning: files list file for package "********" missing, assuming package has no files
- dpkg: warning: files list file for package `*’ missing 解决方法
- dpkg: warning: files list file for package `*****' missing, assuming package has no files currently
- dpkg: warning: files list file for package `*****' missing, assuming package has no files currently
- 解决:svn: 'xxxxxxxxxxx' is scheduled for addition, but is missing
- 'ADB server didn't ACK'的解决办法 , Binary XML file line #...: Error inflating class ...。
- dpkg: error: parsing file '/var/lib/dpkg/updates/0002' near line 0:newline in field name `#padding'
- Execution failed for task ':app:compileDebugAidl': aidl is missing
- Android中 Your content must have a ListView whose id attribute is 'android.R.id.list'错误的解决办法
- dpkg info修复及dpkg: warning: files list file for package
- qt 错误:request for member 'show' in 'showlist_ui', which is of non-class type 'ShowList*'
- 编译过程中弹出new(35) : error C2061: syntax error : identifier 'THIS_FILE'问题的原因及解决方法
- 如何解决"last line of file ends without a newline"
- linux下出现architecture of input file `*.o' is incompatible with i386:x86-64 output的解决方法
- 'dependencies.dependency.version' is missing for xxx
- here is no result type defined for type 'plaintext'解决
- 报错 No resource identifier found for attribute '****' in package '***.***'解决办法
- the project file '' has been renamed or is no longer in the solution 解决办法
- The template file for selected project type is missing的解决