nRF Command Line Tools fails to install on new Ubuntu 20.04 system

Trying to get the entire set of v2.0.0 software development tools to install on our Ubuntu 20.04.4 LTS x86_64 system for my nRF9160-DK.

Following the [DevAcademy nRF Connect SDK Fundamentals course](https://academy.nordicsemi.com/topic/exercise-1-1/), the very first task in the very first exercise instructs to install the [nRF Command Line Tools](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools).  The illustration in the course only demonstrates how to click the icon in Windows but not for Ubuntu.  This failed for me when installing the Ubuntu .deb package:

```

$ sudo apt install ./Downloads/nrf-command-line-tools_10.17.0_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'nrf-command-line-tools' instead of './Downloads/nrf-command-line-tools_10.17.0_amd64.deb'
nrf-command-line-tools is already the newest version (10.17.0).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up nrf-command-line-tools (10.17.0) ...
dpkg: error: dpkg database lock is locked by another process
dpkg: error processing package nrf-command-line-tools (--configure):
installed nrf-command-line-tools package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
nrf-command-line-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
$

```

Tried also clicking the .deb file in the graphical file manager with similar result.

I noticed the error mentions the post-installation script, but does not specify the line it failed on.  The `postinst` file contained within the .deb archive is as follows:

```

#!/usr/bin/env bash

echo /opt/nrf-command-line-tools/lib > /etc/ld.so.conf.d/nrftools.conf
echo /opt/nrf-command-line-tools/bin >> /etc/ld.so.conf.d/nrftools.conf

echo /opt/nrf-command-line-tools/lib > /etc/ld.so.conf.d/nrfjprog.conf
echo /opt/nrf-command-line-tools/bin >> /etc/ld.so.conf.d/nrfjprog.conf

ln -sf "/opt/nrf-command-line-tools/bin/nrfjprog" "/usr/local/bin"
ln -sf "/opt/nrf-command-line-tools/bin/mergehex" "/usr/local/bin"

if command -v rpm &> /dev/null
then
rpm --upgrade /opt/nrf-command-line-tools/share/segger/*.rpm
exit
fi
if command -v dpkg &> /dev/null
then
dpkg --install /opt/nrf-command-line-tools/share/segger/*.deb
exit
fi
fi

if command -v rpm &> /dev/null
then
rpm --upgrade /opt/nrf-command-line-tools/share/segger/*.rpm
exit
fi
if command -v dpkg &> /dev/null
then
dpkg --install /opt/nrf-command-line-tools/share/segger/*.deb
exit
fi

```

with a suspicious extra `fi` statement.  Moreover, I could not see a `segger` directory:

```

$ ls -l /opt/nrf-command-line-tools/share/
total 24
-rw-r--r-- 1 root root 5370 Jul 22 16:46 config.toml
drwxr-xr-x 2 root root 4096 Aug 2 16:39 firmware
drwxr-xr-x 2 root root 4096 Aug 2 16:39 NRFCommandLineTools
-rw-r--r-- 1 root root 753 Jul 21 10:03 nrfjprog.ini
-rw-r--r-- 1 root root 3052 Jul 21 10:03 QspiDefault.ini
$

```

So my guess is either the Ubuntu .deb package is simply broken, incomplete, the guide is missing a step or it's failing on the extra `fi` statement.

Not sure though.  Any help to get past this stage would be appreciated.

Parents
  • Thanks all, I ignored the error and continued as SwRa recommended, however have now also run into a problem with VSCode unlike that of V.Besse; instead mine is complaining about shell initialization conflicting with the nRF Connect Terminal profile which is not solved by its recommended troubleshooting page.  I haven't yet ran into any sign of missing `nrfjprog` yet - I can see it in my `/usr/local/bin/nrfjprog` but still early days for VSCode.  So we did get past this by ignoring the original error installing the command line tools so I'll call this issue done for now.  I think I'll try the same trick, ignoring the VSCode error and see if I can just get blinky to run.

    I wonder how much of the VSCode errors we're seeing have something to do with the command line tool post-install error.

    Bottom line: 10.17.0 contains a deb package post-install script error that can be ignored.  The command line tools seem to install but we can't say for sure that any problems that come after are caused by it.

  • Likewise, V.Besse.  Thanks for your feedback and insight.  I too am totally new to VSCode.  It's become urgent for us to decide now whether we really want to continue after spending days spread over weeks trying to install a tool chain that works - both management and I are very displeased - they don't want to wait any time for fixes to what is supposedly an officially supported system and we may have to move away from Nordic for our next generation design.

    In a final act of desperation I now need to scrape the barrel and get a Windows machine up and running to see if even that works, but why should we have to stoop so low?

    Hope the next version works for us.  Not sure if we can still be developing on the Nordic platform though.

Reply
  • Likewise, V.Besse.  Thanks for your feedback and insight.  I too am totally new to VSCode.  It's become urgent for us to decide now whether we really want to continue after spending days spread over weeks trying to install a tool chain that works - both management and I are very displeased - they don't want to wait any time for fixes to what is supposedly an officially supported system and we may have to move away from Nordic for our next generation design.

    In a final act of desperation I now need to scrape the barrel and get a Windows machine up and running to see if even that works, but why should we have to stoop so low?

    Hope the next version works for us.  Not sure if we can still be developing on the Nordic platform though.

Children
Related