|
143 | 143 | * [Watermark Show commands](#watermark-show-commands)
|
144 | 144 | * [Watermark Config commands](#watermark-config-commands)
|
145 | 145 | * [Software Installation and Management](#software-installation-and-management)
|
| 146 | + * [SONiC Package Manager](#sonic-package-manager) |
146 | 147 | * [SONiC Installer](#sonic-installer)
|
147 | 148 | * [Troubleshooting Commands](#troubleshooting-commands)
|
148 | 149 | * [Routing Stack](#routing-stack)
|
@@ -8088,8 +8089,316 @@ Go Back To [Beginning of the document](#) or [Beginning of this section](#waterm
|
8088 | 8089 |
|
8089 | 8090 | ## Software Installation and Management
|
8090 | 8091 |
|
8091 |
| -SONiC software can be installed in two methods, viz, "using sonic-installer tool", "ONIE Installer". |
| 8092 | +SONiC images can be installed in one of two methods: |
| 8093 | +1. From within a running SONiC image using the `sonic-installer` utility |
| 8094 | +2. From the vendor's bootloader (E.g., ONIE, Aboot, etc.) |
8092 | 8095 |
|
| 8096 | +SONiC packages are available as prebuilt Docker images and meant to be installed with the *sonic-package-manager* utility. |
| 8097 | +
|
| 8098 | +### SONiC Package Manager |
| 8099 | +
|
| 8100 | +The *sonic-package-manager* is a command line tool to manage (e.g. install, upgrade or uninstall) SONiC Packages. |
| 8101 | +
|
| 8102 | +**sonic-package-manager list** |
| 8103 | +
|
| 8104 | +This command lists all available SONiC packages, their desription, installed version and installation status. |
| 8105 | +SONiC package status can be *Installed*, *Not installed* or *Built-In*. "Built-In" status means that a feature is built-in to SONiC image and can't be upgraded or uninstalled. |
| 8106 | +
|
| 8107 | +- Usage: |
| 8108 | + ``` |
| 8109 | + sonic-package-manager list |
| 8110 | + ``` |
| 8111 | +
|
| 8112 | +- Example: |
| 8113 | + ``` |
| 8114 | + admin@sonic:~$ sonic-package-manager list |
| 8115 | + Name Repository Description Version Status |
| 8116 | + -------------- --------------------------- ---------------------------- --------- -------------- |
| 8117 | + cpu-report azure/cpu-report CPU report package N/A Not Installed |
| 8118 | + database docker-database SONiC database package 1.0.0 Built-In |
| 8119 | + dhcp-relay azure/docker-dhcp-relay SONiC dhcp-relay package 1.0.0 Installed |
| 8120 | + fpm-frr docker-fpm-frr SONiC fpm-frr package 1.0.0 Built-In |
| 8121 | + lldp docker-lldp SONiC lldp package 1.0.0 Built-In |
| 8122 | + macsec docker-macsec SONiC macsec package 1.0.0 Built-In |
| 8123 | + mgmt-framework docker-sonic-mgmt-framework SONiC mgmt-framework package 1.0.0 Built-In |
| 8124 | + nat docker-nat SONiC nat package 1.0.0 Built-In |
| 8125 | + pmon docker-platform-monitor SONiC pmon package 1.0.0 Built-In |
| 8126 | + radv docker-router-advertiser SONiC radv package 1.0.0 Built-In |
| 8127 | + sflow docker-sflow SONiC sflow package 1.0.0 Built-In |
| 8128 | + snmp docker-snmp SONiC snmp package 1.0.0 Built-In |
| 8129 | + swss docker-orchagent SONiC swss package 1.0.0 Built-In |
| 8130 | + syncd docker-syncd-mlnx SONiC syncd package 1.0.0 Built-In |
| 8131 | + teamd docker-teamd SONiC teamd package 1.0.0 Built-In |
| 8132 | + telemetry docker-sonic-telemetry SONiC telemetry package 1.0.0 Built-In |
| 8133 | + ``` |
| 8134 | +
|
| 8135 | +**sonic-package-manager repository add** |
| 8136 | +
|
| 8137 | +This command will add a new repository as source for SONiC packages to the database. *NOTE*: requires elevated (root) privileges to run |
| 8138 | +
|
| 8139 | +- Usage: |
| 8140 | + ``` |
| 8141 | + Usage: sonic-package-manager repository add [OPTIONS] NAME REPOSITORY |
| 8142 | +
|
| 8143 | + Add a new repository to database. |
| 8144 | +
|
| 8145 | + NOTE: This command requires elevated (root) privileges to run. |
| 8146 | +
|
| 8147 | + Options: |
| 8148 | + --default-reference TEXT Default installation reference. Can be a tag or |
| 8149 | + sha256 digest in repository. |
| 8150 | + --description TEXT Optional package entry description. |
| 8151 | + --help Show this message and exit. |
| 8152 | + ``` |
| 8153 | +- Example: |
| 8154 | + ``` |
| 8155 | + admin@sonic:~$ sudo sonic-package-manager repository add \ |
| 8156 | + cpu-report azure/sonic-cpu-report --default-reference 1.0.0 |
| 8157 | + ``` |
| 8158 | +
|
| 8159 | +**sonic-package-manager repository remove** |
| 8160 | +
|
| 8161 | +This command will remove a repository as source for SONiC packages from the database . The package has to be *Not Installed* in order to be removed from package database. *NOTE*: requires elevated (root) privileges to run |
| 8162 | +
|
| 8163 | +- Usage: |
| 8164 | + ``` |
| 8165 | + Usage: sonic-package-manager repository remove [OPTIONS] NAME |
| 8166 | +
|
| 8167 | + Remove repository from database. |
| 8168 | +
|
| 8169 | + NOTE: This command requires elevated (root) privileges to run. |
| 8170 | +
|
| 8171 | + Options: |
| 8172 | + --help Show this message and exit. |
| 8173 | + ``` |
| 8174 | +- Example: |
| 8175 | + ``` |
| 8176 | + admin@sonic:~$ sudo sonic-package-manager repository remove cpu-report |
| 8177 | + ``` |
| 8178 | +
|
| 8179 | +**sonic-package-manager install** |
| 8180 | +
|
| 8181 | +This command pulls and installs a package on SONiC host. *NOTE*: this command requires elevated (root) privileges to run |
| 8182 | +
|
| 8183 | +- Usage: |
| 8184 | + ``` |
| 8185 | + Usage: sonic-package-manager install [OPTIONS] [PACKAGE_EXPR] |
| 8186 | +
|
| 8187 | + Install/Upgrade package using [PACKAGE_EXPR] in format |
| 8188 | + "<name>[=<version>|@<reference>]". |
| 8189 | +
|
| 8190 | + The repository to pull the package from is resolved by lookup in |
| 8191 | + package database, thus the package has to be added via "sonic- |
| 8192 | + package-manager repository add" command. |
| 8193 | +
|
| 8194 | + In case when [PACKAGE_EXPR] is a package name "<name>" this command |
| 8195 | + will install or upgrade to a version referenced by "default- |
| 8196 | + reference" in package database. |
| 8197 | +
|
| 8198 | + NOTE: This command requires elevated (root) privileges to run. |
| 8199 | +
|
| 8200 | + Options: |
| 8201 | + --enable Set the default state of the feature to enabled |
| 8202 | + and enable feature right after installation. NOTE: |
| 8203 | + user needs to execute "config save -y" to make |
| 8204 | + this setting persistent. |
| 8205 | + --set-owner [local|kube] Default owner configuration setting for a feature. |
| 8206 | + --from-repository TEXT Fetch package directly from image registry |
| 8207 | + repository. NOTE: This argument is mutually |
| 8208 | + exclusive with arguments: [package_expr, |
| 8209 | + from_tarball]. |
| 8210 | + --from-tarball FILE Fetch package from saved image tarball. NOTE: This |
| 8211 | + argument is mutually exclusive with arguments: |
| 8212 | + [package_expr, from_repository]. |
| 8213 | + -f, --force Force operation by ignoring package dependency |
| 8214 | + tree and package manifest validation failures. |
| 8215 | + -y, --yes Automatically answer yes on prompts. |
| 8216 | + -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG. |
| 8217 | + Default is INFO. |
| 8218 | + --skip-host-plugins Do not install host OS plugins provided by the |
| 8219 | + package (CLI, etc). NOTE: In case when package |
| 8220 | + host OS plugins are set as mandatory in package |
| 8221 | + manifest this option will fail the installation. |
| 8222 | + --allow-downgrade Allow package downgrade. By default an attempt to |
| 8223 | + downgrade the package will result in a failure |
| 8224 | + since downgrade might not be supported by the |
| 8225 | + package, thus requires explicit request from the |
| 8226 | + user. |
| 8227 | + --help Show this message and exit.. |
| 8228 | + ``` |
| 8229 | +- Example: |
| 8230 | + ``` |
| 8231 | + admin@sonic:~$ sudo sonic-package-manager install dhcp-relay=1.0.2 |
| 8232 | + ``` |
| 8233 | + ``` |
| 8234 | + admin@sonic:~$ sudo sonic-package-manager install dhcp-relay@latest |
| 8235 | + ``` |
| 8236 | + ``` |
| 8237 | + admin@sonic:~$ sudo sonic-package-manager install dhcp-relay@sha256:9780f6d83e45878749497a6297ed9906c19ee0cc48cc88dc63827564bb8768fd |
| 8238 | + ``` |
| 8239 | + ``` |
| 8240 | + admin@sonic:~$ sudo sonic-package-manager install --from-repository azure/sonic-cpu-report:latest |
| 8241 | + ``` |
| 8242 | + ``` |
| 8243 | + admin@sonic:~$ sudo sonic-package-manager install --from-tarball sonic-docker-image.gz |
| 8244 | + ``` |
| 8245 | +
|
| 8246 | +**sonic-package-manager uninstall** |
| 8247 | +
|
| 8248 | +This command uninstalls package from SONiC host. User needs to stop the feature prior to uninstalling it. |
| 8249 | +*NOTE*: this command requires elevated (root) privileges to run. |
| 8250 | +
|
| 8251 | +- Usage: |
| 8252 | + ``` |
| 8253 | + Usage: sonic-package-manager uninstall [OPTIONS] NAME |
| 8254 | +
|
| 8255 | + Uninstall package. |
| 8256 | +
|
| 8257 | + NOTE: This command requires elevated (root) privileges to run. |
| 8258 | +
|
| 8259 | + Options: |
| 8260 | + -f, --force Force operation by ignoring package dependency tree and |
| 8261 | + package manifest validation failures. |
| 8262 | + -y, --yes Automatically answer yes on prompts. |
| 8263 | + -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG. Default |
| 8264 | + is INFO. |
| 8265 | + --help Show this message and exit. |
| 8266 | + ``` |
| 8267 | +- Example: |
| 8268 | + ``` |
| 8269 | + admin@sonic:~$ sudo sonic-package-manager uninstall dhcp-relay |
| 8270 | + ``` |
| 8271 | +
|
| 8272 | +**sonic-package-manager reset** |
| 8273 | +
|
| 8274 | +This comamnd resets the package by reinstalling it to its default version. *NOTE*: this command requires elevated (root) privileges to run. |
| 8275 | +
|
| 8276 | +- Usage: |
| 8277 | + ``` |
| 8278 | + Usage: sonic-package-manager reset [OPTIONS] NAME |
| 8279 | +
|
| 8280 | + Reset package to the default version. |
| 8281 | +
|
| 8282 | + NOTE: This command requires elevated (root) privileges to run. |
| 8283 | +
|
| 8284 | + Options: |
| 8285 | + -f, --force Force operation by ignoring package dependency tree and |
| 8286 | + package manifest validation failures. |
| 8287 | + -y, --yes Automatically answer yes on prompts. |
| 8288 | + -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG. Default |
| 8289 | + is INFO. |
| 8290 | + --skip-host-plugins Do not install host OS plugins provided by the package |
| 8291 | + (CLI, etc). NOTE: In case when package host OS plugins |
| 8292 | + are set as mandatory in package manifest this option |
| 8293 | + will fail the installation. |
| 8294 | + --help Show this message and exit. |
| 8295 | + ``` |
| 8296 | +- Example: |
| 8297 | + ``` |
| 8298 | + admin@sonic:~$ sudo sonic-package-manager reset dhcp-relay |
| 8299 | + ``` |
| 8300 | +
|
| 8301 | +**sonic-package-manager show package versions** |
| 8302 | +
|
| 8303 | +This command will retrieve a list of all available versions for the given package from the configured upstream repository |
| 8304 | +
|
| 8305 | +- Usage: |
| 8306 | + ``` |
| 8307 | + Usage: sonic-package-manager show package versions [OPTIONS] NAME |
| 8308 | +
|
| 8309 | + Show available versions. |
| 8310 | +
|
| 8311 | + Options: |
| 8312 | + --all Show all available tags in repository. |
| 8313 | + --plain Plain output. |
| 8314 | + --help Show this message and exit. |
| 8315 | + ``` |
| 8316 | +- Example: |
| 8317 | + ``` |
| 8318 | + admin@sonic:~$ sonic-package-manager show package versions dhcp-relay |
| 8319 | + • 1.0.0 |
| 8320 | + • 1.0.2 |
| 8321 | + • 2.0.0 |
| 8322 | + ``` |
| 8323 | + ``` |
| 8324 | + admin@sonic:~$ sonic-package-manager show package versions dhcp-relay --plain |
| 8325 | + 1.0.0 |
| 8326 | + 1.0.2 |
| 8327 | + 2.0.0 |
| 8328 | + ``` |
| 8329 | + ``` |
| 8330 | + admin@sonic:~$ sonic-package-manager show package versions dhcp-relay --all |
| 8331 | + • 1.0.0 |
| 8332 | + • 1.0.2 |
| 8333 | + • 2.0.0 |
| 8334 | + • latest |
| 8335 | + ``` |
| 8336 | +
|
| 8337 | +**sonic-package-manager show package changelog** |
| 8338 | +
|
| 8339 | +This command fetches the changelog from the package manifest and displays it. *NOTE*: package changelog can be retrieved from registry or read from image tarball without installing it. |
| 8340 | +
|
| 8341 | +- Usage: |
| 8342 | + ``` |
| 8343 | + Usage: sonic-package-manager show package changelog [OPTIONS] [PACKAGE_EXPR] |
| 8344 | +
|
| 8345 | + Show package changelog. |
| 8346 | +
|
| 8347 | + Options: |
| 8348 | + --from-repository TEXT Fetch package directly from image registry |
| 8349 | + repository NOTE: This argument is mutually exclusive |
| 8350 | + with arguments: [from_tarball, package_expr]. |
| 8351 | + --from-tarball FILE Fetch package from saved image tarball NOTE: This |
| 8352 | + argument is mutually exclusive with arguments: |
| 8353 | + [package_expr, from_repository]. |
| 8354 | + --help Show this message and exit. |
| 8355 | + ``` |
| 8356 | +- Example: |
| 8357 | + ``` |
| 8358 | + admin@sonic:~$ sonic-package-manager show package changelog dhcp-relay |
| 8359 | + 1.0.0: |
| 8360 | +
|
| 8361 | + • Initial release |
| 8362 | +
|
| 8363 | + Author ([email protected]) Mon, 25 May 2020 12:25:00 +0300 |
| 8364 | + ``` |
| 8365 | +
|
| 8366 | +**sonic-package-manager show package manifest** |
| 8367 | +
|
| 8368 | +This command fetches the package manifest and displays it. *NOTE*: package manifest can be retrieved from registry or read from image tarball without installing it. |
| 8369 | +
|
| 8370 | +- Usage: |
| 8371 | + ``` |
| 8372 | + Usage: sonic-package-manager show package manifest [OPTIONS] [PACKAGE_EXPR] |
| 8373 | +
|
| 8374 | + Show package manifest. |
| 8375 | +
|
| 8376 | + Options: |
| 8377 | + --from-repository TEXT Fetch package directly from image registry |
| 8378 | + repository NOTE: This argument is mutually exclusive |
| 8379 | + with arguments: [package_expr, from_tarball]. |
| 8380 | + --from-tarball FILE Fetch package from saved image tarball NOTE: This |
| 8381 | + argument is mutually exclusive with arguments: |
| 8382 | + [from_repository, package_expr]. |
| 8383 | + -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG |
| 8384 | + --help Show this message and exit. |
| 8385 | + ``` |
| 8386 | +- Example: |
| 8387 | + ``` |
| 8388 | + admin@sonic:~$ sonic-package-manager show package manifest dhcp-relay=2.0.0 |
| 8389 | + { |
| 8390 | + "version": "1.0.0", |
| 8391 | + "package": { |
| 8392 | + "version": "2.0.0", |
| 8393 | + "depends": [ |
| 8394 | + "database>=1.0.0,<2.0.0" |
| 8395 | + ] |
| 8396 | + }, |
| 8397 | + "service": { |
| 8398 | + "name": "dhcp_relay" |
| 8399 | + } |
| 8400 | + } |
| 8401 | + ``` |
8093 | 8402 |
|
8094 | 8403 | ### SONiC Installer
|
8095 | 8404 | This is a command line tool available as part of the SONiC software; If the device is already running the SONiC software, this tool can be used to install an alternate image in the partition.
|
@@ -8160,6 +8469,13 @@ This command is used to install a new image on the alternate image partition. T
|
8160 | 8469 | Done
|
8161 | 8470 | ```
|
8162 | 8471 |
|
| 8472 | +Installing a new image using the sonic-installer will keep using the packages installed on the currently running SONiC image and automatically migrate those. In order to perform clean SONiC installation use the *--skip-package-migration* option: |
| 8473 | +
|
| 8474 | +- Example: |
| 8475 | + ``` |
| 8476 | + admin@sonic:~$ sudo sonic-installer install https://sonic-jenkins.westus.cloudapp.azure.com/job/xxxx/job/buildimage-xxxx-all/xxx/artifact/target/sonic-xxxx.bin --skip-package-migration |
| 8477 | + ``` |
| 8478 | +
|
8163 | 8479 | **sonic-installer set_default**
|
8164 | 8480 |
|
8165 | 8481 | This command is be used to change the image which can be loaded by default in all the subsequent reboots.
|
|
0 commit comments