Beware installing Roon on Ubuntu

I found a thread describing the same problem but it is now locked and there was no solution. This is the thread:

I have a solution. The problem was that many attempts to install Roon Server with the Easy Installer on freshly installed Ubuntu Linux ended with this:

Do you want to install RoonServer on this machine? [Y/n] y
Downloading RoonServer_linuxx64.tar.bz2 to /tmp/tmp.6qHIqqbwuQ/RoonServer_linuxx64.tar.bz2

Warning: Failed to open the file
Warning: /tmp/tmp.6qHIqqbwuQ/RoonServer_linuxx64.tar.bz2: No such file or
Warning: directory
curl: (23) Failure writing output to destination


The RoonServer installer did not complete successfully.

curl couldn’t write the file to the temporary directory. It couldn’t even start writing. I tried changing the temp directory by modifying the script but always got the same error. I googled for solutions (that’s how I found the thread I linked above) until I stumbled upon this very surprising unusual solution:

Basically snap curl is useless. Uninstall it properly. Get the proper apt curl, and everything works like a charm.

$ sudo snap remove curl
$ sudo apt install curl

That’s what I did, then closed and opened a new terminal window (important!) and Roon Server successfully installed. I am still in shock that Ubuntu’s installed by default curl is “useless”.

It was no Roon’s fault but maybe @support can put a note about this on the Installing Roon on Linux web page?

I was pulling my hair out trying to find out what was wrong.

P.S. I don’t agree with @Martin_Webster 's edit of my post. He added the word “Server” to the title. However, my post applies to any type of Roon installation on Ubuntu (there are only two - server and bridge). The bridge installer script is practically the same and also calls curl, so it will have the same issues. By adding “Server” we leave out Bridge.

10 Likes

Fair enough. However, the text of your post, and the linked thread, only refer to Roon server. Moreover, I wanted the subject to Make it clear the topic didn’t cover Roon control (GUI) since you posted in #roon:linux not #support

Interestingly, I’ve never experienced this issue, and the following steps continue to work for me. But, as you can see, I always install Curl using apt since it isn’t installed on Ubuntu server by default.

sudo apt install ffmpeg cifs-utils -y
curl -O https://download.roonlabs.net/builds/roonserver-installer-linuxx64.sh
chmod +x roonserver-installer-linuxx64.sh
sudo ./roonserver-installer-linuxx64.sh

Were you, by chance, installing Roon Server, without SU privileges?

I’m a little confused as to why you would even have /snap/bin/curl installed, and why it would precede /usr/bin/curl on your path. My ubuntu box with 22.04 doesn’t have the curl snap installed, and does have /usr/bin/curl (installed via apt).

Does the Roon installer for Linux install snap curl? (I checked: no)

1 Like

Good points, but this should still work if /snap/bin is included in PATH. The error seems to suggest thar curl doesn’t have permission to write in /tmp, but I’d hazard a guess that the script is run outside user space.

SNAP Apps are very restricted (for security reasons) on what they can access. See also:

3 Likes

My experience with Roon server (not sure about desktop) is that tar.bz2 extraction needs to be installed as a dependency before Roon will install.

I can confirm that installing curl using snap causes issues when trying to install Roon (server and/or bridge), at least on Ubuntu 22.10. Using apt instead solved these issues.

1 Like

IME… dependencies just need to be installed, curl, and tar.bz2 extraction.

Yes, they are, and /tmp is a sticky bit folder, too. A workaround would be to bind /tmp to a folder in ~ or just use APT.

Incidentally, SNAP has its own temp space.

Did you mean Roon Bridge? In my postscriptum I added Roon Bridge to the topic as the script for it is the same (just a different downloadable package), so the effect should be same.

No, no chance. Even if i was a total noob I would have copied the commands from the instructions https://help.roonlabs.com/portal/en/kb/articles/linux-install and they so include sudo (and that’s what I actually did as I didn’t want to mistype).

I don’t know. I installed a fresh Ubuntu 22.04.1 LTS desktop 2 days prior. I am not a Linux aficionado, I don’t use it every day but I manage several headless Raspberry Pi’s and my last experience with a Linux desktop was years ago (RedHat). I am familiar with the system but I am not a guru.

My install did not have /usr/bin/curl and I have /snap/bin last in my PATH. I suppose /snap/bin/curl was installed (I didn’t install it). When I did

sudo snap remove curl

it was uninstalled.

My wild guess is that Snap installed it automatically. I remember when I installed Ubuntu I discovered Snap in the GUI, and I installed and uninstalled one app just to see how it worked. I suppose Snap needed curl for this and installed it behind the curtains.

