Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2025, 11:01 PM   #1
marysonthego
Junior Member
marysonthego began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2010
Device: Lenovo TB-8505F Android 10
Adventures with installing Calibre on repurposed Samsung S21 phone running Termux and

Adventures with installing Calibre on a repurposed Samsung S21 phone running Termux and Ubuntu 24.04

So, I replaced an old Samsung S21 recently, and discovered that you cannot root this model when it was purchased in the US. Had I known this at the time, I wouldn't have bought it.

Installed Termux with Proot-Distro as a workaround. Added Ubuntu 24.04 to Proot-Distro. That gave me a full Ubuntu environment on the S21 - but not a real root user (emulating a pseudo-root user is kind of the point of Proot-Distro).

My goal is to run the S21 as a server for a full Calibre instance. I am close, but still not there yet. I do have the S21 serving as host for a Calibre-Server. This is working fine, but isn't what I want. I have made significant progress, though, so I'll tell you what's happened. Hopefully one of y'all have been down this road and can help me get to the finish line with a full Calibre install on the S21. If not, I hope this is useful to host Calibre-Server on this pretty powerful, yet rootless, Android device.

Step 1: On the Phone goto Settings -> Connections -> Wi-Fi -> Settings -> for current network -> View More -> MAC Address Type. Select Phone MAC - not Randomized MAC. Many carriers default to a Randomized MAC address, but you must change that to the actual, fixed MAC address for the phone if you want a stable wifi connection with it to your PC. Fortunately it's just a matter of changing the setting - if you can find it.

Step 2: On a PC, start the adb daemon on tcp:5037 (the default) if it isn't already running. Listing attached devices will kick-start the adb daemon if you aren't already running it.

adb devices

List any configured port forwards. If 8022 & 8080 aren't already forwarded, do it now.
adb forward --list
adb forward tcp:8022 tcp:8022&
adb forward tcp:8080 tcp:8080&
adb forward --list

Step 3: Start ssh in a PC cmd prompt to connect to the phone. This means there must already be an sshd daemon running on the phone, listening for ssh client connections. So, on the phone where you have already installed Termux, open the Termux cmd prompt and type sshd to start the listening daemon on the phone.

Now, return to the PC and type ssh -Y -p 8022 192.168.xxx.xxx (the ip address of the phone on your local network). You should be able to suss this out by running ipconfig in the Termux terminal on the phone, assuming that you have wifi on and the phone is connected to your local wifi network. You'll be prompted for a password for ssh. Make one up and write it down somewhere.

If all is well, the PC cmd prompt shows you logged into the phone as the Termux user. In my case, it came up with a userid like u0_a327. That's who you now are on the phone.

If ssh says 'Connection timed out', Restart the wifi on the phone.
If ssh says 'Connection refused', sshd is not running on the phone. Start it.

Once you have an ssh connection to the phone, you're done with typing into the tiny Termux terminal window on the phone. On your PC ssh cmd prompt, install tigervncserver or vncserver or whatever vnc server on the phone, and the corresponding vnc client on the PC. Then check to see what the vnc server is starting for you in the phone's ~/.vnc/xstartup file.

cat ~/.vnc/xstartup

Based on some decisions I make later, mine says this:
#!/data/data/com.termux/files/usr/bin/sh
## This file is executed during VNC server
## startup.
startlxqt &

Why? We'll get to that. If you've already done this 2 or 3 times, you'll probably want to setup a keyring and some other security stuff before you can download packages and whatnot. Let me know if you need assistance. Ubuntu 24.04 made some changes to /etc/apt/sources.list (in favor of sources.list.d).

On your ssh terminal on the PC, run termux-setup-storage (read the termux doc to find out why).
I'm also going to whiff on installing Ubuntu 24.04 in Termux - which it does not come with. If I went into all that, this would be a novel.

At this point you have keyrings set up and Ubuntu 24.04 installed into Termux.

Step 4: Login to Ubuntu in Proot-Distro:

pd login ubuntu

This gets you logged into Ubuntu 24.04 in the ssh terminal on the PC as (pseudo) root. Every time you do this, be sure to run apt to keep your distro current.

apt update
apt upgrade -y

I installed Gnome and tried a couple of other desktop environments, but they were fussy in Termux, so I settled on lxqt (see Step 3, above).

Levelset. At this point you have accomplished a lot. You have Termux and Proot-Distro installed on your phone, you can ssh into the phone from your PC, you have Ubuntu 24.04 installed in Termux, you have beaten keyrings and security with a stick, and you've updated Termux to Ubuntu 24.04. Yay!

Take a moment to poke around in your new Ubuntu 24.04 environment.

lscpu - to get hardware info
cat /etc/os-release - to get ubuntu version
uname -a - more stuff

Step 5: Dependency hell. You might think you are ready to install Calibre. You are not.

wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin

You will need to 'apt install pkg-name' for probably 50 or more packages that Calibre and/or QT need but do not ship with. It's an iterative process. Install some stuff, try to run Calibre, then install more stuff based on the error messages.

The good news is, an S21 has lots of ROM.

As mentioned in the beginning, I am able to serve a calibre-server from the S21, but I still can't run calibre in full on it. This makes me sad.
marysonthego is offline   Reply With Quote
Reply

Tags
android 15 install, calibre-server


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre under Termux jospalau Calibre 4 05-08-2025 02:30 PM
Calibre Companion on a Samsung Galaxy Tab Running Android 14 jvorzimmer Calibre Companion 15 01-20-2025 05:07 AM
Calibre on Termux ? (or android) bobodude Calibre 3 09-12-2019 05:53 PM
Installing/Running Plugins David Kudler Plugins 3 11-12-2014 11:59 PM
Calibre support for samsung galaxy s Android phone Dopedangel Calibre 34 09-13-2010 12:13 PM


All times are GMT -4. The time now is 07:26 PM.


MobileRead.com is a privately owned, operated and funded community.