dpkg-query: package 'python-meep' is not installed

961 views Asked by At

It seems my instance of python3 (on a Kubuntu virtual box) asked to install meep as part of some other package installation process. That installation failed, and now every time I try to install a packages I get a meep-related installation error. For instance, this just happened today.

pel@pel-VirtualBox:~/work$ sudo apt install pipenv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm9
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  python3-appdirs python3-distlib python3-filelock python3-virtualenv
  python3-virtualenv-clone
The following NEW packages will be installed:
  pipenv python3-appdirs python3-distlib python3-filelock python3-virtualenv
  python3-virtualenv-clone
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 3,465 kB of archives.
After this operation, 13.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-appdirs all 1.4.3-2.1 [10.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-distlib all 0.3.0-1 [116 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-filelock all 3.0.12-2 [7,948 B]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-virtualenv all 20.0.17-1 [63.4 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-virtualenv-clone all 0.3.0-2 [8,696 B]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 pipenv all 11.9.0-1 [3,258 kB]
Fetched 3,465 kB in 2s (1,760 kB/s) 
Selecting previously unselected package python3-appdirs.
(Reading database ... 287182 files and directories currently installed.)
Preparing to unpack .../0-python3-appdirs_1.4.3-2.1_all.deb ...
Unpacking python3-appdirs (1.4.3-2.1) ...
Selecting previously unselected package python3-distlib.
Preparing to unpack .../1-python3-distlib_0.3.0-1_all.deb ...
Unpacking python3-distlib (0.3.0-1) ...
Selecting previously unselected package python3-filelock.
Preparing to unpack .../2-python3-filelock_3.0.12-2_all.deb ...
Unpacking python3-filelock (3.0.12-2) ...
Selecting previously unselected package python3-virtualenv.
Preparing to unpack .../3-python3-virtualenv_20.0.17-1_all.deb ...
Unpacking python3-virtualenv (20.0.17-1) ...
Selecting previously unselected package python3-virtualenv-clone.
Preparing to unpack .../4-python3-virtualenv-clone_0.3.0-2_all.deb ...
Unpacking python3-virtualenv-clone (0.3.0-2) ...
Selecting previously unselected package pipenv.
Preparing to unpack .../5-pipenv_11.9.0-1_all.deb ...
Unpacking pipenv (11.9.0-1) ...
Setting up python3-filelock (3.0.12-2) ...
Setting up python3-virtualenv-clone (0.3.0-2) ...
Setting up python3-distlib (0.3.0-1) ...
Setting up python3-meep (1.12.0-2build2) ...
dpkg-query: package 'python-meep' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 289, in <module>
    main()
  File "/usr/bin/pycompile", line 262, in main
    options.force, options.optimize, e_patterns)
  File "/usr/bin/pycompile", line 154, in compile
    for fn, versions_to_compile in filter_files(files, e_patterns, versions):
  File "/usr/bin/pycompile", line 109, in filter_files
    for fn in files:
  File "/usr/share/python/debpython/files.py", line 77, in filter_out_ext
    for fn in files:
  File "/usr/share/python/debpython/namespace.py", line 77, in add_namespace_files
    for fn in files:
  File "/usr/share/python/debpython/files.py", line 69, in filter_public
    for fn in files:
  File "/usr/share/python/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of python-meep
dpkg: error processing package python3-meep (--configure):
 installed python3-meep package post-installation script subprocess returned error exit status 1
Setting up python3-appdirs (1.4.3-2.1) ...
Setting up python3-virtualenv (20.0.17-1) ...
Setting up pipenv (11.9.0-1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Errors were encountered while processing:
 python3-meep
E: Sub-process /usr/bin/dpkg returned an error code (1)

No amount of auto-removing purging or removing has had any effect. Update and upgrading have not worked. I'm at wits end. Does anyone have any suggestions short of ripping out python and reinstalling everything?

1

There are 1 answers

1
Subimal On BEST ANSWER

I had the same issue on my system. I have done something that is most likely not recommended. I did not have a choice except taking the risk. If you follow the procedure below, you are also taking a risk. However, the only assurance is that it worked for me.

The guilty package is python3-meep. It perhaps got upgraded without the package name being changed internally. This is where I confirmed the issue. A search revealed that the issue has been reported and fixed in Debian. It will perhaps take some time to make its way through to Ubuntu

$grep python-meep /var/lib/dpkg/info/python3-meep.*
/var/lib/dpkg/info/python3-meep.postinst:  pycompile -p python-meep
/var/lib/dpkg/info/python3-meep.prerm:  pyclean -p python-meep 
/var/lib/dpkg/info/python3-meep.prerm:  dpkg -L python-meep | grep \.py$ | while read file

So in the file

  • /var/lib/dpkg/info/python3-meep.postinst I replaced the occurrence of python-meep with python3-meep.
  • /var/lib/dpkg/info/python3-meep.prerm I replaced two occurrences of python-meep with python3-meep.

Then I could remove python3-meep

$ sudo apt-get remove python3-meep
 Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  python3-meep
0 upgraded, 0 newly installed, 1 to remove and 17 not upgraded.
1 not fully installed or removed.
After this operation, 3,225 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 371161 files and directories currently installed.)
Removing python3-meep (1.12.0-2build2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
$

I would appreciate if someone points to a cleaner approach.