在“ apt-get install”过程中出现“ tar:无法识别的选项--warning”


10

我刚apt-get upgrade在我的debian 5 vps上运行,却收到此错误:

tar:无法识别的选项`--warning = no-timestamp'

现在,当我尝试安装其他软件包时,例如:imagemagick,我得到了相同的错误:

li197-162:~# apt-get install imagemagick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  pkg-config comerr-dev libssh2-1-dev libpcre3-dev libdb4.6-dev libsqlite3-dev libmysqlclient15-dev libldap2-dev libpcrecpp0 libexpat1-dev libpq5 libidn11-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  fontconfig-config imagemagick-common libfontconfig1 libfreetype6 libglib2.0-0 libice6 libjasper1 libjpeg8 liblcms1 liblqr-1-0 libltdl7 libmagickcore4 libmagickwand4 libpng12-0 libsm6 libtiff4
  libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxml2-dev libxt6 ttf-dejavu-core x11-common
Suggested packages:
  imagemagick-doc autotrace cups-bsd lpr lprng enscript ffmpeg gimp gnuplot grads hp2xx html2ps libwmf-bin mplayer povray radiance sane-utils texlive-base-bin transfig xdg-utils libjasper-runtime
  liblcms-utils
Recommended packages:
  libmagickcore4-extra ghostscript netpbm ufraw-batch libglib2.0-data shared-mime-info gsfonts xml-core
The following NEW packages will be installed:
  fontconfig-config imagemagick imagemagick-common libfontconfig1 libfreetype6 libice6 libjasper1 libjpeg8 liblcms1 liblqr-1-0 libltdl7 libmagickcore4 libmagickwand4 libpng12-0 libsm6 libtiff4
  libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxt6 ttf-dejavu-core x11-common
The following packages will be upgraded:
  libglib2.0-0 libxml2 libxml2-dev
3 upgraded, 25 newly installed, 0 to remove and 190 not upgraded.
Need to get 0B/11.2MB of archives.
After this operation, 22.4MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
x11-common template parse error: Template parse error near `Choices-sr@latin.UTF-8: Samo glavni korisnik, Samo za korisnike konzole, Svako', in stanza #1 of /tmp/x11-common.template.65052

tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libfreetype6_2.4.6-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/ttf-dejavu-core_2.33-2_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/fontconfig-config_2.8.0-3_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libfontconfig1_2.8.0-3_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/x11-common_1%3a7.6+9_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libice6_2%3a1.0.7-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libpng12-0_1.2.46-3_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libsm6_2%3a1.2.0-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libjpeg8_8c-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libtiff4_3.9.5-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxau6_1%3a1.0.6-3_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxdmcp6_1%3a1.1.0-3_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxcb1_1.7-3_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libx11-data_2%3a1.4.4-2_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libx11-6_2%3a1.4.4-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxext6_2%3a1.3.0-3_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxt6_1%3a1.1.1-2_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-4_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libxml2_2.7.8.dfsg-4_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libglib2.0-0_2.28.6-1_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/liblcms1_1.19.dfsg-1_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/liblqr-1-0_0.4.1-1.1_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libltdl7_2.4-4_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libjasper1_1.900.1-10_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/imagemagick-common_8%3a6.6.9.7-5_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libmagickcore4_8%3a6.6.9.7-5+b1_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/libmagickwand4_8%3a6.6.9.7-5+b1_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
tar: unrecognized option `--warning=no-timestamp'
Try `tar --help' or `tar --usage' for more information.
dpkg-deb: error: subprocess tar returned error exit status 64
dpkg: error processing /var/cache/apt/archives/imagemagick_8%3a6.6.9.7-5+b1_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libfreetype6_2.4.6-2_i386.deb
 /var/cache/apt/archives/ttf-dejavu-core_2.33-2_all.deb
 /var/cache/apt/archives/fontconfig-config_2.8.0-3_all.deb
 /var/cache/apt/archives/libfontconfig1_2.8.0-3_i386.deb
 /var/cache/apt/archives/x11-common_1%3a7.6+9_all.deb
 /var/cache/apt/archives/libice6_2%3a1.0.7-2_i386.deb
 /var/cache/apt/archives/libpng12-0_1.2.46-3_i386.deb
 /var/cache/apt/archives/libsm6_2%3a1.2.0-2_i386.deb
 /var/cache/apt/archives/libjpeg8_8c-2_i386.deb
 /var/cache/apt/archives/libtiff4_3.9.5-2_i386.deb
 /var/cache/apt/archives/libxau6_1%3a1.0.6-3_i386.deb
 /var/cache/apt/archives/libxdmcp6_1%3a1.1.0-3_i386.deb
 /var/cache/apt/archives/libxcb1_1.7-3_i386.deb
 /var/cache/apt/archives/libx11-data_2%3a1.4.4-2_all.deb
 /var/cache/apt/archives/libx11-6_2%3a1.4.4-2_i386.deb
 /var/cache/apt/archives/libxext6_2%3a1.3.0-3_i386.deb
 /var/cache/apt/archives/libxt6_1%3a1.1.1-2_i386.deb
 /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-4_i386.deb
 /var/cache/apt/archives/libxml2_2.7.8.dfsg-4_i386.deb
 /var/cache/apt/archives/libglib2.0-0_2.28.6-1_i386.deb
 /var/cache/apt/archives/liblcms1_1.19.dfsg-1_i386.deb
 /var/cache/apt/archives/liblqr-1-0_0.4.1-1.1_i386.deb
 /var/cache/apt/archives/libltdl7_2.4-4_i386.deb
 /var/cache/apt/archives/libjasper1_1.900.1-10_i386.deb
 /var/cache/apt/archives/imagemagick-common_8%3a6.6.9.7-5_all.deb
 /var/cache/apt/archives/libmagickcore4_8%3a6.6.9.7-5+b1_i386.deb
 /var/cache/apt/archives/libmagickwand4_8%3a6.6.9.7-5+b1_i386.deb
 /var/cache/apt/archives/imagemagick_8%3a6.6.9.7-5+b1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
