sezanzeb / input-remapper

🎮 ⌨ An easy to use tool to change the behaviour of your input devices.
GNU General Public License v3.0
3.89k stars 161 forks source link

Debian Bullseye install from git gives E: Sub-process /usr/bin/dpkg returned an error code (1) #703

Open Jackfritt opened 1 year ago

Jackfritt commented 1 year ago

uname -a Linux 6.0.0-0.deb11.2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.3-1~bpo11+1 (2022-10-29) x86_64 GNU/Linux

cat /etc/debian_version 11.7

sudo apt install git python3-setuptools gettext
cd input-remapper && ./scripts/build.sh
cd input-remapper && LC_ALL=C ./scripts/build.sh
running install
/home/kvm/.local/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
generating translation for it
generating translation for uk_UA
generating translation for it_IT
generating translation for sk
generating translation for zh
generating translation for zh_CN
generating translation for ru_RU
generating translation for fr
generating translation for uk
generating translation for sk_SK
generating translation for fr_FR
generating translation for ru
running build
running build_py
running egg_info
writing input_remapper.egg-info/PKG-INFO
writing dependency_links to input_remapper.egg-info/dependency_links.txt
writing requirements to input_remapper.egg-info/requires.txt
writing top-level names to input_remapper.egg-info/top_level.txt
reading manifest file 'input_remapper.egg-info/SOURCES.txt'
adding license file 'LICENSE'
running install_lib
copying build/lib/inputremapper/groups.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/configs/validation_errors.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/input_config.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/global_config.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/base_config.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/migrations.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/system_mapping.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/mapping.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/preset.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/data.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/configs/paths.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/configs
copying build/lib/inputremapper/injection/macros/parse.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/macros
copying build/lib/inputremapper/injection/macros/macro.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/macros
copying build/lib/inputremapper/injection/macros/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/macros
copying build/lib/inputremapper/injection/mapping_handlers/combination_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/axis_switch_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/mapping_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/hierarchy_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/abs_to_btn_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/rel_to_abs_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/axis_transform.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/abs_to_abs_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/rel_to_btn_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/macro_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/mapping_parser.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/key_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/abs_to_rel_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/rel_to_rel_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/mapping_handlers/null_handler.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection/mapping_handlers
copying build/lib/inputremapper/injection/event_reader.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection
copying build/lib/inputremapper/injection/injector.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection
copying build/lib/inputremapper/injection/numlock.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection
copying build/lib/inputremapper/injection/global_uinputs.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection
copying build/lib/inputremapper/injection/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection
copying build/lib/inputremapper/injection/context.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/injection
copying build/lib/inputremapper/exceptions.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/ipc/socket.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/ipc
copying build/lib/inputremapper/ipc/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/ipc
copying build/lib/inputremapper/ipc/pipe.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/ipc
copying build/lib/inputremapper/ipc/shared_dict.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/ipc
copying build/lib/inputremapper/commit_hash.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/daemon.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/input_event.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/gui/messages/message_broker.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/messages
copying build/lib/inputremapper/gui/messages/message_data.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/messages
copying build/lib/inputremapper/gui/messages/message_types.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/messages
copying build/lib/inputremapper/gui/messages/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/messages
copying build/lib/inputremapper/gui/controller.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/reader_client.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/autocompletion.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/user_interface.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/reader_service.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/gettext.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/components/device_groups.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/components
copying build/lib/inputremapper/gui/components/__init__.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/components
copying build/lib/inputremapper/gui/components/editor.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/components
copying build/lib/inputremapper/gui/components/common.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/components
copying build/lib/inputremapper/gui/components/presets.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/components
copying build/lib/inputremapper/gui/components/main.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui/components
copying build/lib/inputremapper/gui/data_manager.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/gui/utils.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper/gui
copying build/lib/inputremapper/user.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/logger.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
copying build/lib/inputremapper/utils.py -> build/deb/usr/lib/python3.9/site-packages/inputremapper
running install_data
running install_egg_info
running install_scripts
mv: cannot stat 'build/deb/usr/local/lib/python3.*/': No such file or directory
dpkg-deb: building package 'input-remapper' in 'dist/input-remapper-2.0.0.deb'.
LC_ALL=C sudo apt install -f ./dist/input-remapper-2.0.0.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'input-remapper' instead of './dist/input-remapper-2.0.0.deb'
input-remapper is already the newest version (2.0.0).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up input-remapper (2.0.0) ...
Failed to disable unit: Unit file key-mapper.service does not exist.
Failed to stop key-mapper.service: Unit key-mapper.service not loaded.
Job for input-remapper.service failed because the control process exited with error code.
See "systemctl status input-remapper.service" and "journalctl -xe" for details.
dpkg: error processing package input-remapper (--configure):
 installed input-remapper package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 input-remapper
E: Sub-process /usr/bin/dpkg returned an error code (1)

Remove also dont work now ;)

LC_ALL=C sudo apt remove -f ./dist/input-remapper-2.0.0.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'input-remapper' instead of './dist/input-remapper-2.0.0.deb'
input-remapper is already the newest version (2.0.0).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up input-remapper (2.0.0) ...
Failed to disable unit: Unit file key-mapper.service does not exist.
Failed to stop key-mapper.service: Unit key-mapper.service not loaded.
Job for input-remapper.service failed because the control process exited with error code.
See "systemctl status input-remapper.service" and "journalctl -xe" for details.
dpkg: error processing package input-remapper (--configure):
 installed input-remapper package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 input-remapper
