Command Line Interface

Smart Action Commands

update

install

reinstall

upgrade

clean

remove

check

fix

download

Smart Update

This command will update the known information about the
given channels. If no channels are given, all channels
which are not disabled or setup for manual updates will
be updated.

Options:
  -h, --help   Show this help message and exit
  --after=MIN  Only update if the last successful update happened before the
                   given delay

Examples:
  smart update
  smart update mychannel
  smart update mychannel1 mychannel2

Channels describe package metadata. It is the metadata that is used to determine which packages need to be installed or removed to meet the users request.

Smart Install/Reinstall

Usage: smart install [options] package ...

This command will install one or more packages in the
system. If a new version of an already installed package
is available, the new version will be selected for installation.

Options:
  -h, --help  Show this help message and exit
  --stepped   Split operation in steps
  --urls      Dump needed urls and don't commit operation
  --download  Download packages and don't commit operation
  --explain   Include additional information about changes, when possible
  -y, --yes   Do not ask for confirmation

Examples:
  smart install pkgname
  smart install '*kgna*'
  smart install pkgname-1.0
  smart install pkgname-1.0-1
  smart install pkgname1 pkgname2
  smart install ./somepackage.file
  smart install http://some.url/some/path/somepackage.file

Smart install --stepped is a option that will confirm each step. Say you wanted to install foobar and it required some dependencies; before installing/upgrading those dependencies, it ask for confirmation with each package.

Smart install --explain can be a useful option for figuring out why smart wants to downgrade, remove, upgrade or consider certain packages. Basically, it's good for explaining the dependencies and its decisions.

Smart Upgrade

Usage: smart upgrade [options] [package] ...

This command will upgrade one or more packages which
are currently installed in the system. If no packages
are given, all installed packages will be checked.

Options:
  -h, --help      Show this help message and exit
  --stepped       Split operation in steps
  --urls          Dump needed urls and don't commit operation
  --download      Download packages and don't commit operation
  --update        Update channel information before trying to upgrade
  --check         Just check if there are upgrades to be done
  --check-update  Check if there are upgrades to be done, and update the known
                      upgrades
  --explain       Include additional information about changes,when possible
  -y, --yes       Do not ask for confirmation

Examples:
  smart upgrade
  smart upgrade pkgname
  smart upgrade '*kgnam*'
  smart upgrade pkgname-1.0
  smart upgrade pkgname-1.0-1
  smart upgrade pkgname1 pkgname2

As mentioned before, the stepped option would work the same here, confirming each action before proceeding.

Smart Remove

Usage: smart remove [options] package ...

This command will remove one or more packages which
are currently installed in the system.

Options:
  -h, --help  Show this help message and exit
  --stepped   Split operation in steps
  --urls      Dump needed urls and don't commit operation
  --download  Download packages and don't commit operation
  --explain   Include additional information about changes,when possible
  -y, --yes   Do not ask for confirmation

Examples:
  smart remove pkgname
  smart remove '*kgnam*'
  smart remove pkgname-1.0
  smart remove pkgname-1.0-1
  smart remove pkgname1 pkgname2

Smart Check

Usage: smart check [options] [package] ...

This command will check relations between packages. If no
packages are explicitly given, all packages in the selected
channels will be checked. Relations of the checked packages
will only match packages inside the selected channels.

Use the 'fix' command to fix broken relations of
installed packages.

Options:
  -h, --help          Show this help message and exit
  --all               Check packages in all channels
  --installed         Check packages which are in at least one installed
                          channel (default)
  --available         Check packages which are in at least one non-installed
                          channel
  --channels=ALIASES  Check packages which are inside the given channels (comma
                          separated aliases)

Examples:
  smart check
  smart check pkgname
  smart check '*kgna*'
  smart check pkgname-1.0
  smart check pkgname-1.0-1
  smart check pkgname1 pkgname2

Smart Fix

Usage: smart fix [options] [package] ...

This command will try to fix dependencies of installed packages
which are related to the given packages. Notice that the given
packages may be currently installed or not. If no packages are
given, all installed packages will be checked.

