Installing on Ubuntu

67 views
Skip to first unread message

MV Elttba

unread,
Aug 11, 2025, 2:08:53 PMAug 11
to sdrtrunk

Greetings

can anyone help me by providing step by step instruction installing SDRTrunk on my Ubuntu Desktop machine?

I have searched and no joy. Either bad information or very old information. I would appreciate any assistance. TIA

Ron Webb

unread,
Aug 12, 2025, 12:46:58 AMAug 12
to sdrtrunk
SDRTrunk and RTL-SDR Setup on Ubuntu 25.04 Server (Minimal GUI)

Last tested: August 11, 2025
Tested on: Ubuntu 25.04 Server Edition with minimal GUI interface
Assumes: Logged in as a regular user with sudo privileges (not root)

Package names, commands, and steps may change in future releases.


1. Install Essential Tools and Dependencies

These packages are needed to clone (git), compile (build-essential, cmake), and install (pkg-config, libusb-1.0-0-dev) the RTL-SDR drivers, as well as extract SDRTrunk bundles (unzip).

sudo apt update sudo apt install git cmake build-essential pkg-config libusb-1.0-0-dev unzip wget tar

2. Clone, Compile, and Install RTL-SDR Drivers

I prefer to keep all my Git repositories in ~/git, but feel free to adjust this path to your liking. While it is possible to install a pre-compiled version of RTL-SDR drivers (sudo apt install rtl-sdr), I recommend compiling the drivers as shown below.

mkdir -p ~/git cd ~/git git clone https://github.com/osmocom/rtl-sdr.git cd rtl-sdr mkdir build && cd build cmake ../ -DINSTALL_UDEV_RULES=ON make -j"$(( $(nproc) - 1 ))" sudo make install sudo cp ../rtl-sdr.rules /etc/udev/rules.d/ sudo ldconfig

This builds and installs the RTL-SDR drivers from source and adds udev rules so your SDR dongles can be accessed without running as root. In the line that begins with make, the other data afterwards just helps speed up the process by using all but one of the CPU cores your system has available.


3. Prevent Ubuntu from Loading the DVB Tuner Driver

By default, Ubuntu may think your RTL-SDR is a DVB-T television tuner. Blacklist the kernel module so it won’t load:

echo "blacklist dvb_usb_rtl28xxu" | sudo tee /etc/modprobe.d/blacklist-rtl.conf

4. Test Your RTL-SDR Dongle

Unplug and replug your dongle, then run:

rtl_test -t

If it’s detected and no errors appear, your dongle is ready for use.


5. Assign a Personalized Serial Number to Your RTL-SDR Dongle(s)

If you plan on using more than one RTL-SDR dongle, it’s important to assign each a unique serial number.

Step 5.1 – Plug in One Dongle at a Time

Only one dongle should be plugged in for each pass.

Step 5.2 – Install the rtl-sdr Utilities

If you compiled from source above, you already have these tools installed.
If not, install them from the package manager:

sudo apt install rtl-sdr
Step 5.3 – Identify the Current Serial Number
rtl_eeprom

Example output:

Found Rafael Micro R820T tuner Current EEPROM configuration: Vendor ID: 0x0bda Product ID: 0x2838 Serial number: 00000001Step 5.4 – Change the Serial Number
rtl_eeprom -s SDR01

You will be prompted to confirm.

Step 5.5 – Power Cycle the Dongle

Unplug and replug the dongle.

Step 5.6 – Verify the New Serial Number
rtl_eeprom

The serial should now reflect your chosen value.

Step 5.7 – Repeat for Each Dongle

Repeat for all dongles, assigning each a unique serial.


6. Create Persistent udev Device Names for RTL-SDR Dongles

Persistent udev names let your dongles always show up with predictable names.

Step 6.1 – Get the Dongle’s Serial Number
rtl_eeprom
Step 6.2 – Find its USB Identifiers
rtl_test -t

or:

lsusb

Example:

Bus 002 Device 003: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
  • idVendor = 0bda
  • idProduct = 2838
Step 6.3 – Create a New udev Rule
sudo nano /etc/udev/rules.d/90-rtl-sdr.rules

Example:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", ATTRS{serial}=="SDR01", SYMLINK+="rtl_sdr_airband", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", ATTRS{serial}=="SDR02", SYMLINK+="rtl_sdr_p25", MODE="0666"Step 6.4 – Reload udev Rules
sudo udevadm control --reload-rules sudo udevadm trigger
Step 6.5 – Test the Persistent Name
ls -l /dev/rtl_sdr_*

Example:

lrwxrwxrwx 1 root root 15 Aug 11 15:42 /dev/rtl_sdr_airband -> bus/usb/002/003
Step 7 - Installing BellSoft Liberica JDK 24.0.2

SDRTrunk operates on Java and especially if you are going to build it from the latest version, which I recommend you do for the latest and greatest features, you will want to install the latest version of BellSoft’s Liberica Java Development Kit 24. At this time, that is 24.0.2+12. I will show two different methods of acquiring and installing.

