termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.32k stars 3.06k forks source link

[Bug]: Cannot install xdotool package (E: Package 'xdotool' has no installation candidate) #19544

Closed AntonSamokat closed 7 months ago

AntonSamokat commented 7 months ago

Problem description

Corresponding Pull Request for xdotool package : https://github.com/termux/termux-packages/pull/12451

What steps will reproduce the bug?

After running

pkg install xdotool

There is error - E: Package 'xdotool' has no installation candidate

No mirror or mirror group selected. You might want to select one by running 'termux-change-repo'
Testing the available mirrors:
[*] (10) https://packages-cf.termux.dev/apt/termux-main: ok
[*] (1) https://mirrors.cbrx.io/apt/termux/termux-main: ok
[*] (1) https://mirror.bardia.tech/termux/termux-packages-24: bad
[*] (1) https://packages.nscdn.top/termux-main: bad
[*] (1) https://mirrors.cqupt.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirror.nyist.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.sau.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.sdu.edu.cn/termux/termux-main: ok
[*] (1) https://mirrors.pku.edu.cn/termux/termux-main/: ok
[*] (1) https://mirrors.aliyun.com/termux/termux-packages-24: bad
[*] (1) https://mirrors.dgut.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.nju.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.scau.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirror.iscas.ac.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.njupt.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.hit.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.ustc.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.bfsu.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.sustech.edu.cn/termux/apt/termux-main: ok
[*] (4) https://grimler.se/termux/termux-main: ok
[*] (1) https://mirror.mwt.me/termux/main: ok
[*] (1) https://termux.astra.in.ua/apt/termux-main: bad
[*] (1) https://termux.librehat.com/apt/termux-main: ok
[*] (1) https://cdn.lumito.net/termux/termux-main: ok
[*] (1) https://termux.mentality.rip/termux-main: ok
[*] (1) https://mirrors.sahilister.in/termux/termux-main: ok
[*] (1) https://mirror.mwt.me/termux/main: ok
[*] (1) https://mirrors.utermux.dev/termux/termux-main: ok
[*] (1) https://dl.kcubeterm.com/termux-main: bad
[*] (1) https://plug-mirror.rcac.purdue.edu/termux/termux-main: ok
[*] (4) https://packages.termux.dev/apt/termux-main: ok
[*] (1) https://mirror.surf/termux/termux-main/: ok
[*] (1) http://mirror.mephi.ru/termux/termux-main: ok
Picking mirror: (14) /data/data/com.termux/files/usr/etc/termux/mirrors/china/mirrors.pku.edu.cn
Get:1 https://mirrors.pku.edu.cn/termux/termux-main stable InRelease [14.0 kB]
Get:2 https://mirrors.pku.edu.cn/termux/termux-root root InRelease [14.2 kB]
Get:3 https://mirrors.pku.edu.cn/termux/termux-main stable/main arm Packages [495 kB]
Get:4 https://mirrors.pku.edu.cn/termux/termux-root root/stable arm Packages [19.5 kB]
Fetched 542 kB in 6s (90.9 kB/s)                        
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
116 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package xdotool is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'xdotool' has no installation candidate

What is the expected behavior?

Package installed

System information

termux-info:

