# Labs

## Labs

## Opkg @ Edison

Update Opkg Repositories

```bash
root@edison:~# cat /etc/opkg/base-feeds.conf
```

```bash
root@edison:~# opkg update
Downloading http://iotdk.intel.com/repos/1.5/intelgalactic/Packages.
Updated list of available packages in /var/lib/opkg/iotkit.
root@edison:~#
```

Enable a Opkg feed and update package list

```bash
root@edison:~# nano /etc/opkg/base-feeds.conf
```

Add the below lines to the opened file

```bash
src/gz all http://repo.opkg.net/edison/repo/all
src/gz edison http://repo.opkg.net/edison/repo/edison
src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32
```

Save the file

```bash
root@edison:~# opkg update
Downloading http://repo.opkg.net/edison/repo/all/Packages.gz.
Inflating http://repo.opkg.net/edison/repo/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/all.
Downloading http://repo.opkg.net/edison/repo/edison/Packages.gz.
Inflating http://repo.opkg.net/edison/repo/edison/Packages.gz.
Updated list of available packages in /var/lib/opkg/edison.
Downloading http://repo.opkg.net/edison/repo/core2-32/Packages.gz.
Inflating http://repo.opkg.net/edison/repo/core2-32/Packages.gz.
Updated list of available packages in /var/lib/opkg/core2-32.
Downloading http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586//Packages.
Downloading http://iotdk.intel.com/repos/3.5/iotdk/edison/all/Packages.
Downloading http://iotdk.intel.com/repos/3.5/iotdk/edison/core2-32/Packages.
Downloading http://iotdk.intel.com/repos/3.5/iotdk/edison/edison/Packages.
Collected errors:
 * opkg_download: Failed to download http://iotdk.intel.com/repos/3.5/intelgala.
 * opkg_download: Failed to download http://iotdk.intel.com/repos/3.5/iotdk/edi.
 * opkg_download: Failed to download http://iotdk.intel.com/repos/3.5/iotdk/edi.
 * opkg_download: Failed to download http://iotdk.intel.com/repos/3.5/iotdk/edi.
root@edison:~#
```

We will not upgrade packages to avoid consuming disk space

Install Git, Version Control System

```bash
root@edison:~# opkg install git
Package git (2.0.1-r0) installed in root is up to date.
root@edison:~#
```

Check if RMAA and UPM Libraries are installed and upgrade them

```bash
root@edison:~# opkg list-installed | grep mraa
mraa - 0.9.5-r0
mraa-dev - 0.9.5-r0
mraa-doc - 0.9.5-r0
```

```bash
root@edison:~# opkg list-installed | grep upm
upm - 0.5.1-r0
upm-dev - 0.5.1-r0
```

```bash
root@edison:~# opkg install mraa 
Upgrading mraa from 0.8.0 to 0.9.0 on root.
Downloading http://iotdk.intel.com/repos/2.0/intelgalactic/mraa_0.9.0_i586.ipk.
Removing obsolete file /usr/lib/libmraa.so.0.8.0.
Removing obsolete file /usr/share/mraa/examples/python/uart.py.
Configuring mraa.
```

```bash
root@edison:~# opkg install upm
Upgrading upm from 0.3.1-r0 to 0.3.2 on root.
Downloading http://iotdk.intel.com/repos/1.5/intelgalactic/upm_0.3.2_i586.ipk.
Removing package upm-dev from root...
Removing obsolete file /usr/lib/libupm-wt5001.so.0.3.1.
...
Configuring upm.
root@edison:~#
```

Install extra packages required

```bash
root@edison:~# opkg install python-numpy opencv python-opencv nano alsa-utils mpg123
Installing python-numpy (1.7.0-r1) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/python-numpy_1.7.0-r1_core2-32.ipk.
Installing python-doctest (2.7.3-r0.3) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/python-doctest_2.7.3-r0.3_core2-32.ipk.
...
Configuring alsa-utils-speakertest.
Configuring alsa-utils-aseqnet.
Configuring alsa-utils-aseqdump.
Configuring alsa-utils.
Configuring mpg123.
```

## Opkg @ Galileo

Update Opkg sources

```bash
root@galileo:~# cat /etc/opkg/base-feeds.conf
```

```bash
root@galileo:~# opkg update
...
root@galileo:~#
```

Enable a Opkg feed and update package list, we will not upgrade to avoid consuming disk space

```bash
root@galileo:~# vi /etc/opkg/base-feeds.conf
```

Add the below lines to the opened file

```bash
src/gz all http://repo.opkg.net/galileo/repo/all
src/gz clanton http://repo.opkg.net/galileo/repo/clanton
src/gz i586 http://repo.opkg.net/galileo/repo/i586
```

```bash
root@galileo:~# opkg update
Downloading http://repo.opkg.net/galileo/repo/all/Packages.gz.
Inflating http://repo.opkg.net/galileo/repo/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/all.
Downloading http://repo.opkg.net/galileo/repo/clanton/Packages.gz.
Inflating http://repo.opkg.net/galileo/repo/clanton/Packages.gz.
Updated list of available packages in /var/lib/opkg/clanton.
Downloading http://repo.opkg.net/galileo/repo/i586/Packages.gz.
Inflating http://repo.opkg.net/galileo/repo/i586/Packages.gz.
Updated list of available packages in /var/lib/opkg/i586.
Downloading http://iotdk.intel.com/repos/1.5/iotdk/all/Packages.
Updated list of available packages in /var/lib/opkg/iotdk-all.
Downloading http://iotdk.intel.com/repos/1.5/iotdk/i586/Packages.
Updated list of available packages in /var/lib/opkg/iotdk-i586.
Downloading http://iotdk.intel.com/repos/1.5/iotdk/quark/Packages.
Updated list of available packages in /var/lib/opkg/iotdk-quark.
Downloading http://iotdk.intel.com/repos/1.5/iotdk/x86/Packages.
Updated list of available packages in /var/lib/opkg/iotdk-x86.
Downloading http://iotdk.intel.com/repos/1.5/intelgalactic/Packages.
Updated list of available packages in /var/lib/opkg/mraa-upm.
root@galileo:~#
```

Install Git, Version Control System

```bash
root@galileo:~# opkg install git
...
```

Check if RMAA and UPM Libraries are installed

```bash
root@galileo:~# opkg list-installed | grep mraa
root@galileo:~# opkg list-installed | grep upm
root@galileo:~# opkg install libmraa0
```

Install extra packages required

```bash
root@galileo:~# opkg install python-numpy opencv python-opencv nano alsa-utils
root@galileo:~# cd
root@galileo:~# wget http://downloads.sourceforge.net/project/mpg123/mpg123/1.22.4/mpg123-1.22.4.tar.bz2
root@galileo:~# tar xvf mpg123-1.22.4.tar.bz2
root@galileo:~# cd mpg123-1.22.4/
root@galileo:~# ./configure
root@galileo:~# make
root@galileo:~# make install
```

Try but this package is not Working!

```bash
root@galileo:~# opkg update python-pygame
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theiotlearninginitiative.gitbook.io/internetofthings101/architecture/thing/embedded-linux/package-management-system/labs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
