비슷한 문제가 있습니다 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