View Issue Details

IDProjectCategoryView StatusLast Update
0009284Kali LinuxKali Package Bugpublic2025-09-05 03:00
Reporterwordeater Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0009284: pypy3 package fails to install with multiple errors
Description

With all other packages being up-to-date on my Kali Linux system, running sudo apt get install pypy3 produces numerous errors before eventually erroring out with a final error:

RPython traceback:
  File "rpython_jit_metainterp.c", line 61290, in BlackholeInterpreter_run
  File "rpython_jit_metainterp_2.c", line 16592, in dispatch_loop
Fatal RPython error: AssertionError
Aborted

The package ends up partially installed with a recommendation to run dpkg --reconfigure which results in the same error again.

I was originally trying to install pypy3-venv and pypy3-tk but was able to reproduce the same issue by just attempting to install pypy3 by itself.

I've attached the relevant apt / dpkg logs from /var/log/apt.

This is the version:

apt show pypy3
Package: pypy3
Version: 7.3.20+dfsg-2
Priority: optional
Section: python
Maintainer: Stefano Rivera <[email protected]>
Installed-Size: 62.2 MB
Pre-Depends: pypy3-lib (= 7.3.20+dfsg-2), libbz2-1.0, libc6 (>= 2.38), libexpat1 (>= 2.6.0), libffi8 (>= 3.4), libgcc-s1 (>= 4.2), libgdbm6t64 (>= 1.16), liblzma5 (>= 5.1.1alpha+20120614), libncursesw6>
Suggests: pypy3-doc, pypy3-tk (= 7.3.20+dfsg-2)
Breaks: pypy3-dev (<< 7.3.20+dfsg-2), python3-virtualenv (<< 20.13.0+ds-2~)
Homepage: https://www.pypy.org/
Tag: uitoolkit::ncurses
Download-Size: 10.4 MB
APT-Sources: http://http.kali.org/kali kali-rolling/main amd64 Packages
Description: fast alternative implementation of Python 3.x - PyPy interpreter
 PyPy is a fast, compliant alternative implementation of the Python language
 (3.x). It has several advantages and distinct features:
  * Speed: thanks to its Just-in-Time compiler (on x86), Python programs often
    run faster on PyPy.
  * Memory usage: large, memory-hungry Python programs might end up taking less
    space than they do in CPython.
  * Compatibility: PyPy is highly compatible with existing Python code.
    It supports ctypes and can run popular Python libraries like twisted and
    django.
  * Stackless: PyPy supports stackless mode on most platforms, providing
    micro-threads for massive concurrency.
 .
 This package contains the PyPy interpreter for Python 3.x.
Attached Files
history.log (626 bytes)   
Start-Date: 2025-09-04  15:21:55
Commandline: apt install pypy3
Requested-By: jrdepriest (1001)
Install: pypy3:amd64 (7.3.20+dfsg-2), pypy3-lib:amd64 (7.3.20+dfsg-2, automatic)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2025-09-04  15:26:13

Start-Date: 2025-09-04  15:29:38
Commandline: apt install pypy3
Requested-By: jrdepriest (1001)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2025-09-04  15:34:08