Step 7.1 - Option 1 - Installing entirely from Command Line (Preferred if it works)
mkdir -p ~/Downloads cd ~/Downloads sudo apt install wget wget https://download.bell-sw.com/java/24.0.2+12/bellsoft-jdk24.0.2+12-linux-amd64-full.deb sudo dpkg -i bellsoft-jdk24.0.2+12-linux-amd64-full.deb

The first command creates, if it doesn’t already exist, a folder under your home folder named Downloads and switches you to that folder. It then downloads full version of Liberica JDK 24.0.2. The last line installs it. This should also make it the default Java program for the system. To verify, jump to Step 7.3.

Step 7.2 - Option 2 - Download the file from BellSoft’s website (If Step 7.1 doesn’t work)

Direct your web browser to Download Liberica JDK. As of the time of writing, JDK 24 is the latest version, so click on the link for the latest version. Then, scroll down to the 64-bit version for Linux. You will see options for x86, ARM, RISC-V, and PPC. I have not run this on any physical platform other than x86, so if you are attempting to do this on something like a Raspberry Pi, you might try ARM, but know that I cannot vouch for that working. VITAL NOTE: For building SDRTrunk, you will need the FULL JDK package, the Standard package will not work properly, ensure you select the Full JDK from the Package list. Finally, I recommend downloading the DEB package. If you have downloaded this onto a different machine, you will need to transfer it to the machine you plan on installing it on and follow the last line of Step 7.1. As a shortcut, especially if the downloaded file is something different than the file name listed in Step 7.1, after typing sudo dpkg -i bellsoft, you can hit the <Tab> key and it should autofinish the rest of the line.

Step 7.3 - Verify Java

Hopefully, you have now installed the latest version of BellSoft’s Liberica JDK and we want to verify it.

java -version javac -version

This should result in something like:

openjdk version "24.0.2" 2025-07-15 OpenJDK Runtime Environment (build 24.0.2+12) OpenJDK 64-Bit Server VM (build 24.0.2+12, mixed mode, sharing)

and

javac 24.0.2

If this does not appear to be the case, you may need to find if you have other versions installed and what is the default. You only need to do this next section if it didn’t automatically make your latest installation the default.

sudo update-alternatives --config java

This may result in something like this:

There are 7 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/jvm/bellsoft-java24-full-amd64/bin/java 22400023 auto mode 1 /usr/lib/jvm/bellsoft-java22-full-amd64/bin/java 22200023 manual mode 2 /usr/lib/jvm/bellsoft-java23-full-amd64/bin/java 22300003 manual mode 3 /usr/lib/jvm/bellsoft-java24-full-amd64/bin/java 22400023 manual mode 4 /usr/lib/jvm/java-21-openjdk-amd64/bin/java 2111 manual mode 5 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode 6 /usr/lib/jvm/jdk-23/bin/java 1 manual mode 7 /usr/lib/jvm/jdk-24/bin/java 1 manual mode Press <enter> to keep the current choice[*], or type selection number:

In this example, you will see that there is an asterisk by Selection 0 and you will see that it is /usr/lib/jvm/bellsoft-java24-full-amd64/bin/java, which is an appropriate default. If you see that something else is selected and you see the latest BellSoft version, type in the number corresponding with it.

If you have had to do this and javac is also incorrect, follow the previous instructions just modify it to:

sudo update-alternatives --config javac
Step 8 - Downloading and Compiling SDRTrunk

This is finally the main step you have come to learn. All the previous steps are to ensure that from this point forward, you aren’t met with failures. Part of these instructions are part of my own personal preferences, so if you wish to do them a different way and you know what you are doing, feel free to just use this as just reference only.

Step 8.1 - Download the latest SDRTrunk source code
cd ~/git git clone https://github.com/DSheirer/sdrtrunk.git cd sdrtrunk chmod +x gradlew ./gradlew clean build --max-workers="$(nproc)" cd build/distributions/ tar -xvf *.tar

The first line tells us to go to our git folder. The second line clones the SDRTrunk code into a folder that will be ~/git/sdrtrunk, while the next line changes to that directory. The line: ./gradlew clean build actually compiles the needed files. Below is an example of what you might see when it is done. The additional --max-workers="$(nproc)" on that line can potentially speed up the build process.

WARNING: A restricted method in java.lang.System has been called WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/home/sdr/.gradle/wrapper/dists/gradle-8.14.2-bin/2pb3mgt1p815evrl3weanttgr/gradle-8.14.2/lib/native-platform-0.22-milestone-28.jar) WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module WARNING: Restricted methods will be blocked in a future release unless native access is enabled Starting a Gradle Daemon (subsequent builds will be faster) > Task :compileJava warning: using incubating module(s): jdk.incubator.vector Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning > Task :compileTestJava warning: using incubating module(s): jdk.incubator.vector 1 warning > Task :test WARNING: Using incubator modules: jdk.incubator.vector [Incubating] Problems report is available at: file:///home/sdr/sdrtrunk/build/reports/problems/problems-report.html Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.14.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD SUCCESSFUL in 18s 9 actionable tasks: 9 executed

You may see a few warnings like you can see in my example, but these warnings have not caused me any issues.

