IPS Lab
IPS Lab
1 Introduction
We will go on a brief tour of the new IPS feature and help the learner gain
confidence in this new technology to be able to take their expertise to the
next step.
2 Overview
3 Repository basics
Administrators can quickly see what configuration a system has by using the
pkg publisher command:
# pkg publisher
We can quickly query some basic information about this repository using the
pkgrepo info command:
Type the pkg info command on your system to see if you can find any
information on it.
Let’s go ahead and install this package but with what’s called a ‘dry-run’
installation using the ‘nv’ switch. This means that the system will go through
the actual package install without actually installing anything. This is to
troubleshoot any potential issues that may arise with this package
installation.
Note: In order to install a package, you’ll need to ‘su –‘ to the root role.
Please feel free to remain in the root role unless directed for another
exercise.
For a dry run (no changes have been made to the system), we used the –nv
switch. We learn from this output that this package …
Note: A boot environment is one that is created and set Active on next
reboot in order to make it the default environment. A Backup boot
environment is one that is created and not set to active so that you may
boot into it if necessary. We’ll learn about boot environments later in this
lesson
Let’s uninstall gcc-3 and try again in a new boot environment which is a
manual way to create a backup copy to revert back to in case something
should go wrong with this package install.
Now let’s run the install command with a switch that will automatically
create a backup environment for us to protect the system if we should
encounter a problem.
Note: In the above output, the ‘Create boot environment:’ field now says
‘Yes’. In the screen below the screen informs us that the clone has been
updated, activated, and will be the default boot environment on next boot.
# beadm list
Note in the output above the size of the boot environments. before-gcc is
5.32GB and solaris is only around 200k. Also note the capital letters R and N.
R stands for ‘active on next Reboot’ and N stands for ‘active Now’.
We don’t want to reboot now so let’s set the active boot environment back to
our default ‘solaris’ instance.
# beadm list
Note that now the ‘solaris’ instance is marked with “NR” which means that it
is Active ‘Now’ and will be Active on the next ‘Reboot’.
Let’s delete (destroy) our boot environment for now but leaving it intact
would be just as easy and require hardly any resources.
# beadm destroy before-gcc
Answer ‘y’
Verify that gcc-be is gone and solaris has been marked with NR.
# beadm list
This lab has attempted to illustrate how easy it is to install packages as well
as create backup boot environments and how few resources they need. It’s
recommended that systems administrators use backup environments as
their day to day best practices when administering and maintaining systems.
The last thing we’ll do in this section is to create a boot environment to show
how simple it is.
Note that the environment is not active and not going to be active at the
next reboot. But it’s available for us to boot into if we should need to return
to our original environment.
Boot environments are easy to create and take up few resources. Use them
often.
The pkg list command will return every package on the system. You can limit
the output by typing the name of an existing package.
# pkg list
The output will shows us a concatenated version of the ‘pkg list’ command
with no arguments. It basically lists out every package on the system. If you
run it on your system you’ll see many lines scroll by quickly. The second
package list command we give with a specific package name to show the
information that can be obtained from the command. The columns will list
the name, version and an IFO column.
For example:
The ‘-af’ option lists all matching packages, including those that can’t be
installed in this image. *toolkit matches any item with the word ‘toolkit’ in it,
and @latest lists only the newest packages. This output indicates that …
Below is the command that will give you more information about a package
that’s installed on our system already.
The system will complain that there are no packages matching what you’ve
entered. Use the ‘-r’ option to query the Repository to get information on
uninstalled packages. ‘-r’ queries the remote IPS repository that you have
configured on your system.
To list the contents of a package and the paths and files that are installed
use the contents subcommand.
Another powerful feature of IPS is the ability to search for specific things
about the packages, like the name of a package that a file might belong to.
Use the command below to search the repository for a file called stdio.h and
the output will tell you which applications the file belongs to.
Oracle Solaris 11 IPS technology includes the ability to update your system
to the latest packages with a single command.
To get the latest updates for the entire system at one time you can issue the
pkg update command. Use the ‘- nv’ option for a dry run to get an idea how
much work needs to be done.
You can also update specific packages by specifying them on the command
line.
If you’ve updated a package and need to back an update out you’d use the
revert command.
We can see how these relationships are managed by taking a look at the
manifest of a particular package through the pkg command. A package
manifest describes how a package is assembled and provides basic
information about the package (such as the name, version, description,
categorization, and so on), what files the package includes, and what other
packages or services the package relies on to meet its dependencies. While
many package commands filter this information into a presentable form, it is
sometimes useful to look at the package manifest directly using the ‘pkg
contents –m’ command.
Each line within the manifest is called an action. Actions describe a small
part of the overall package. The first part of each line describes the action
type: set, license, depend, dir, file, and so on. Let’s take a look at an
example of the package manifest using the ‘grep’ command on the ‘gzip’
package.
Take a look at variables that are set on installation of the gzip package.