li197-162:~# 

我真的不知道哪里出了问题以及如何解决。是否可以撤消apt-get upgrade


1
“候选”的“ apt-cache policy x11-common”列表是什么版本。我问是因为我怀疑您可能正在使用指向debian 6(当前为“ stable”)的源来升级debian 5(当前为“ oldstable”)服务器。

Answers:


14

我刚遇到这个问题。正如Gilles建议的那样,升级tar是解决问题的办法,但(惊奇的是)tar不能以通常的方式升级,因为dpkg需要1.23或更高版本才能解压并安装最新的tardeb。dpkg确实确实需要显式的依赖关系,以确保在dpkg安装更高版本的软件时,首先要使用最新tar版本,但是我想以不支持的方式将不同的测试和不稳定的发行版合并在一起是有风险的。它仍然是不可取的,这似乎是削弱系统的一种不幸方式。

我的第一个想法是tar 在GNU项目中寻找的最新二进制文件,但不幸的是,它们只有源下载,如果(像我一样)没有安装各种编译工具,这将无济于事。

如果您从packages.debian.org下载最新的tar二进制文件.deb以匹配您的系统,并将其放置在某个临时位置(只是要整洁),则应该可以使用命令进入它的内部,例如我的情况。 然后,使用现有的早期版本的命令(如)将结果文件解压缩,只要您不尝试执行任何愚蠢的操作(例如使用直到版本1.23才可用的参数)就可以正常工作。:)然后,您将获得二进制文件,该二进制文件(在data.tar.gz文件中)可能位于。 完成此操作后,我将该二进制文件的路径添加到了前面arar x tar_1.26-2_amd64.deb
data.tar.gztar zxvf data.tar.gztar--warningtarbin/tar
PATH我的shell中的变量,可以使用command在bash shell中完成export PATH=/root/temp/bin:$PATH,但是要调整路径以适合新tar二进制文件所在的位置。之后,运行常规的dpkg --install tar_1.26-2_amd64.deb奇观,因为dpkg它将在路径中查找并找到最新的tar二进制文件,然后再在常规bin路径中找到较旧的版本。


为我工作。对于那些到达此页面调试在NSLU2上安装Debian的用户,您需要以下.deb文件:packages.debian.org/squeeze/armel/tar/download 您可以使用另一台机器(mac可以)来执行上面的“ ar”位。我使用curl同步到我的NSLU。再次感谢您。
莫维斯·莱德福德

3

ar我的系统没有安装,所以我做了一个可怕的尝试:

mv /bin/tar /bin/tar.real
echo "tar.real xpf -" >/bin/tar
chmod +x /bin/tar
cd /
# put in the correct path
dpkg-deb -x /var/cache/apt/archives/tar_1.26-4_armel.deb .
# check things are working and then
#rm /bin/tar.real

+1。当升级严重中断以至于我只有一个旧的“ tar”而根本没有“ ar”时,我需要回答这个问题。谢谢!
bignose 2012年

2

您可能不必担心下载tar软件包。

到现在为止,可能是因为您正在进行升级,并且程序包管理系统已经为您下载了最新的tar程序包,因此它将在其中等待您的到来:

/var/cache/apt/archives/tar_(version-release_platform).deb

例如:

# ls -t /var/cache/apt/archives/tar_*|head -1

/var/cache/apt/archives/tar_1.26-4_amd64.deb

这是我固定系统的方式:

在您的系统上找到最新版本:

root@host:~# ls -t /var/cache/apt/archives/tar_*|head -1
/var/cache/apt/archives/tar_1.26-4_amd64.deb

创建一个临时工作区并解压缩.deb存档:

root@host:~# mkdir fix_tar
root@host:~# cd fix_tar
root@host:~/fix_tar# ar x /var/cache/apt/archives/tar_1.26-4_amd64.deb

解压缩data.tar.gz文件以找到新的tar二进制文件:

root@host:~/fix_tar# ls -l
total 972
-rw-r--r-- 1 root root   2536 2012-02-03 12:20 control.tar.gz
-rw-r--r-- 1 root root 978996 2012-02-03 12:20 data.tar.gz
-rw-r--r-- 1 root root      4 2012-02-03 12:20 debian-binary
root@host:~/fix_tar# tar xzf data.tar.gz
root@host:~/fix_tar# find * -name tar
bin/tar
usr/share/doc/tar
usr/lib/mime/packages/tar

检查系统上的现有版本:

root@host:~/fix_tar# /bin/tar --version
tar (GNU tar) 1.20
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

备份旧版本,以防万一出现严重错误并需要将其恢复:

root@host:~/fix_tar# mv /bin/tar /bin/tar_1.20

放置新副本:

root@host:~/fix_tar# mv ./bin/tar /bin/tar

检查新版本:

root@host:~/fix_tar# /bin/tar --version
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

你完成了!:-)

然后,我可以继续进行下去:

root@host:~# aptitude update
root@host:~# aptitude safe-upgrade

很棒的答案!
mikewaters 2012年

1

您是否在其他地方(另一台计算机)上有tar的最新版本?
如果是这样,scp则将其/usr/local/bin假定为,假设/usr/local/bintar命令路径中的常规之前。然后,您可以升级:

apt-get install tar

1

用/ var / cache中可用的新版本替换tar ...对我完全有用。我花了很长时间试图弄清楚如何修复我的debian squeeze安装,以便通过修改源列表并愚蠢地让webmin尝试升级来解决新问题(严重错误)。非常感谢你们的直接回答。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.