bash: /usr/local/bin/ollama: cannot execute: required file not found

May 23, 2024, 05:00

kay_wayfarer

bash: /usr/local/bin/ollama: cannot execute: required file not found Hi, I'm trying to download ollama onto my RPi 5 (8GB), but after I ran the following command: "curl -fsSL https://ollama.com/install.sh | sh" and the terminal says ollama was successfully installed, when I tried to run "ollama --version", it sends the message in the title above. I am following this guide: https://pimylifeup.com/raspberry-pi-ollama/ Please ping me if you can help me, thank you! —-UPDATE—- kaywayfarer@raspberrypi:~ $ sudo systemctl restart ollama kaywayfarer@raspberrypi:~ $ sudo systemctl status ollama ● ollama.service - Ollama Service Loaded: loaded (/etc/systemd/system/ollama.service; enabled; preset: enabl> Active: activating (auto-restart) (Result: exit-code) since Thu 2024-05-23> Process: 3019 ExecStart=/usr/local/bin/ollama serve (code=exited, status=20> Main PID: 3019 (code=exited, status=203/EXEC) CPU: 743us I think the text in bold is the issue. It should say "running" I tried rebooting my RPi 5 and using the command "sudo systemctl stop ollama" and then start Still doesn't work I have searched the internet for this, but I have found no solution to this.

kay_wayfarer

Tried deleting it, it can’t even locate ollama

thunder07337

sudo apt remove --purge ollama

kay_wayfarer

That won’t work either

kay_wayfarer


thunder07337

You have to search the internet to find out how to delete it. Because it was not installed with apt... If necessary, go through the script and undo what it has done.

kay_wayfarer

And how do I do that?

kay_wayfarer

Also i tried looking in file manager and it’s not even there

kay_wayfarer



kay_wayfarer

In the meantime, I’ll ask chat gpt

kay_wayfarer

Btw I was troubleshooting with ChatGPT and I entered this command: sudo journalctl -u ollama.service and it showed me this.

kay_wayfarer


kay_wayfarer

I think I found the files

kay_wayfarer

I found the ollama file itself, gonna execute in terminal and see what happenes

kay_wayfarer

<@1187039958561726494> I found the specific error. Some file called “xterm” not being able to be found. Must be why the whole ollama service can’t run in the first place

kay_wayfarer

I’m going to try to find this file and just figure out what to do from there

thunder07337

Have you installed the latest raspberry Pi OS?

kay_wayfarer

Yes I think so

kay_wayfarer

Wait…

kay_wayfarer

The microSD Card I bought with the RPi had the RPi OS pre-installed in it

kay_wayfarer

I didn’t need to image it

kay_wayfarer

But I did do sudo apt update and upgrade when I first booted up the RPi

thunder07337

cat /etc/os-release

kay_wayfarer

Idk if I can do that rn because I already started installing xterm and it is taking very long. It’s been over 5 minutes and it’s still at 0% and some code lines popped up (See arrow)

kay_wayfarer

Gonna try that now since the xterm download stopped for connection reasons

kay_wayfarer

Here is the result. Looks like it’s the latest version I think

thunder07337

OK I have no idea what was preinstalled, but I would recommend reinstalling the OS... Otherwise the latest OS uses Wayland and xterm needs X11. So you should set that under
sudo raspi-config 
. Click through there, I don't have the time to look right now.

kay_wayfarer

I got no clue where to go in raspi-config but I can tell you that I updated it and it was already on the latest version

kay_wayfarer

<@1187039958561726494> I just found out that my OS Runs on 32 Bit. Could that be the reason?

kay_wayfarer

And can I use the current microSD Card I have to write a 64 bit os on it?

oops.se

Yes, just install the 64 bit version on the SD card.

oops.se

The https://pimylifeup.com/raspberry-pi-ollama/ should work, after reading the script it copies files to the bin directories and to do that you need to have elevated privileges and it uses sudo = elevated privileges in the script. And forget about apt as everything is installed via the script and that doesn't use apt.

oops.se

And from this code snip from the script
ARCH=$(uname -m)
case "$ARCH" in
    x86_64) ARCH="amd64" ;;
    aarch64|arm64) ARCH="arm64" ;;
    *) error "Unsupported architecture: $ARCH" ;;
esac
Your suspicion that 64 bit is needed is verified , aarch64 = 64 bit

kay_wayfarer

Alright thank you. I’ll look for aa different guide on how to install Ollama after I rewrite my Card to have a 64-Bit OS.

kay_wayfarer

If there’s any clarification I need, I’ll let you know 👍

kay_wayfarer

<@796000224690307072> Before I rewrite the microSD Card containing the 32 Bit OS, is there anything I need to do? I am able to input the same settings (Host name, password, wi-fi, etc.) when I image the card with the 64-Bit OS, right?

kay_wayfarer

I have no important files on the card so that aspect’s clear

oops.se

Yes use the same parameters

oops.se

You can follow the tutorial https://pimylifeup.com/raspberry-pi-ollama/ or you can follow the official guide https://github.com/ollama/ollama/blob/main/docs/linux.md but that has a higher skill/knowledge level.