Termux Variables:
TERMUX_API_APP__VERSION_NAME=0.50.1
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/com.termux-ckVQ5yrngYl-q2eLMZzwZg==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=14058
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c173,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app:s0:c173,c256,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10173
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://plug-mirror.rcac.purdue.edu/termux/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://plug-mirror.rcac.purdue.edu/termux/termux-root root stable
Updatable packages:
android-tools/stable 34.0.4-4 arm [upgradable from: 31.0.3p1-6]
apt/stable 2.7.10 arm [upgradable from: 2.5.2]
bash-completion/stable 2.12.0 all [upgradable from: 2.11-2]
bash/stable 5.2.26 arm [upgradable from: 5.1.16-1]
brotli/stable 1.1.0 arm [upgradable from: 1.0.9-1]
ca-certificates/stable 1:2024.03.11 all [upgradable from: 1:2022.07.19]
clang/stable 17.0.6 arm [upgradable from: 14.0.6-2]
command-not-found/stable 2.4.0-16 arm [upgradable from: 2.0-1]
coreutils/stable 9.4 arm [upgradable from: 9.1]
curl/stable 8.6.0-1 arm [upgradable from: 7.84.0]
dash/stable 0.5.12 arm [upgradable from: 0.5.11.5-1]
debianutils/stable 5.17 arm [upgradable from: 5.7]
dialog/stable 1.3-20240307-0 arm [upgradable from: 1.3-20220526-0]
diffutils/stable 3.10 arm [upgradable from: 3.8]
dos2unix/stable 7.5.2 arm [upgradable from: 7.4.3]
dpkg/stable 1.22.2 arm [upgradable from: 1.21.9]
ed/stable 1.20.1 arm [upgradable from: 1.18]
ffmpeg/stable 6.1.1-3 arm [upgradable from: 5.1]
findutils/stable 4.9.0-2 arm [upgradable from: 4.9.0-1]
fontconfig/stable 2.15.0 arm [upgradable from: 2.14.0]
freetype/stable 2.13.2 arm [upgradable from: 2.12.1]
fribidi/stable 1.0.13 arm [upgradable from: 1.0.12]
gawk/stable 5.3.0 arm [upgradable from: 5.1.1-1]
giflib/stable 5.2.2 arm [upgradable from: 5.2.1-2]
glib/stable 2.78.4 arm [upgradable from: 2.76.3]
googletest/stable 1.14.0 arm [upgradable from: 1.12.1-2]
gpgv/stable 2.4.4 arm [upgradable from: 2.3.7]
grep/stable 3.11 arm [upgradable from: 3.7-2]
gzip/stable 1.13 arm [upgradable from: 1.12]
harfbuzz/stable 7.3.0-1 arm [upgradable from: 5.1.0-1]
inetutils/stable 2.4-1 arm [upgradable from: 2.3]
krb5/stable 1.21.2 arm [upgradable from: 1.20.1]
ldns/stable 1.8.3-2 arm [upgradable from: 1.8.3-1]
less/stable 633-1 arm [upgradable from: 590]
libandroid-support/stable 28-3 arm [upgradable from: 28-2]
libaom/stable 3.7.0-1 arm [upgradable from: 3.4.0-1]
libass/stable 0.17.1 arm [upgradable from: 0.16.0]
libassuan/stable 2.5.6 arm [upgradable from: 2.5.5]
libbluray/stable 1.3.4-1 arm [upgradable from: 1.3.1]
libc++/stable 26b arm [upgradable from: 25-1]
libcap-ng/stable 2:0.8.4 arm [upgradable from: 2:0.8.3]
libcompiler-rt/stable 17.0.6 arm [upgradable from: 14.0.6-2]
libcurl/stable 8.6.0-1 arm [upgradable from: 7.84.0]
libdav1d/stable 1.4.1 arm [upgradable from: 1.0.0]
libevent/stable 2.1.12-2 arm [upgradable from: 2.1.12-1]
libexpat/stable 2.6.2 arm [upgradable from: 2.4.8]
libffi/stable 3.4.6 arm [upgradable from: 3.4.2]
libgcrypt/stable 1.10.3 arm [upgradable from: 1.10.1]
libgmp/stable 6.3.0 arm [upgradable from: 6.2.1-2]
libgnutls/stable 3.8.3 arm [upgradable from: 3.7.6]
libgpg-error/stable 1.48 arm [upgradable from: 1.45]
libiconv/stable 1.17 arm [upgradable from: 1.16-3]
libidn2/stable 2.3.4 arm [upgradable from: 2.3.2]
libjpeg-turbo/stable 3.0.2 arm [upgradable from: 2.1.3]
libllvm/stable 17.0.6 arm [upgradable from: 14.0.6-2]
liblzma/stable 5.6.1 arm [upgradable from: 5.2.5-1]
libmd/stable 1.1.0 arm [upgradable from: 1.0.4]
libmpfr/stable 4.2.1 arm [upgradable from: 4.1.0-1]
libnettle/stable 3.9.1 arm [upgradable from: 3.7.3]
libnghttp2/stable 1.60.0 arm [upgradable from: 1.48.0]
libnpth/stable 1.6-2 arm [upgradable from: 1.6-1]
libopus/stable 1.4 arm [upgradable from: 1.3.1-5]
libpng/stable 1.6.43 arm [upgradable from: 1.6.37-3]
libpopt/stable 1.19-2 arm [upgradable from: 1.19]
libprotobuf/stable 2:25.1 arm [upgradable from: 2:3.21.5]
librav1e/stable 0.7.1 arm [upgradable from: 0.5.1]
libresolv-wrapper/stable 1.1.7-4 arm [upgradable from: 1.1.7-3]
libsoxr/stable 0.1.3-5 arm [upgradable from: 0.1.3-3]
libsqlite/stable 3.45.2 arm [upgradable from: 3.38.5]
libssh2/stable 1.11.0 arm [upgradable from: 1.10.0-2]
libtiff/stable 4.6.0 arm [upgradable from: 4.3.0-3]
libtirpc/stable 1.3.4 arm [upgradable from: 1.3.2-1]
libunistring/stable 1.1 arm [upgradable from: 1.0]
libusb/stable 1.0.27 arm [upgradable from: 1.0.26-1]
libuuid/stable 2.39.3-4 arm [upgradable from: 1.0.3-5]
libvidstab/stable 1.1.1 arm [upgradable from: 1.1.0-2]
libvpx/stable 1:1.14.0-1 arm [upgradable from: 1:1.12.0-1]
libwebp/stable 1.3.2 arm [upgradable from: 1.2.4]
libx264/stable 1:0.164.3101 arm [upgradable from: 1:0.161.3049-2]
libx265/stable 3.5-p20230222-0 arm [upgradable from: 3.5-4]
libxml2/stable 2.12.6 arm [upgradable from: 2.9.14]
lld/stable 17.0.6 arm [upgradable from: 14.0.6-2]
llvm/stable 17.0.6 arm [upgradable from: 14.0.6-2]
lsof/stable 4.99.3 arm [upgradable from: 4.95.0-1]
make/stable 4.4.1 arm [upgradable from: 4.3-2]
man/stable 1.14.6-1 arm [upgradable from: 1.14.5-3]
mc/stable 4.8.31 arm [upgradable from: 4.8.29-1]
nano/stable 7.2 arm [upgradable from: 6.3]
ncurses-ui-libs/stable 6.4.20231001-3 arm [upgradable from: 6.3-2]
ncurses/stable 6.4.20231001-3 arm [upgradable from: 6.3-2]
ndk-sysroot/stable 26b-1 arm [upgradable from: 25]
netcat-openbsd/stable 1.226-1-0 arm [upgradable from: 1.218-5-0]
openssh-sftp-server/stable 9.7p1 arm [upgradable from: 9.3p2]
openssh/stable 9.7p1 arm [upgradable from: 9.1p1]
openssl-tool/stable 1:3.2.1-1 arm [upgradable from: 1:3.0.7]
openssl/stable 1:3.2.1-1 arm [upgradable from: 1:3.0.7]
pcre2/stable 10.43 arm [upgradable from: 10.40]
procps/stable 3.3.17-5 arm [upgradable from: 3.3.17-2]
psmisc/stable 23.6-2 arm [upgradable from: 23.5]
pv/stable 1.8.5 arm [upgradable from: 1.6.20]
python/stable 3.11.8 arm [upgradable from: 3.10.6]
readline/stable 8.2.1 arm [upgradable from: 8.1.1]
rsync/stable 3.2.7-1 arm [upgradable from: 3.2.7]
sed/stable 4.9-1 arm [upgradable from: 4.8-2]
tar/stable 1.35 arm [upgradable from: 1.34]
termux-am/stable 0.8.0 all [upgradable from: 0.4]
termux-api/stable 0.58.0-1 arm [upgradable from: 0.57]
termux-keyring/stable 3.11 all [upgradable from: 3.8-1]
termux-tools/stable 1.41.2 all [upgradable from: 1.26.0-1]
unbound/stable 1.19.3 arm [upgradable from: 1.15.0-1]
unrar/stable 6.2.12 arm [upgradable from: 6.2.10]
util-linux/stable 2.39.3-4 arm [upgradable from: 2.38]
xxhash/stable 0.8.2 arm [upgradable from: 0.8.1]
xz-utils/stable 5.6.1 arm [upgradable from: 5.2.5-1]
zlib/stable 1.3.1 arm [upgradable from: 1.2.12]
zstd/stable 1.5.5-1 arm [upgradable from: 1.5.2-2]
termux-tools version:
1.26.0
Android version:
9
Kernel build information:
Linux localhost 4.9.112-perf #1 SMP PREEMPT Tue Sep 8 09:24:18 CET 2020 armv8l Android
Device manufacturer:
Xiaomi
Device model:
Redmi 7A
licy183 commented 7 months ago