E: Sub-process /usr/bin/dpkg returned an error code (1)

any hints?

Never had key-mapper.service installed.... maybe thats the problem?

KG-khangelani commented 1 year ago

Try this way. I fixed my issue with Mariadb giving me the same error with. I tried all the other way this seemed to work. Just replace the mariadb with key-mapper or key-mapper.

sudo apt purge mariadb* -y | sudo apt purge mysql* -y
sudo apt autoremove -y | sudo apt autoclean -y
sudo rm -R /usr/share/Mariad* | sudo rm -R /usr/share/Mysq*
sudo apt-get install mariadb-server
sudo apt update

Hope this helps✨

sezanzeb commented 1 year ago

Never had key-mapper.service installed.... maybe thats the problem?

Those errors are fine, this is from https://github.com/sezanzeb/input-remapper/blob/main/DEBIAN/postinst, which makes sure old services with the old name are not running in parallel.

sezanzeb commented 1 year ago

input-remapper will require python 3.10 though. Try installing https://github.com/sezanzeb/input-remapper/releases/tag/1.5.1 if you haven't upgraded your system in the meantime

sezanzeb commented 1 year ago

Since it reaches postinst, is input-remapper installed, but just doesn't start? Have you tried running sudo input-remapper-service after the installation attempt?

Jackfritt commented 1 year ago

Didnt upgrade the system to python3.10 thats to much trouble for my system.

So went on with 3.9

git checkout tags/1.5.1

LC_ALL=C sudo apt install -f ./dist/input-remapper-1.5.1.deb

Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'input-remapper' instead of './dist/input-remapper-1.5.1.deb' The following packages will be DOWNGRADED: input-remapper 0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 0 B/216 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Get:1 /home/kvm/src/input-remapper/dist/input-remapper-1.5.1.deb input-remapper all 1.5.1 [216 kB] dpkg: warning: downgrading input-remapper from 2.0.0 to 1.5.1 (Reading database ... 498103 files and directories currently installed.) Preparing to unpack .../dist/input-remapper-1.5.1.deb ... Unpacking input-remapper (1.5.1) over (2.0.0) ... Setting up input-remapper (1.5.1) ... Failed to disable unit: Unit file key-mapper.service does not exist. Failed to stop key-mapper.service: Unit key-mapper.service not loaded. Job for input-remapper.service failed because the control process exited with error code. See "systemctl status input-remapper.service" and "journalctl -xe" for details. dpkg: error processing package input-remapper (--configure): installed input-remapper package post-installation script subprocess returned error exit status 1 Processing triggers for mailcap (3.69) ... Processing triggers for desktop-file-utils (0.26-1) ... Processing triggers for dbus (1.12.24-0+deb11u1) ... Errors were encountered while processing: input-remapper E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo input-remapper-service

Traceback (most recent call last): File "/usr/bin/input-remapper-service", line 28, in from inputremapper.logger import update_verbosity, log_info ModuleNotFoundError: No module named 'inputremapper'

LC_ALL=C sudo apt remove -f ./dist/input-remapper-1.5.1.deb

Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'input-remapper' instead of './dist/input-remapper-1.5.1.deb' input-remapper is already the newest version (1.5.1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Setting up input-remapper (1.5.1) ... Failed to disable unit: Unit file key-mapper.service does not exist. Failed to stop key-mapper.service: Unit key-mapper.service not loaded. Job for input-remapper.service failed because the control process exited with error code. See "systemctl status input-remapper.service" and "journalctl -xe" for details. dpkg: error processing package input-remapper (--configure): installed input-remapper package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: input-remapper E: Sub-process /usr/bin/dpkg returned an error code (1)

Still cant uninstall.

Also found this. Maybe thats the problem?

Aug 21 10:06:36 systemd[1]: Starting Service to inject keycodes without the GUI application... Aug 21 10:06:36 input-remapper-service[1285438]: Traceback (most recent call last): Aug 21 10:06:36 input-remapper-service[1285438]: File "/usr/bin/input-remapper-service", line 28, in Aug 21 10:06:36 input-remapper-service[1285438]: from inputremapper.logger import update_verbosity, log_info Aug 21 10:06:36 input-remapper-service[1285438]: ModuleNotFoundError: No module named 'inputremapper' Aug 21 10:06:36 systemd[1]: input-remapper.service: Main process exited, code=exited, status=1/FAILURE Aug 21 10:06:36 systemd[1]: input-remapper.service: Failed with result 'exit-code'. Aug 21 10:06:36 systemd[1]: Failed to start Service to inject keycodes without the GUI application.

Jackfritt commented 1 year ago

The real problem is me trying to install it on python < 3.10 . Just write it somewhere(didnt know that until you said it here :) ) or check it in the build? install scripts?

I will wait for a next Debian release when its included :)

ty for support!

Jackfritt commented 1 year ago

Use this to remove broken package

sudo dpkg --remove --force-remove-reinstreq input-remapper

sezanzeb commented 1 year ago

ModuleNotFoundError: No module named 'inputremapper'

This usually happens because python paths are somehow incorrect. Happens after python upgrades, or because of stuff like conda or active pipenvs. https://github.com/sezanzeb/input-remapper/issues/723#issuecomment-1605656474