1 Like

As I mentioned I tried changing the temporary directory to various places outside /tmp (the script uses ‘mktemp’ and I just hardcoded some directories by modifying the script) and it didn’t help, so it’s not related to the sticky bit.

Can anyone explain how running this script with sudo didn’t allow this script or that Sanp curl write the file wherever I wanted? I am not an expert but I thought that sudo was supposed to give god privileges to the system.

As an afterthought, I don’t think it matters but maybe, I installed Ubuntu on ZFS filesystem.

Can anyone (moderators) encourage the Roon staff to add a note about this issue to the Linux installation instructions? I tagged support but it seems unresponsive. I have another thread in the Support forum about a different matter and no one responded in a month. Threads get locked. It looks like there are two locked threads about this issue. One is without a solution and I found it by googling, the other has a solution but I didn’t find it. I am not the only one who had this problem and I am sure someone else will have it in the future. Although, it’s not a Roon problem.

1 Like

ZFS makes no difference. The mktemp command creates a temporary file in /tmp, and Snap doesn’t have access to this folder. Instead, a special temporary folder is used with Snap. The only practical solution, if Snap is used, is to create the temporary file in user space.

Ubuntu Server does not install Curl by default using Snap. I agree that it’s nor a Roon issue.

Roon Labs are aware of this thread.

1 Like

This can in fact happen as snaps can state dependencies, too:

1 Like

I think I tried using some directory in my home directory as temporary by substituting TMPDIR=`mktemp -d` with TMPDIR=/home/myuser/somedir as I tried several different places all to no avail.

Ubuntu Server installs fewer packages than Desktop that I installed but I see that Desktop doesn’t install Snap curl either. I don’t know how it got installed on my machine, probably by my exploring of Snap. And I thought curl comes as part of the system. Now I realize that this situation is not common as curl is neither part of the system nor comes Snap-preinstalled.

I found that the developer of Snap curl knows about the issue:

They should remove curl from Snap if it causes problems.

I still don’t understand why a script run under sudo could not write to a temporary directory be it “Snapped” curl or not. I guess I am missing something in my UNIX knowledge about sudo.

And another request for Roon developers: use wget instead. It comes with the system and does the same in this case. I didn’t install it and I have it in /usr/bin.

1 Like

I’m not a snap expert at all but I think snaps are restricted to specific paths or use virtualized paths like in the /tmp example in your link, regardless of who runs them, a user or root

I installed Ubuntu 22.10 server x86 last night & of course Roon server.
These are the commands I ran.

Ubuntu 22.10 server
First install Ubuntu from bootable USB, etc
$ sudo apt-get update
$ sudo apt-get install bzip2 (Dependency for install)
$ sudo apt install curl (Dependency for install)
$ sudo apt install cifs-utils ffmpeg --yes

Execute Roon Linux install commands
$ curl -O https://download.roonlabs.net/builds/roonserver-installer-linuxx64.sh
$ chmod +x roonserver-installer-linuxx64.sh
$ sudo ./roonserver-installer-linuxx64.sh

If you have music stored on a USB drive, do this to auto mount:
Use blkid to discover your USB UUID reference (write this down)
$ blkid

Then edit fstab
$ sudo nano /etc/fstab

Add this line to your config file (inserting your drive UUID), at the end on the text:
UUID=insert your drive UUID here /media auto nosuid,nodev,nofail 0 0
Exit and save, CRTLX, Yes

Then run
$ sudo blkid /dev/sdb2 | awk -F’"’ ‘{print $2}’

Activate NUC top power button for instant soft off (On works by default):
$ sudo hostnamectl set-chassis vm

Reboot PC and use Roon remote to access Core
$ sudo reboot now

1 Like

Thanks. I had the same experience as the OP which is why I never got Roon Server tried out on my Ubuntu box.

At the next attempt I’ll be sure to use this information.

2 Likes

Did you need to install curl? People say it’s not installed by default. If so, perhaps this instruction should go on top.

And I think you don’t need to install bzip2 because it’s never used by the script. tar is used to unpack the package and I believe tar is part of the system

If the developers replace this line in the script
curl -L -# -o "$TMPDIR/$PACKAGE_FILE" "$PACKAGE_URL"
with this
wget -O "$TMPDIR/$PACKAGE_FILE" "$PACKAGE_URL"
threads like this and people’s troubles installing Roon would not exist. wget is installed by default (part of the system?).

1 Like