Please install x11-repo and try again.

apt update && apt upgrade && apt install x11-repo && apt install xdotool

AntonSamokat commented 7 months ago

@licy183 Thanks, with

pkg install x11-repo
pkg install install xdotool

I have successfully installed xdotool

AntonSamokat commented 7 months ago

As I see this xdotool tool is not supposed to be used for emulating keystrokes on Android OS outside Termux environment. I want to have bash script that is able to pause and resume media playback. On Ubuntu the following command is working:

xdotool key --clearmodifiers XF86AudioPlay

But in Termux with this command I get:

Error: DISPLAY environment variable is empty. Is there an Xorg or other X server running? You can try setting 'export DISPLAY=:0' and trying again.
Failed creating new xdo instance.

This is because xdotool will be working only in X environment that Android device does not have: Graphical Environment - Termux Wiki

Am I right that now it is not possible by Termux to simulate keystrokes in OS Android?

I have found corresponding Feature Request for Termux: Feature request: media playback control #413

ewt45 commented 7 months ago

probably you can use ADB to send keyevents. It needs to be manually connected every time device boots though. adb shell input keyevent KEYCODE KEYCODE can be found at https://developer.android.com/reference/android/view/KeyEvent ADB can be installed through android-tools

AntonSamokat commented 7 months ago

@ewt45 Thanks, this is working approach. With rooted devices ADB can be configured even without need for manually connecting by USB to PC after each device boot.

I'll leave some references on that:

AntonSamokat commented 7 months ago

Nevertheless this possibility to send keystrokes by ADB does not cover Feature request: media playback control #413 since commands execution over TCP/IP is taking significantly more time than if this would be inside application by native API.

twaik commented 7 months ago

Writing this

native API

is not possible. There are a few reasons.

  1. Sending keystrokes is only possible using some Java code. And yeah, input keyevent is implemented in Java.
  2. Sending keystrokes without java or adb rights is possible only using Accessibility Service. And I am pretty sure it will not be implemented in termux-app or termux-api for security reasons. That will be goddamn security breach because there are LOTS of users who simply copies scripts from Internet because "interistin wat it do".
  3. Another way is only sending the proposed above adb+tcp way. It can be optimized A BIT by using Shizuku or something simillar. But anyway you can not get rid of possible overhead.