What's wrong with my Jetson nano

Dear All,

I’ve installed the R32.1 (jetson-nano-sd-r32.1-2019-03-18) on my jetson nano last week.
What I am going to do are

  1. Installing system package prerequisites
  2. Installing Keras and TensorFlow and Keras on the Jetson Nano.
  3. Installing the Jetson Inference engine.
    Unluckily, all apt-get command fails. I have to download cmake from cmake.org and make install manually.

Even worse,
sudo apt-get upgrade got error today.
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)

Here are what I tried to fix it but doesn’t help

ps aux | grep -i apt
root 8543 0.0 0.0 1912 480 ? Ss 09:12 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
root 8572 0.0 0.0 1912 1236 ? S 09:12 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install

sudo killall apt apt-get
apt: no process found
apt-get: no process found

lsof /var/lib/dpkg/lock
-bash: lsof: command not found

sudo dpkg --configure -a
dpkg: error: dpkg frontend is locked by another process

Unattended upgrades is running. The lock file is set so multiple apt processes don’t modify the system at the same time. The solution is simply to wait (run ‘top’ to check progress). If this happens frequently and it bothers you, many tutorials on fine tuning unattended upgrades on Ubuntu can be found by googling.

1 Like

@mdegans

Thanks for your advice. I will take a look. I am just worried about how many such unexpected issues will pop up. :)

No need to worry :) most operating systems auto update after the first boot. This happens on Ubuntu x86 as well, and even on windows if upgrades are in the process of installing.

@mdegans

This is not the first boot that’s why I feel this SBC is a bit of eccentric

pip install scipy
WARNING: The directory '/home/sramctc/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/home/sramctc/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting scipy
  Downloading https://files.pythonhosted.org/packages/cb/97/361c8c6ceb3eb765371a702ea873ff2fe112fa40073e7d2b8199db8eb56e/scipy-1.3.0.tar.gz (23.6MB)
     |████████████████████████████████| 23.6MB 3.5MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: scipy
  WARNING: Building wheel for scipy failed: [Errno 13] Permission denied: '/home/sramctc/.cache/pip/wheels/58'
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly

Once again, need searching and googling ~~~ :(

It should stop happening regularly if you do a full

sudo apt update && sudo apt dist-upgrade -y --autoremove

That will update your system while removing any stale packages.

The log for unattended upgrades should be in the /var/log/unattended-upgrades folder. If something strange is going on, it would likely be there.

If you want to tune unattended upgrades, a good manual is here:

https://wiki.debian.org/UnattendedUpgrades

That outlines the possible options in the configuration file which is usually

/etc/apt/apt.conf.d/50unattended-upgrades

But the 50 prefix could be different (it just defines the order the scripts/configs are loaded)

The pip error looks permissions related

See line:

WARNING: The directory ‘/home/sramctc/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.

I would recommend you delete .cache/pip in your homedir as it appears it’s not owned by your user.

Note:

One command to get you running should be:

sudo rm -rf ~/.cache/pip && pip install --user scipy

@ mdegans

Thank you very much!! I will test it tomorrow.
Regarding the owner issue, I have no idea why because this is the only login account since installation.

I wonder those errors (except apt-get) are related to virtual environment. However, I did this many times before on other platforms such as RasberryPi, RK3399… working with intel movidius stick and google coral usb accelerator etc.

Anyway, I will inform you at once after testing.

Thanks a lot!!! :)

you’re welcome!

I suspect it was a ‘sudo pip install something --user’ that did it. I would wager ~/.cache/pip is owned by root.

Sudo runs a command as another user (default root) but $HOME is still the same so a user install is performed as root. There are some reasons you might want to do that I can think of but probably not here. Likewise adding -H as suggested by pip to the above command would likely only make things worse. (Adding that just in case someone tries).

@ mdegans

After using “sudo”, no error during installation has been reported. I can start playing with it.

Thank you very much!!

I should have been clearer for others reading the thread, sorry. Let me restate:

Either do:

sudo pip install package
(For a systemwide install)

Or

pip install package --user
(For a user install)

‘sudo -H pip install package --user’ will not report an error, but pip cache and scipy will end up in /root/ (home folder for root user) which is almost certainly not what you want.

(Accidental quote instead of edit on mobile)