It ends up creating a directory ~/git/sdrtrunk/build/distributions. In this new directory, there are two zipped files, a zip and a tar file; compiled versions of the latest version of SDRTrunk. the next line, cd build/distributions/ changes to that directory.

The last line, tar -xvf *.tar is a bit lazy, but it works. It expands one of the tar version. If you were to type in:

ls -l

You might expect to see something like:

total 55799 drwxr-xr-x 4 sdr sdr 4 Aug 11 16:48 sdr-trunk-0.6.2-beta-1 -rw-rw-r-- 1 sdr sdr 30668800 Aug 11 16:48 sdr-trunk-0.6.2-beta-1.tar -rw-rw-r-- 1 sdr sdr 27805653 Aug 11 16:48 sdr-trunk-0.6.2-beta-1.zip

In my example, you will want to change directories into that listed directory: cd sdr-trunk-0.6.2-beta-1. Inside this new folder, you will see two sub-directories: bin and lib. THIS is the entire program for SDRTrunk.

Step 8.2 - Creating your SDRTrunk Main Directory

I like to create a sub-directory under my user directory. For my purposes, I call this ~/SDRTrunk. I will now want to mv the bin and lib folders from ~/git/sdrtrunk/build/distributions/sdr-trunk-0.6.2-beta-1 into this new directory. (Obviously, if you are at a different version, that last bit 0.6.2-beta-1 maybe different).

mkdir -p ~/SDRTrunk mv ~/git/sdrtrunk/build/distributions/sdr-trunk-0.6.2-beta-1/* ~/SDRTrunk cd ~/SDRTrunk ls -l

This has now created that ~/SDRTrunk directory and moved bin and lib into it. It then changes you to that directory and it should show you those two sub-directories.

Step 9 - Starting SDRTrunk

At this point, you should have two files in ~/SDRTrunk/bin, sdr-trunk and sdr-trunk.bat. The one that we will use is sdr-trunk but we want to start it in the ~/SDRTrunk folder, so that it becomes the working directory. You can start SDRTrunk with the following command:

cd ~/SDRTrunk && bin/sdr-trunk

This is actually two commands in one (hence the double ampersands), with the first starting you in the ~/SDRTrunk folder and the other calling sdr-trunk to start in the bin sub-directory.

At first start, you will not have the ability to decode the digital audio that is received, you need to build the codec to decode the digital audio; this is called jmbe. To build jmbe, open the View→User Preferences tab. From User Preferences, look for the Decoder section. I don’t have a fresh build to verify, but I believe there is a button that will download and build JMBE Audio Library with the latest version (for a few years now) of 1.0.9.

Another likely task at the beginning of opening SDRTrunk for the first time is Vector Calibration I believe it will ask you to start the process. Just let it run its course.

These last two steps are the same, whether you are on Ubuntu or any other operating system.


Common Problems & Fixes

Below are some issues you might encounter during installation and setup, along with suggested fixes.

Problem 1 – wget: command not found

Cause: wget is not installed on minimal Ubuntu Server setups.
Fix:

sudo apt install wget
Problem 2 – tar: command not found

Cause: tar might be missing in minimal installations.
Fix:

sudo apt install tar
Problem 3 – rtl_test does not detect the dongle

Possible Causes & Fixes: - Driver conflict: Ensure the DVB-T driver is blacklisted (see Step 3).
USB port or cable issue: Try a different port or USB cable.
Insufficient power: Use a powered USB hub if the dongle draws more current than the port can provide.

Problem 4 – Permission denied when running ./gradlew

Cause: The file is missing the executable permission.
Fix:

chmod +x gradlew
Problem 5 – Java version mismatch or missing JavaFX

Cause: Older Java versions or standard JDK without JavaFX installed.
Fix: Install the latest BellSoft Liberica Full JDK (see Step 7). Verify with:

java -version javac -version
Problem 6 – Gradle build errors

Possible Causes & Fixes: - Corrupted Gradle cache:

./gradlew --stop ./gradlew clean build --refresh-dependencies
  • Outdated Gradle wrapper: Update with:
./gradlew wrapper --gradle-version <latest-version>
Problem 7 – SDRTrunk audio decoding not working

Cause: JMBE codec not built or enabled.
Fix: In SDRTrunk, go to View → User Preferences → Decoder and click Build JMBE Audio Library.

Problem 8 – SDRTrunk does not remember tuners between restarts

Cause: Dongles do not have unique serial numbers or persistent udev rules.
Fix: Follow Steps 5 and 6 to assign serial numbers and create persistent device names.

Ron Webb

unread,
Aug 12, 2025, 12:49:35 AMAug 12
to sdrtrunk
I originally wrote the instructions in MarkDown laguage, but I converted it to HTML for posting here. It may look better if you can open my original version. I've attached SDRTrunk_Setup.md which will hopefully look prettier.
SDRTrunk_Setup.md

Eric F.

unread,
Aug 12, 2025, 11:16:29 PMAug 12
to sdrtrunk
What's the difficulty?
Basic installation is pretty easy. Install and run or building it yourself from source?
Is other software that supports your tuner working as it should?
Which tuner are you using?
Reply all
Reply to author
Forward
0 new messages