/usr/bin/dpkg: 1: /usr/bin/dpkg: 语法错误:意外单词(预期“)”)

/usr/bin/dpkg: 1: /usr/bin/dpkg: 语法错误:意外单词(预期“)”)

root@tet0-Lenovo-G500s:~# sudo apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 debianutils git-man krb5-locales less libbsd0 libcurl3-gnutls libedit2 liberror-perl
 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libnghttp2-14 libpsl5
 librtmp1 libssl1.0.0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1
 multiarch-support openssh-client publicsuffix xauth
Suggested packages:
 gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb
 git-cvs git-mediawiki git-svn krb5-doc krb5-user keychain libpam-ssh monkeysphere ssh-askpass
The following NEW packages will be installed:
 debianutils git git-man krb5-locales less libbsd0 libcurl3-gnutls libedit2 liberror-perl
 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libnghttp2-14 libpsl5
 librtmp1 libssl1.0.0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1
 multiarch-support openssh-client publicsuffix xauth
0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
21 not fully installed or removed.
Need to get 0 B/8,915 kB of archives.
After this operation, 55.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
/usr/bin/dpkg: 1: /usr/bin/dpkg: Syntax error: word unexpected (expecting ")")
E: Sub-process /usr/bin/dpkg returned an error code (2)

答案1

好的,32 位。

mkdir $HOME/dpkg 

进入这个目录

cd $HOME/dpkg

然后使用 wget 下载 dpkg。

wget -c http://mirrors.kernel.org/ubuntu/pool/main/d/dpkg/dpkg_1.19.0.5ubuntu2_i386.deb

解压 deb 包。

ar x dpkg_1.19.0.5ubuntu2_i386.deb 

然后我们提取数据。

tar xf data.tar.xz 

然后替换错误的 dpkg。

sudo cp ./usr/bin/dpkg /usr/bin/dpkg

然后尝试

sudo apt-get clean && sudo dpkg --configure -a

当 dpkg 再次工作时。

dpkg --print-foreign-architectures 

如果你得到输出,

删除外部架构

但你必须根据你的情况进行调整。你必须将 i386 部分更改为从输出中获得的部分。我希望最后一部分是可以理解的。

如果您不确定,请显示上一个命令的输出。

相关内容