Options:
  -h, --help  Show this help message and exit
  --stepped   Split operation in steps
  --urls      Dump needed urls and don't commit operation
  --download  Download packages and don't commit operation
  --explain   Include additional information about changes,when possible
  -y, --yes   Do not ask for confirmation

Examples:
  smart fix
  smart fix pkgname
  smart fix '*kgna*'
  smart fix pkgname-1.0
  smart fix pkgname-1.0-1
  smart fix pkgname1 pkgname2

Smart Download

Usage: smart download [options] package ...

This command allows downloading one or more given packages.

Options:
  -h, --help    Show this help message and exit
  --target=DIR  Packages will be saved in given directory
  --urls        Dump needed urls and don't download packages
  --from-urls   Download files from the given urls and/or from the given files
                    with lists of urls

Examples:
  smart download pkgname
  smart download '*kgna*'
  smart download pkgname-1.0
  smart download pkgname-1.0-1
  smart download pkgname1 pkgname2
  smart download pkgname --urls 2> pkgname-url.txt
  smart download --from-urls pkgname-url.txt
  smart download --from-urls http://some.url/some/path/somefile

Smart Clean

smart clean

The smart clean command cleans the cache. You may use it to delete old files/packages in order to save space.

Smart Query and Information Commands

Query commands:
search
query
info
stats

Smart Search

This command allows searching for the given expressions
in the name, summary, and description of known packages.

Examples:
  smart search ldap
  smart search kernel module
  smart search rpm 'package manager'
  smart search pkgname
  smart search 'pkgn*e'

Smart Query

This command allows querying the known packages in many
different ways. Check also the 'search' command.

Options:
  -h, --help           Show this help message and exit
  --installed          Consider only installed packages
  --provides=DEP       Show only packages providing the given dependency
  --requires=DEP       Show only packages requiring the given dependency
  --conflicts=DEP      Show only packages conflicting with the given dependency
  --upgrades=DEP       Show only packages upgrading the given dependency
  --name=STR           Show only packages which match given name
  --summary=STR        Show only packages which match given summary
  --description=STR    Show only packages which match given description
  --path=STR           Show only packages which include the given path in the
                           available meta information
  --url=STR            Show only packages which include the given reference url
                           in the available meta information
  --hide-version       Hide package version
  --show-summary       Show package summaries
  --show-provides      Show provides for the given packages
  --show-requires      Show requires for the given packages
  --show-prerequires   Show requires selecting only pre-dependencies
  --show-upgrades      Show upgrades for the given packages
  --show-conflicts     Show conflicts for the given packages
  --show-providedby    Show packages providing dependencies
  --show-requiredby    Show packages requiring provided information
  --show-upgradedby    Show packages upgrading provided information
  --show-conflictedby  Show packages conflicting with provided information
  --show-priority      Show package priority
  --show-channels      Show channels that include this package
  --show-all           Enable all --show-* options
  --format=FMT         Change output format
  --output=FILE        Redirect output to given filename

Examples:
  smart query pkgname
  smart query '*kgnam*'
  smart query pkgname-1.0
  smart query pkgname --show-requires
  smart query --requires libpkg.so --show-providedby
  smart query --installed
  smart query --summary ldap

Smart Info

This command will show information about the given packages.

Options:
  -h, --help  Show this help message and exit
  --urls      Show urls
  --paths     Show path list

Examples:
  smart info pkgname
  smart info pkgname-1.0
  smart info pkgname --urls --paths

Smart Stats

This command will show some statistics.

Examples:
  smart stats

Smart Setup Commands

Setup commands:
channel
priority
mirror
flag

Smart Channel

Usage: smart channel [options]

This command allows one to manipulate channels. Channels are
used as sources of information about installed and available
packages. Depending on the channel type, a different backend
is used to handle interactions with the operating system and
extraction of information from the given channel.

The following channel types are available:

  apt-deb    - APT-DEB Repository
  apt-rpm    - APT-RPM Repository
  deb-dir    - DEB Directory
  deb-sys    - DPKG Installed Packages
  mirrors    - Mirror Information
  red-carpet - Red Carpet Channel
  rpm-dir    - RPM Directory
  rpm-hdl    - RPM Header List
  rpm-md     - RPM MetaData
  rpm-sys    - RPM Installed Packages
  slack-site - Slackware Repository
  slack-sys  - Slackware Installed Packages
  up2date-mirrors - Mirror Information (up2date format)
  urpmi      - URPMI Repository
  yast2      - YaST2 Repository

