Open NX-OS provides support for standard package management infrastructure. It supports two possible hosting environments for installing packages:
- Bash shell: this is the native Open NX-OS Linux environment. It is disabled by default. To enable access, users must explicitly enable the bash shell feature on the switch.
- Guest shell: this is a secure Linux container environment running CentOS 7.
The focus of this section will be on managing packages in bash shell, or the native Linux environment where NX-OS runs. The guest shell environment will be covered in a subsequent section.
Yellowdog Updater, Modified (yum)
Yum is the default package and repository management tool for a number of operating systems, including Open NX-OS Linux. The yum package management infrastructure provides the following benefits:
automatic resolution of software dependencies.
easy to use Command Line Interface to install or upgrade software.
yum can be configured to browse/search multiple software locations at one time for the existence of a specific package.
ability to use either local (on box) or remote software repositories to install or upgrade software.
The yum client downloads software from repositories located on a local network or the Internet. RPM package files in these repositories are organized in a hierarchical manner so they can be found by the yum client.
From the command line, you can use the following subset of commands to interact with yum:
Command |
Description |
yum install [package-name(s)] |
Installs the specified package(s) along with any required dependencies. |
yum erase [package-name(s)] |
Removes the specified package(s) from your system. |
yum search [search-pattern] |
Searches the list of package names and descriptions for packages that match the search pattern and provides a list of package names along with architectures and a brief description of the package contents. Note that regular expression searches are not permitted. |
yum deplist [package-name] |
Provides a listing of all of the libraries and modules that the named package depends on, along with the names of the packages (including versions) that provide those dependencies. |
yum check-update |
Refreshes the local cache of the yum database so that dependency information and the latest packages are always up to date. |
yum info [package-name] |
Provides the name, description of the package, as well as a link to the upstream home page for the software, release versions and the installed size of the software. |
yum reinstall [package-name(s)] |
Erases and re-downloads a new copy of the package file and re-installs the software on your system. |
yum localinstall [local-rpm-file] |
Checks the dependencies of a .rpm file and then installs it. |
yum update [optional-package-name] |
Downloads and installs all updates including bug fixes, security releases, and upgrades, as provided by the distributors of your operating system. Note that you can specify package names with the update command. |
yum upgrade |
Upgrades all packages installed on the system to the latest release. |
Example: Installing Puppet Agent Using yum
To install an agent or software package natively in Open NX-OS, users will need a routable connection to a software repository. This could be through any namespace that has connectivity externally (Default or Management).
The file located at /etc/yum/yum.conf provides system-wide configuration options for yum, as well as information about repositories. Specific repository information within Open NX-OS Linux is located in files ending in .repo under /etc/yum/repos.d: the repository to edit for pre-built third-party agents is thirdparty.repo on the switch. You will need to edit the baseurl field to point to your repository if you utilize one in your network.
Example: Installing a Software Agent (Puppet) Using yum
Dependencies Resolved
Package |
Arch |
Version |
Repository |
Size |
Installing: |
|
|
|
|
puppet-agent |
x86_64 |
1.1.0.153.g77189ea-1.nxos1 |
thirdparty |
37 M |
Transaction Summary
Install 1 Package
Total download size: 37 M
Installed size: 133 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : puppet-agent-1.1.0.153.g77189ea-1.nxos1.x86_64 1/1
Installed:
puppet-agent.x86_64 0:1.1.0.153.g77189ea-1.nxos1
Complete!
Example for Removing a Software Agent (Puppet) Using yum
Dependencies Resolved
===============================================================================================
Package |
Arch |
Version |
Repository |
Size |
Removing: |
|
|
|
|
puppet-agent |
x86_64 |
1.1.0.153.g77189ea-1.nxos1 |
@thirdparty |
133 M |
Transaction Summary
Remove 1 Package
Installed size: 133 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : puppet-agent-1.1.0.153.g77189ea-1.nxos1.x86_64 1/1
Removed:
puppet-agent.x86_64 0:1.1.0.153.g77189ea-1.nxos1
Complete!