Ubuntu python 구성 또는 dpkg: 청소 중 오류 발생:

Ubuntu python 구성 또는 dpkg: 청소 중 오류 발생:

일주일 동안 내 컴퓨터에 아무것도 설치할 수 없으며 적절한 업데이트를 하려는 경우에도 오류가 발생합니다. 미리 감사드립니다.

sudo apt update(sudo apt update와 동일):

Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2196 kB]
Fetched 2532 kB in 2s (1349 kB/s)
/usr/lib/cnf-update-db: 3: import: not found
/usr/lib/cnf-update-db: 4: import: not found
/usr/lib/cnf-update-db: 5: import: not found
/usr/lib/cnf-update-db: 6: import: not found
from: can't read /var/mail/CommandNotFound.db.creator
from: can't read /var/mail/CommandNotFound
/usr/lib/cnf-update-db: 14: Syntax error: word unexpected (expecting ")")
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

sudo apt install -f

...
/usr/bin/py3clean: 26: import: not found
from: can't read /var/mail/glob
from: can't read /var/mail/os
from: can't read /var/mail/os.path
/usr/bin/py3clean: 31: Syntax error: word unexpected (expecting ")")
dpkg: warning: old python3-pil:amd64 package pre-removal script subprocess returned error exit status 2
dpkg: trying script from the new package instead ...
/usr/bin/py3clean: 24: import: not found

/usr/bin/py3compile: 33: Syntax error: word unexpected (expecting ")")
dpkg: error while cleaning up:
 installed python3-pil:amd64 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/python3-pil_7.0.0-4ubuntu0.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

예를 들어, binwalk를 설치하고 싶을 때

sudo apt install binwalk

Reading package lists... Done
Building dependency tree
Reading state information... Done
binwalk is already the newest version (2.2.0+dfsg1-1).
The following packages were automatically installed and are no longer required:
  aircrack-ng hwloc ieee-data liblua5.2-0 libsbc1 libsmi2ldbl libspandsp2 libspeexdsp1 libssh-gcrypt-4
  libwireshark-data libwireshark13 libwiretap10 libwsutil11 net-tools pixiewps reaver rfkill tshark wireshark-common
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  python-pil-doc python3-pil-dbg
The following packages will be upgraded:
  python3-pil
1 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
11 not fully installed or removed.
Need to get 0 B/414 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 87359 files and directories currently installed.)
Preparing to unpack .../python3-pil_7.0.0-4ubuntu0.6_amd64.deb ...
/usr/bin/py3clean: 24: import: not found
/usr/bin/py3clean: 25: import: not found
/usr/bin/py3clean: 26: import: not found
from: can't read /var/mail/glob
from: can't read /var/mail/os
from: can't read /var/mail/os.path
/usr/bin/py3clean: 31: Syntax error: word unexpected (expecting ")")
dpkg: warning: old python3-pil:amd64 package pre-removal script subprocess returned error exit status 2
dpkg: trying script from the new package instead ...
/usr/bin/py3clean: 24: import: not found
/usr/bin/py3clean: 25: import: not found
/usr/bin/py3clean: 26: import: not found
from: can't read /var/mail/glob
from: can't read /var/mail/os
from: can't read /var/mail/os.path
/usr/bin/py3clean: 31: Syntax error: word unexpected (expecting ")")
dpkg: error processing archive /var/cache/apt/archives/python3-pil_7.0.0-4ubuntu0.6_amd64.deb (--unpack):
 new python3-pil:amd64 package pre-removal script subprocess returned error exit status 2
/usr/bin/py3compile: 25: import: not found
/usr/bin/py3compile: 26: import: not found
/usr/bin/py3compile: 27: import: not found
/usr/bin/py3compile: 28: import: not found
/usr/bin/py3compile: 29: import: not found
from: can't read /var/mail/os
from: can't read /var/mail/os.path
from: can't read /var/mail/subprocess
/usr/bin/py3compile: 33: Syntax error: word unexpected (expecting ")")
dpkg: error while cleaning up:
 installed python3-pil:amd64 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/python3-pil_7.0.0-4ubuntu0.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

내 문제를 해결할 것이라고 생각되는 인터넷에서 찾은 모든 방법을 시도했지만 아무것도 효과가 없었습니다. sudo apt clean sudo dpkg --configure -a

...
dpkg: error processing package muon (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Errors were encountered while processing:
 python3
 python3-pil:amd64
 python3-xapian
 python3-pip
 apt-xapian-index
 software-properties-qt
 muon

관련 정보