同様の問題があります dpkg:新しいプレインストールスクリプトはエラー終了ステータス1を返します。
PacketTracer 7.3.1をインストールしようとしたときに上記のエラーが発生しました。 EULAを拒否したようです。私はbashとdebconfについて何も知りません。このスクリプトを修正する方法を知っている人はいますか?
#!/bin/sh -e
# Source debconf library.
. /usr/share/debconf/confmodule
remove_pt ()
{
if [ -e /opt/pt ]; then
echo "Removing old version of Packet Tracer from /opt/pt"
sudo rm -rf /opt/pt
sudo rm -rf /usr/share/applications/cisco-pt7.desktop
sudo rm -rf /usr/share/applications/cisco-ptsa7.desktop
sudo rm -rf /usr/share/icons/hicolor/48x48/apps/pt7.png
fi
}
db_fset PacketTracer_731_amd64/show-eula seen false
db_fset PacketTracer_731_amd64/accept-eula seen false
STATE=1
while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
case "$STATE" in
1)
db_input critical PacketTracer_731_amd64/show-eula || true
;;
2)
db_input critical PacketTracer_731_amd64/accept-eula || true
;;
3)
db_get PacketTracer_731_amd64/accept-eula
if [ "$RET" = "false" ]; then
exit 1
fi
;;
esac
if db_go; then
STATE=$(($STATE + 1))
else
STATE=$(($STATE - 1))
fi
done
これは preinst スクリプトに set -x を追加し、パッケージをインストールしようとした後に得られたものです。
+ . /usr/share/debconf/confmodule
+ [ ! ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [ ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/tmp.ci/preinst install 8.0.0 7.3.1
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z ]
+ exec
+ [ ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ db_fset PacketTracer_731_amd64/show-eula seen false
+ _db_cmd FSET PacketTracer_731_amd64/show-eula seen false
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n FSET PacketTracer_731_amd64/show-eula seen false
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=false
+ return 0
+ db_fset PacketTracer_731_amd64/accept-eula seen false
+ _db_cmd FSET PacketTracer_731_amd64/accept-eula seen false
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n FSET PacketTracer_731_amd64/accept-eula seen false
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=false
+ return 0
+ STATE=1
+ [ 1 != 0 -a 1 != 4 ]
+ db_input critical PacketTracer_731_amd64/show-eula
+ _db_cmd INPUT critical PacketTracer_731_amd64/show-eula
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n INPUT critical PacketTracer_731_amd64/show-eula
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=question will be asked
+ return 0
+ db_go
+ _db_cmd GO
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n GO
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=ok
+ return 0
+ STATE=2
+ [ 2 != 0 -a 2 != 4 ]
+ db_input critical PacketTracer_731_amd64/accept-eula
+ _db_cmd INPUT critical PacketTracer_731_amd64/accept-eula
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n INPUT critical PacketTracer_731_amd64/accept-eula
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=question will be asked
+ return 0
+ db_go
+ _db_cmd GO
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n GO
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=ok
+ return 0
+ STATE=3
+ [ 3 != 0 -a 3 != 4 ]
+ db_get PacketTracer_731_amd64/accept-eula
+ _db_cmd GET PacketTracer_731_amd64/accept-eula
+ _db_internal_IFS=
+ IFS=
+ printf %%s\n GET PacketTracer_731_amd64/accept-eula
+ IFS=
+ IFS=
read -r _db_internal_line
+ RET=false
+ return 0
+ [ false = false ]
+ exit 1
dpkg: error processing archive /home/yanaz/Pobrane/packet_tracer_modified.deb (--install):
new packettracer package pre-installation script subprocess returned error exit status 1
gtk-update-icon-cache: Cache file created successfully.```
答え1
EULAの選択を変更するには、データベースに保存されている値を直接変更できますdebconf
。
debconf-get-selections |
grep PacketTracer_731_amd64/accept-eula |
sed s/false/true/ |
sudo debconf-set-selections
次に、保留中のパッケージを構成します。
sudo dpkg-reconfigure --pending