I am following this tutorial to install TinyOS but when I run sudo apt-get install tinyos
it says unable to locate package. I have tried all distributions.
4 Answers
From the TinyOS tutorial at your link:
Supported distributions are (hardy, intrepid, jaunty, karmic)
All of these Ubuntu releases are end of life and are no longer supported by updates. You are using Ubuntu 14.04 which is not supported by the TinyOS package repository that is shown in the tutorial at your link.
Instead I followed the instructions from Automatic installation - TinyOS Wiki to install TinyOS in Ubuntu 14.04 (it also works in Ubuntu 16.04).
Install TinyOS in Ubuntu 14.04 and 16.04
Visit TinyOS (TinyProd) Debian Development Repository and follow these instructions:
Tell apt about the TinyProd Signing Key.
wget -O - http://tinyprod.net/repos/debian/tinyprod.key | sudo apt-key add -
Add the two new lines to
/etc/apt/sources.list.d/tinyprod-debian.list
:sudo -s cd /etc/apt/sources.list.d echo "deb http://tinyprod.net/repos/debian wheezy main" >> tinyprod-debian.list echo "deb http://tinyprod.net/repos/debian msp430-46 main" >> tinyprod-debian.list
Install the new packages:
sudo apt-get update sudo apt-get install nesc tinyos-tools
I didn't install either msp430-46 or avr-tinyos at this step, in case you want to install them later after you have tested your TinyOS installation.
Get the code from the TinyOS release repository:
wget http://github.com/tinyos/tinyos-release/archive/tinyos-2_1_2.tar.gz tar xf tinyos-2_1_2.tar.gz
This will extract the actual TinyOS code in a folder named tinyos-release-tinyos-2_1_2 inside the directory the command was issued. Feel free to rename this folder to tinyos-main.
You will need to add some environment variables to your shell. The following file includes the necessary ones. Substitute the placeholder with the path where you chose to place the code in the previous section (full path recommended).
# Here we setup the environment # variables needed by the tinyos # make system export TOSROOT="<local-tinyos-path>" export TOSDIR="$TOSROOT/tos" export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java export MAKERULES="$TOSROOT/support/make/Makerules" export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python echo "setting up TinyOS on source path $TOSROOT"
Suppose you named this file tinyos.env. There are now at least two possibilities to have these variables accessible in your shell:
- Place it as root user in
/etc/profile.d/
Place it in
<local-tinyos-path>
and add the following line to your .bashrcsource <local-tinyos-path>/tinyos.env
- Place it as root user in
After the TinyOS installation is finished, you can check if it is successful by executing some of these commands:
tos-bsl tos-ident-flags tos-serial-debug
tos-build-deluge-image tos-install-jni tos-set-symbols
tos-channelgen tos-locate-jre tos-storage-at45db
tos-check-env tos-mote-key tos-storage-pxa27xp30
tos-decode-flid tos-mviz tos-storage-stm25p
tos-deluge tos-ramsize tos-write-buildinfo
tos-dump.py tos-serial-configure tos-write-image
-
Be careful if you install msp430-46 in Ubuntu 16.04 and later releases. For further information see this question: Error while installing for TinyOS.– karelAug 22, 2017 at 7:17
I happened to have the same issue and I solved it in the following way.
I downloaded the tinyos package form their github repo tiny-os-main.
I extracted it to my Desktop (you can extract it wherever you want and note down the path).
I then installed tinyos-tools from apt using
apt-get install tinyos-tools
.I then followed the 3rd instruction form the link Automatic Installation - TinyOS Wiki to setup the environment. The "local-tinyos-path" is the path you noted down in step 2.
Btw I am using Ubuntu 14.04.
Hope this helps.
Install TinyOS on Ubuntu 18.04
You don't need to download source for TinyOS, these command would do that:
% sudo apt-get update
% sudo apt-get install tinyos-tools bison flex graphviz
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ca-certificates-java default-jre default-jre-headless fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni libjama-java libpcsclite1 nescc
openjdk-11-jre openjdk-11-jre-headless tinyos-source uisp
Suggested packages:
default-java-plugin libjama-java-doc pcscd gcc-avr gcc-msp430 libnss-mdns fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei fonts-indic
The following NEW packages will be installed:
ca-certificates-java default-jre default-jre-headless fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni libjama-java libpcsclite1 nescc
openjdk-11-jre openjdk-11-jre-headless tinyos-source tinyos-tools uisp
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 53.2 MB of archives.
After this operation, 233 MB of additional disk space will be used.
Do you want to continue? [Y/n]y
The above commands install Java, nescc (v1.3.5), tinyos-source (v2.1.2), and tinyos-tools (v.1.4.2).
The source code for TinyOS will be placed in /usr/src/tinyos
.
After installing these, you will need to add some enviroment variables to your shell by:
source /etc/profile.d/tinyos.sh
Or to add these enviroment variables automatically, type:
printf 'source /etc/profile.d/tinyos.sh\n' | tee -a "$HOME/.bash_profile"
Next, check the installation with:
tos-check-env
Finally, change owner of TinyOS source:
% printenv TOSROOT
/usr/src/tinyos
% sudo chown -R "$USER". "$TOSROOT"
Useful links
- Wiki page: http://tinyos.stanford.edu/tinyos-wiki/index.php/Main_Page
- FAQ : http://tinyos.stanford.edu/tinyos-wiki/index.php/FAQ
- Overview: http://tinyos.stanford.edu/tinyos-wiki/index.php/TinyOS_Overview
- Installation on Ubuntu 16: Installing TinyOS on recent version of Ubuntu
- [Obsolete] Installation from unofficial repo: http://tinyprod.net/repos/debian/
That will happen if the package name is typed incorrectly , you can double check package name in the software center or install from there . The terminal is case sensitive for some operations , use lower case for installing packages. sudo apt- get install name. It may depend which repository those packages are in and whether those repositories are enabled. I am no expert on apt - get, but if you list which packages you are looking for , someone may be able to help.