Hello, I installed searxng using git clone and installed all pip packages, but the files are meant for PC environments and aren’t suitable for Termux. Let’s take a look at some code from lib.sh:

DIST_ID=$(source /etc/os-release; echo "$ID");

This code obtains an ID from /etc/os-release. However, Termux doesn’t have this file in the / directory. Now, check out this part of the code:

case $DIST_ID-$DIST_VERS in arch-*|fedora-*|centos-7) systemctl enable nginx systemctl start nginx ;; esac

It checks for Arch, Fedora, and CentOS 7, but it never checks for Termux! Searxng uses sudo, systemctl, and service, all of which require editing the entire file just to replace systemctl with sv from “Termux-services”, and removing sudo. It’s just a waste of time. I tried simplifying the process using sed, but I failed. Here’s what I attempted:

sed -i -e 's|/usr/local/searxng|/data/data/com.termux/files/home/searxng|g;' searxng.sh

It’s also assumed that there’s a / in the directory path. I had to edit the URL in searxng.sh to match the Termux-specific directory, as creating files directly under / isn’t possible in Termux.

  • LemmyUser1290a@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    7 months ago

    I already know how to install it in proot or chroot, but I’m trying without any proot because proot slows Searxng even more. You just follow the entire Searxng Ubuntu documentation, but add these extra commands:

    update-alternatives --install /usr/bin/python python /usr/bin/python3 1

    Create a file in /usr/bin/systemctl and name it “systemctl” Add this code to it:

    service $2 $1

    Then, set the file’s permissions with: chmod +x /usr/bin/systemctl

    Note: I haven’t double-checked the code I’ve shown you. If it doesn’t work, please let me know or check if you have the service command.

    and the systemctl thing only works for some codes not all