Simplified doc-site generation
[AGL/documentation.git] / docs / 3_Developer_Guides / 2_Building_Microservices_Natively / 2_download-packages.md
1 ---
2 edit_link: ''
3 title: Download Packages
4 origin_url: >-
5   https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/agl-documentation/host-configuration/docs/2-download-packages.md
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/host-configuration-developer-guides-devguides-book.yml -->
9
10 # Download Packages
11
12 Different repositories exist for different AGL releases.\
13 You need to download and install the packages based on your version
14 of AGL.
15
16 ## Set the `REVISION` Environment Variable
17
18 All the packages reside in repositories managed by the
19 [OpenSUSE Build Service (OBS)](https://build.opensuse.org/).\
20 You can see the packages
21 [here](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive#).
22
23 Currently, support exists for the following AGL releases:
24
25 * ElectricEel
26 * FunkyFlounder
27 * GrumpyGuppy
28 * HappyHalibut
29 * Master
30
31 You need to set the `REVISION` environment variable to the AGL release you
32 are using.\
33 For this example, set and export `REVISION` as "Master".
34
35 ```bash
36 export REVISION=Master
37 ```
38
39 For additional details about OBS, see
40 [LinuxAutomotive page on OBS](https://build.opensuse.org/project/show/isv:LinuxAutomotive).
41
42 ## Make Sure Your `DISTRO` Environment Variable is Set
43
44 The `DISTRO` environment variable needs to be correctly set for your
45 Linux distribution.\
46 See the
47 "[Verify Your Build Host](./1-verify-build-host.html)"
48 section for information on how to set this variable.
49
50 ## Install the Repository
51
52 ```bash
53 Hit:1 https://deb.nodesource.com/node_10.x xenial InRelease
54 Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease
55 Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease
56 Hit:4 http://us.archive.ubuntu.com/ubuntu xenial InRelease
57 Ign:5 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ InRelease
58 Hit:6 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
59 Hit:7 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ Release
60 Hit:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
61 Reading package lists... Done
62 ```
63
64 Not sure why you get the `Ign` on line 5.\
65 I guess InRelease does not exist.
66
67 If you don't have a `/etc/apt/sources.list.d/AGL.list` file to even start with,
68 and you run through the whole thing, you get the following output:
69
70 ```bash
71 $ sudo apt-get update
72 Hit:1 https://deb.nodesource.com/node_10.x xenial InRelease
73 Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease
74 Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease
75 Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
76 Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
77 Ign:6 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ InRelease
78 Hit:7 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ Release
79 Get:9 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
80 Get:10 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [902 kB]
81 Fetched 1,225 kB in 1s (803 kB/s)
82 Reading package lists... Done
83 ```
84
85 Following are example commands that show how to install the package repository
86 based on various values of `DISTRO` and `REVISION`:
87
88 ### Ubuntu and "Master"
89
90 ```bash
91 export REVISION=Master
92 export DISTRO="xUbuntu_18.04"
93 wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/Release.key | sudo apt-key add -
94 sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF
95 #AGL
96 deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/ ./
97 EOF"
98 sudo apt-get update
99 ```
100
101 You can see the installed repository using the following command:
102
103 ```bash
104 cat /etc/apt/sources.list.d/AGL.list
105 ```
106
107 ### OpenSUSE and "Master"
108
109 ```bash
110 export DISTRO="openSUSE_Leap_15.0"
111 export REVISION=Master
112 source /etc/os-release; export DISTRO=$(echo $PRETTY_NAME | sed "s/ /_/g")
113 sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo
114 sudo zypper --gpg-auto-import-keys ref
115 ```
116
117 You can see the installed repository using the following command:
118
119 ```bash
120 zypper repos | grep AGL
121 ```
122
123 ### Fedora and "Master"
124
125 ```bash
126 export DISTRO="Fedora_28"
127 export REVISION=Master
128 source /etc/os-release ; export DISTRO="${NAME}_${VERSION_ID}"
129 sudo wget -O /etc/yum.repos.d/isv:LinuxAutomotive:AGL_${REVISION}.repo http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo
130 ```
131
132 You can see the installed repository using the following command:
133
134 ```bash
135 dnf repolist --all | grep AGL
136 ```
137
138 ## Switching Between Repositories
139
140 The commands in the previous section showed you how to install the packages
141 from a specific repository and how to verify whether or not the packages
142 are enabled or disabled.
143 You can switch between different repositories.
144 You must disable your current AGL repository and then enable the repository
145 designated for the switch.
146
147 Following is an example for Debian distributions:
148
149 ### Example for Debian distro
150
151 Suppose you are on "master" and you want the "ElectricEel" AGL revision.
152
153 ```bash
154 export OLDR=Master
155 export NEWR=ElectricEel
156 sudo sed -i "s/${OLDR}/${NEWR}/g" /etc/apt/sources.list.d/AGL.list
157 sudo apt-get update
158 ```
159
160 ### Example for openSuse distro
161
162 ```bash
163 #  | Alias                               | Name                                                                                      | Enabled | GPG Check | Refresh
164 ---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+--------
165  1 | Atom                                | Atom Editor                                                                               | Yes     | (r ) Yes  | No
166  2 | code                                | Visual Studio Code                                                                        | Yes     | (r ) Yes  | No
167  3 | http-ftp.uni-erlangen.de-e3cebb6d   | Packman Repository                                                                        | Yes     | (r ) Yes  | Yes
168  4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0)                                  | Yes     | (r ) Yes  | No
169  5 | isv_LinuxAutomotive_AGL_Master      | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | No      | ----      | ----
170  6 | openSUSE-Leap-15.0-1                | openSUSE-Leap-15.0-1                                                                      | No      | ----      | ----
171  7 | repo-debug                          | openSUSE-Leap-15.0-Debug                                                                  | No      | ----      | ----
172  8 | repo-debug-non-oss                  | openSUSE-Leap-15.0-Debug-Non-Oss                                                          | No      | ----      | ----
173  9 | repo-debug-update                   | openSUSE-Leap-15.0-Update-Debug                                                           | No      | ----      | ----
174 10 | repo-debug-update-non-oss           | openSUSE-Leap-15.0-Update-Debug-Non-Oss                                                   | No      | ----      | ----
175 11 | repo-non-oss                        | openSUSE-Leap-15.0-Non-Oss                                                                | Yes     | (r ) Yes  | Yes
176 12 | repo-oss                            | openSUSE-Leap-15.0-Oss                                                                    | Yes     | (r ) Yes  | Yes
177 13 | repo-source                         | openSUSE-Leap-15.0-Source                                                                 | No      | ----      | ----
178 14 | repo-source-non-oss                 | openSUSE-Leap-15.0-Source-Non-Oss                                                         | No      | ----      | ----
179 15 | repo-update                         | openSUSE-Leap-15.0-Update                                                                 | Yes     | (r ) Yes  | Yes
180 16 | repo-update-non-oss                 | openSUSE-Leap-15.0-Update-Non-Oss                                                         | Yes     | (r ) Yes  | Yes
181 ```
182
183 Now, you want your "master" repository enabled.
184 In the above output, the "ElectricEel" repository is at the fourth line
185 and the "master" repository is at the fifth line.
186 Thus, enter the following:
187
188 ```bash
189 $ sudo zypper mr -d 4 && sudo zypper mr -e 5
190 Repository 'isv_LinuxAutomotive_AGL_ElectricEel' has been successfully disabled.
191 Repository 'isv_LinuxAutomotive_AGL_Master' has been successfully enabled.
192 sudo zypper refresh
193 ```
194
195 **NOTE:** In the previous command, the "-d" option is used for "disable" and the
196 "-e" option is used for "enable".
197
198 Following are the results:
199
200 ```bash
201 #  | Alias                               | Name                                                                                      | Enabled | GPG Check | Refresh
202 ---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+--------
203  1 | Atom                                | Atom Editor                                                                               | Yes     | (r ) Yes  | No
204  2 | code                                | Visual Studio Code                                                                        | Yes     | (r ) Yes  | No
205  3 | http-ftp.uni-erlangen.de-e3cebb6d   | Packman Repository                                                                        | Yes     | (r ) Yes  | Yes
206  4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0)                                  | No      | ----      | ----
207  5 | isv_LinuxAutomotive_AGL_Master      | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | Yes     | (r ) Yes  | No
208  6 | openSUSE-Leap-15.0-1                | openSUSE-Leap-15.0-1                                                                      | No      | ----      | ----
209  7 | repo-debug                          | openSUSE-Leap-15.0-Debug                                                                  | No      | ----      | ----
210  8 | repo-debug-non-oss                  | openSUSE-Leap-15.0-Debug-Non-Oss                                                          | No      | ----      | ----
211  9 | repo-debug-update                   | openSUSE-Leap-15.0-Update-Debug                                                           | No      | ----      | ----
212 10 | repo-debug-update-non-oss           | openSUSE-Leap-15.0-Update-Debug-Non-Oss                                                   | No      | ----      | ----
213 11 | repo-non-oss                        | openSUSE-Leap-15.0-Non-Oss                                                                | Yes     | (r ) Yes  | Yes
214 12 | repo-oss                            | openSUSE-Leap-15.0-Oss                                                                    | Yes     | (r ) Yes  | Yes
215 13 | repo-source                         | openSUSE-Leap-15.0-Source                                                                 | No      | ----      | ----
216 14 | repo-source-non-oss                 | openSUSE-Leap-15.0-Source-Non-Oss                                                         | No      | ----      | ----
217 15 | repo-update                         | openSUSE-Leap-15.0-Update                                                                 | Yes     | (r ) Yes  | Yes
218 16 | repo-update-non-oss                 | openSUSE-Leap-15.0-Update-Non-Oss                                                         | Yes     | (r ) Yes  | Yes
219 ```
220
221 ### Example for Fedora distro
222
223 ```bash
224 isv_LinuxAutomotive_AGL_FunkyFlounder       isv:LinuxAutomotive:AGL disabled
225 isv_LinuxAutomotive_AGL_Master            Automotive Grade Linux  enabled
226 ```
227
228 The following commands enable the "ElectricEel" repository:
229
230 ```bash
231 dnf config-manager --set-disabled isv_LinuxAutomotive_AGL_Master
232 dnf config-manager --set-enabled isv_LinuxAutomotive_AGL_FunkyFlounder
233 ```
234
235 ```bash
236 $ dnf repolist --all | grep AGL
237 isv_LinuxAutomotive_AGL_FunkyFlounder       isv:LinuxAutomotive:AGL enabled
238 isv_LinuxAutomotive_AGL_Master            Automotive Grade Linux  disabled
239 ```