chroot 환경 내에서 스크립트를 실행할 때 오류가 발생했습니다.

chroot 환경 내에서 스크립트를 실행할 때 오류가 발생했습니다.

나는 일부 패키지를 제거 및 제거하고 chroot 환경(debian 9) 내에 새 패키지를 설치하는 작은 스크립트를 작성했지만 스크립트를 실행할 때 스크립트가 제거 명령을 실행할 때 다음 오류가 발생했습니다.

Fetched 355 B in 4s (88 B/s)       
(appstreamcli:8321): GLib-CRITICAL **: 14:31:37.785: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed
(appstreamcli:8321): GLib-CRITICAL **: 14:31:37.785: g_variant_new_variant: assertion 'value != NULL' failed
(appstreamcli:8321): GLib-ERROR **: 14:31:37.785: g_variant_new_parsed: 11-13:invalid GVariant format string
Trace/breakpoint trap (core dumped)
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code
Reading package lists... Done

그리고 이것은 내 스크립트입니다:

#!/bin/bash
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts

export HOME=/root
export LC_ALL=C

apt update
apt-get remove --purge -y gnome* kodi* tilix* rhythmbox*
apt -y autoremove
apt install -y mate-desktop-environment-extras gparted vlc gksu
apt-get purge --no-install-recommends -y linux-image-4.16* linux-image-4.17*
apt -y autoremove
umount /proc || umount -lf /proc
umount /sys
umount /dev/pts

exit

그럼 이 오류를 어떻게 고칠 수 있나요?

답변1

검색 후 chroot 내부의 패키지를 제거하여 문제를 해결했습니다 appstream.

# apt purge appstream

그런 다음 다음 autoremove명령을 사용하여 제거 명령을 실행합니다.

# apt-get remove --purge -y gnome* kodi* tilix* rhythmbox* && apt autoremove

appstearm패키지를 다시 설치하면

답변2

실행할 때 비슷한 문제가 발생했습니다.

sudo apt-get upgrade

거의 동일한 오류가 발생했습니다. 콘솔에서는 다음을 실행하도록 권장했습니다.

sudo apt --fix-broken install

그리고 그것은 나를 위해 오류를 해결했습니다.

관련 정보