Use --help-type <type> for more information.

Options:
  -h, --help        Show this help message and exit
  --add             Argument is an alias and one or more key=value pairs
                        defining a channel, or a filename/url pointing to a channel
                        description in the same format used by --show, or a
                        directory path where autodetection will be tried
  --set             Argument is an alias, and one or more key=value pairs
                        modifying a channel
  --remove          Arguments are channel aliases to be removed
  --remove-all      Remove all existent channels
  --show            Show channels with given aliases, or all channels if no
                        arguments were given
  --edit            Edit channels in editor set by $editor
  --enable          Enable channels with given aliases
  --disable         Disable channels with given aliases
  -y, --yes         Execute without asking
  --help-type=TYPE  Show further information about given type

Examples:
  smart channel --help-type apt-rpm
  smart channel --add mydb type=rpm-sys name="RPM Database"
  smart channel --add mychannel type=apt-rpm name="Some repository" \
                        baseurl=http://somewhere.com/pub/repos components=extra
  smart channel --set mychannel priority=-100
  smart channel --disable mychannel
  smart channel --remove mychannel
  smart channel --show
  smart channel --show mychannel > mychannel.txt
  smart channel --add ./mychannel.txt
  smart channel --add http://some.url/mychannel.txt
  smart channel --add /mnt/cdrom

Smart Priority

Usage: smart priority [options]

This command allows changing the priority of given packages.
Packages with higher priorities are considered a better option
even when package versions state otherwise. Using priorities
one may avoid unwanted upgrades, force downgrades, select
packages in given channels as preferential, and other kinds
of interesting setups. When a package has no explicit priority,
the channel priority is used. The channel priority may be
changed using the 'channel' command, and defaults to 0 when
not set.

Notice that negatives priorities must be preceded by '--' in
the command line, otherwise they'll be interpreted as command
line options.

Options:
  -h, --help  Show this help message and exit
  --set       Set priority
  --remove    Unset priority
  --show      Show priorities
  --force     Ignore problems

Examples:
  smart priority --set pkgname 100
  smart priority --set pkgname mychannel -- -200
  smart priority --remove pkgname
  smart priority --remove pkgname mychannel
  smart priority --show
  smart priority --show pkgname

Smart Mirror

Usage: smart mirror [options]

This command allows one to manipulate mirrors. Mirrors are URLs
that supposedly provide the same contents as are available in
other URLs, also called origins in this help text. There is no internal
restriction on the kind of information which is mirrored. Once
an origin URL is provided, and one or more mirror URLs are
provided, these mirrors will be considered for any file which
is going to be fetched from an URL starting with the origin URL.
Whether the mirror will be chosen or not will depend on the
history of downloads from this mirror and from other mirrors for
the same URL, since mirrors are automatically balanced so that
the fastest mirror and with less errors is chosen. When errors
occur, the next mirror is tried.

For instance, if a mirror "http://mirror.url/path/" is provided
for the origin "ftp://origin.url/other/path/", and a file in
"ftp://origin.url/other/path/subpath/somefile" is going to be
fetched, the mirror will be considered for being used, and the
URL "http://mirror.url/path/subpath/somefile" will be used if
the mirror is chosen. Notice that strings are compared and
replaced without any pre-processing, so that it's possible to
use URLs ending in prefixes of directory entries.

Options:
  -h, --help         Show this help message and exit
  --show             Show current mirrors
  --add              Add to the given origin url the given mirror url, provided
                         either in pairs, or in a given file/url in the format used
                         by --show
  --remove           Remove from the given origin url the given mirror url,
                         provided either in pairs, or in a given file/url in the
                         format used by --show
  --remove-all       Remove all mirrors for the given origin urls
  --sync=FILE        Synchronize mirrors from the given file/url, so that
                         origins in the given file will have exactly the specified
                         mirrors
  --edit             Edit mirrors in editor set by $editor
  --clear-history    Clear history for the given origins/mirrors, or for all
                         mirrors
  --show-penalities  Show current penalities for origins/mirrors, based on the
                         history information

