polipo E: 子进程 /usr/bin/dpkg 返回错误代码 (1)

polipo E: 子进程 /usr/bin/dpkg 返回错误代码 (1)
@me:/home$ sudo apt-get install polipo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
polipo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 198 kB of archives.
After this operation, 799 kB of additional disk space will be used.
Get:1 http://sy.archive.ubuntu.com/ubuntu/ precise/universe polipo amd64 
1.0.4.1-1.1 [198 kB]
    Fetched 198 kB in 2s (97.5 kB/s)                        
    Selecting previously unselected package polipo.
    (Reading database ... 169595 files and directories currently installed.)
Unpacking polipo (from .../polipo_1.0.4.1-1.1_amd64.deb) ...
Processing triggers for doc-base ...
Processing 1 added doc-base file...
Processing triggers for man-db ...
Processing triggers for install-info ...
Processing triggers for ureadahead ...
Setting up polipo (1.0.4.1-1.1) ...
Starting polipo: Couldn't open config file /etc/polipo/config: 2.
invoke-rc.d: initscript polipo, action "start" failed.
****dpkg: error processing polipo (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
polipo
E: Sub-process /usr/bin/dpkg returned an error code (1)****

答案1

问题可能出在你的配置文件上。我建议你备份原始配置文件/etc/polipo/config并下载 提供的配置文件torbrowser

以下是步骤

sudo mv /etc/polipo/config /etc/polipo/config.orig
sudo wget https://gitweb.torproject.org/torbrowser.git/blob/ae4aa49ad9100a50eec049d0a419fac63a84d874:/build-scripts/config/polipo.conf \
-O /etc/polipo/config

现在尝试重新运行该命令

sudo apt-get install polipo

希望这可以帮助

答案2

我收到此错误是因为我卸载了 polipo 并在 /etc/polipo/ 中 rm 配置文件。

我按照以下方法修复它:

只需一步一步运行命令:

sudo dpkg --configure -a

sudo apt-get install -f

sudo apt update 

sudo apt upgrade 

参考:https://itsfoss.com/dpkg-returned-an-error-code-1/

相关内容