Start-Date: 2025-09-04  15:34:23
Commandline: apt remove pypy3 --purge
Requested-By: jrdepriest (1001)
Purge: pypy3:amd64 (7.3.20+dfsg-2)
End-Date: 2025-09-04  15:34:48
history.log (626 bytes)   
term.log (8,635 bytes)   
Log started: 2025-09-04  15:21:55
Selecting previously unselected package pypy3-lib:amd64.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 1047821 files and directories currently installed.)
Preparing to unpack .../pypy3-lib_7.3.20+dfsg-2_amd64.deb ...
Unpacking pypy3-lib:amd64 (7.3.20+dfsg-2) ...
Setting up pypy3-lib:amd64 (7.3.20+dfsg-2) ...
Selecting previously unselected package pypy3.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 1049071 files and directories currently installed.)
Preparing to unpack .../pypy3_7.3.20+dfsg-2_amd64.deb ...
Unpacking pypy3 (7.3.20+dfsg-2) ...
Setting up pypy3 (7.3.20+dfsg-2) ...
running pypy3 rtupdate hooks for 7.3
/usr/lib/python3/dist-packages/magic_ahupp.py:188: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if result is -1:
Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_api.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_api.py", line 20
    type SyntaxHighlight = Literal["css", "javascript", "xml", "yaml", "none", "error"]
         ^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_utils.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_utils.py", line 19
    type ContentviewMessage = (
         ^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_view_image/image_parser.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_view_image/image_parser.py", line 10
    type ImageMetadata = list[tuple[str, str]]
         ^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/net/dns/https_records.py:   File "/usr/lib/python3/dist-packages/mitmproxy/net/dns/https_records.py", line 35
    type HTTPSRecordJSON = dict[str | int, str | int]
         ^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/tools/web/app.py:   File "/usr/lib/python3/dist-packages/mitmproxy/tools/web/app.py", line 235
    def _require_auth[**P, R](
                     ^
SyntaxError: expected '('

Failed to byte-compile /usr/lib/python3/dist-packages/certipy/commands/shadow.py:   File "/usr/lib/python3/dist-packages/certipy/commands/shadow.py", line 496
    f"DeviceID: {key_credential_device_id or "Unknown"} | "
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: f-string: expecting '}'

Failed to byte-compile /usr/lib/python3/dist-packages/nxc/protocols/nfs.py:   File "/usr/lib/python3/dist-packages/nxc/protocols/nfs.py", line 265
    self.logger.highlight(f"{self.auth['uid']:<11}{'r' if read_perm else '-'}{'w' if write_perm else '-'}{('x' if exec_perm else '-'):<7}{convert_size(used_space) + "/" + convert_size(total_space):<16} {share:<30} {', '.join(network) if network else 'No network':<15}")
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: f-string: expecting '}'

RPython traceback:
  File "rpython_jit_metainterp.c", line 61290, in BlackholeInterpreter_run
  File "rpython_jit_metainterp_2.c", line 16592, in dispatch_loop
Fatal RPython error: AssertionError
Aborted
error running pypy3 rtupdate hook public_modules.rtupdate
dpkg: error processing package pypy3 (--configure):
 installed pypy3 package post-installation script subprocess returned error exit status 4
Processing triggers for man-db (2.13.1-1) ...
Processing triggers for kali-menu (2025.3.0) ...
Errors were encountered while processing:
 pypy3
Log ended: 2025-09-04  15:26:13

Log started: 2025-09-04  15:29:38
Setting up pypy3 (7.3.20+dfsg-2) ...
running pypy3 rtupdate hooks for 7.3
/usr/lib/python3/dist-packages/magic_ahupp.py:188: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if result is -1:
Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_api.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_api.py", line 20
    type SyntaxHighlight = Literal["css", "javascript", "xml", "yaml", "none", "error"]
         ^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_utils.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_utils.py", line 19
    type ContentviewMessage = (
         ^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_view_image/image_parser.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_view_image/image_parser.py", line 10
    type ImageMetadata = list[tuple[str, str]]
         ^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/net/dns/https_records.py:   File "/usr/lib/python3/dist-packages/mitmproxy/net/dns/https_records.py", line 35
    type HTTPSRecordJSON = dict[str | int, str | int]
         ^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/tools/web/app.py:   File "/usr/lib/python3/dist-packages/mitmproxy/tools/web/app.py", line 235
    def _require_auth[**P, R](
                     ^
SyntaxError: expected '('

Failed to byte-compile /usr/lib/python3/dist-packages/certipy/commands/shadow.py:   File "/usr/lib/python3/dist-packages/certipy/commands/shadow.py", line 496
    f"DeviceID: {key_credential_device_id or "Unknown"} | "
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: f-string: expecting '}'

Failed to byte-compile /usr/lib/python3/dist-packages/nxc/protocols/nfs.py:   File "/usr/lib/python3/dist-packages/nxc/protocols/nfs.py", line 265
    self.logger.highlight(f"{self.auth['uid']:<11}{'r' if read_perm else '-'}{'w' if write_perm else '-'}{('x' if exec_perm else '-'):<7}{convert_size(used_space) + "/" + convert_size(total_space):<16} {share:<30} {', '.join(network) if network else 'No network':<15}")
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: f-string: expecting '}'

RPython traceback:
  File "rpython_jit_metainterp.c", line 61290, in BlackholeInterpreter_run
  File "rpython_jit_metainterp_2.c", line 16592, in dispatch_loop
Fatal RPython error: AssertionError
Aborted
error running pypy3 rtupdate hook public_modules.rtupdate
dpkg: error processing package pypy3 (--configure):
 installed pypy3 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 pypy3
Log ended: 2025-09-04  15:34:08

Log started: 2025-09-04  15:34:23
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 1049103 files and directories currently installed.)
Removing pypy3 (7.3.20+dfsg-2) ...
running pypy3 rtremove hooks for pypy3_7.3.20
Processing triggers for man-db (2.13.1-1) ...
Processing triggers for kali-menu (2025.3.0) ...
Log ended: 2025-09-04  15:34:48
term.log (8,635 bytes)   

Activities

arnaudr

arnaudr

2025-09-05 03:00

manager   ~0020809

I tried to reproduce, simply by running a kali-rolling container and installing pypy3: no error.

Then I tried to reproduce your scenario, first installed some Python packages:

apt update && apt install  mitmproxy certipy-ad python3-magic-ahupp netexec

Then install pypy3, which indeed makes some noise:

Setting up pypy3 (7.3.20+dfsg-2) ...
running pypy3 rtupdate hooks for 7.3
/usr/lib/python3/dist-packages/magic_ahupp.py:188: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if result is -1:
Failed to byte-compile /usr/lib/python3/dist-packages/nxc/protocols/nfs.py:   File "/usr/lib/python3/dist-packages/nxc/protocols/nfs.py", line 265
    self.logger.highlight(f"{self.auth['uid']:<11}{'r' if read_perm else '-'}{'w' if write_perm else '-'}{('x' if exec_perm else '-'):<7}{convert_size(used_space) + "/" + convert_size(total_space):<16} {share:<30} {', '.join(network) if network 
else 'No network':<15}")
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: f-string: expecting '}'

Failed to byte-compile /usr/lib/python3/dist-packages/certipy/commands/shadow.py:   File "/usr/lib/python3/dist-packages/certipy/commands/shadow.py", line 496
    f"DeviceID: {key_credential_device_id or "Unknown"} | "
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: f-string: expecting '}'

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/net/dns/https_records.py:   File "/usr/lib/python3/dist-packages/mitmproxy/net/dns/https_records.py", line 35
    type HTTPSRecordJSON = dict[str | int, str | int]
         ^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_api.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_api.py", line 20
    type SyntaxHighlight = Literal["css", "javascript", "xml", "yaml", "none", "error"]
         ^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_utils.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_utils.py", line 19
    type ContentviewMessage = (
         ^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/contentviews/_view_image/image_parser.py:   File "/usr/lib/python3/dist-packages/mitmproxy/contentviews/_view_image/image_parser.py", line 10
    type ImageMetadata = list[tuple[str, str]]
         ^^^^^^^^^^^^^
SyntaxError: invalid syntax

Failed to byte-compile /usr/lib/python3/dist-packages/mitmproxy/tools/web/app.py:   File "/usr/lib/python3/dist-packages/mitmproxy/tools/web/app.py", line 235
    def _require_auth[**P, R](
                     ^
SyntaxError: expected '('

running pypy3 post-rtupdate hooks for 7.3
Processing triggers for libc-bin (2.41-12) ...

From the description of the pypy3 package, it says: fast alternative implementation of Python 3.x - PyPy interpreter

So it looks like pypy3, upon installation, tries to byte-compile all the Python files that are on your system. And it fails to compile some, which is probably Ok? In any case, for me it doesn't fail apt.

Note that I don't have the lines:

RPython traceback:
  File "rpython_jit_metainterp.c", line 61290, in BlackholeInterpreter_run
  File "rpython_jit_metainterp_2.c", line 16592, in dispatch_loop
Fatal RPython error: AssertionError
Aborted

I looked for the file rpython_jit_metainterp.c but couldn't find it, the command

apt-file search rpython_jit_metainterp.c

gives no result. Maybe something you installed from somewhere else (ie. not via apt)?

Bottom-line: not really a bug in Kali. In any case, pypy3 is a package that comes from Debian, we don't package it ourselves. We also can't support alternative implementation of Python 3.x.

Issue History

Date Modified Username Field Change
2025-09-04 19:43 wordeater New Issue
2025-09-04 19:43 wordeater File Added: history.log
2025-09-04 19:43 wordeater File Added: term.log
2025-09-05 03:00 arnaudr Note Added: 0020809