Examples:
  smart mirror --show
  smart mirror --add ftp://origin.url/some/path/ http://mirror.url/path/
  smart mirror --remove ftp://origin.url/some/path/ http://mirror.url/path/
  smart mirror --add http://some.url/path/to/mirrors.txt
  smart mirror --sync http://some.url/path/to/mirrors.txt
  smart mirror --clear-history ftp://origin.url/some/path/
  smart mirror --clear-history ftp://mirror.url/path/
  smart mirror --clear-history

Smart automatically detects and uses the best mirror. Whichever mirror is better, smart will use. It also allows you to continue to download a package if one mirror fails, since smart will automatically switch over to a working mirror.

Smart Flag

Usage: smart flag [options]

This command allows one to set, remove, and show package flags.
Package flags are used to tune the behavior of some algorithms
when dealing with the given packages.

Currently known flags are:

  lock          - Flagged packages will not be removed, if they
                      are currently installed, nor installed, if they
                      are currently available.
  new           - Flagged packages were considered new packages
                      in the repository when the last update was done.
                      This flag is automatically manipulated by the
                      system.
  multi-version - Flagged packages may have more than one version
                      installed in the system at the same time
                      (backend dependent).

Options:
  -h, --help  Show this help message and exit
  --set       Set flags given in pairs of flag name/target, where targets may
                  use just the package name, or the package name, relation, and
                  version, such as: lock 'python > 1.0'
  --remove    Remove flags given in pairs of flag name/target, where targets
                  may use just the package name, or the package name, relation, and
                  version, such as: lock 'python > 1.0'
  --show      Show packages with the flags given as arguments or all flags if
                  no argument was given
  --force     Ignore problems

Examples:
  smart flag --show
  smart flag --show new
  smart flag --set lock pkgname
  smart flag --remove lock pkgname
  smart flag --set lock 'pkgname >= 1.0'
  smart flag --remove lock 'pkgname >= 1.0'

Channels are the dictories on the server of repositories that your distribution uses. There are a few ways in which to add channels. The command line way is covered in the above section [http://labix.org/smart/howto#head-b12a1485e5eae7c2fdecf36ffa6a063472b626a1 Smart Channel].

Mirrors are different sites or servers that carry the exact same information as the original site. Mirrors can be benificial for obtaining faster download speeds. Not to mention when one server goes down, you have another as a back up. By utilizing mirrors in smart, you give smart the ability to choose which server is best, and to automatically switch when one goes down or performs poorly. The more mirrors you add, the greater the chance of optimizing smart's download capacity.

smart mirror --add <source url>

Example: smart mirror --add ftp://origin.url/some/path/

smart mirror --add http://mirror.url/path/

smart mirror --add http://some.url/path/to/mirrors.txt

Proxies require authentication to access a server. To set up smart to access a proxy you must make sure pyhton-curl (pycurl) is installed. Then you must set the option in smart's configuration.

smart config --set ftp-proxy=<some url>

smart config --set http-proxy=<some url>

With smart priorities you can control the prioritization, or ranking, of a channel or package. Priorities are ranked from -200 being the highest priority to 100 being the lowest. A priority with a negative value must be preceeded by a double negative (--). You may want to set priorities to keep packages from being downgraded, or to have desired packages upgraded more readily. The same is true of channels. You may wants a particular channel to be upgraded more readily than the others.

Example 1: smart priority --set packgename 100

Example 2: smart priority --set channelname 100

Example 3: smart priority --set packgename channelname 100

To remove priorities, just use --remove instead of --set.

Flags are a way in which to fine tune smart's algorithm. Flags have three options: lock, new, and multi-version. With lock, it locks the package, so that no changes will be made to that package. With a package that is locked, it will not upgrade or remove that package. New is the system default. Multi-version is when you have more than one version installed in the system at the same time.

Example 1: smart flag --set lock packgename

Example 2: smart flag --set multi-version packagename

To remove a flag, just use --remove instead of --set.

smart/user-guide/Command Line Interface (last edited 2008-07-22 18:07:58 by 79-70-98-186)