Zypper is a command line package manager introduced since openSUSE 10.2, developed on the openSUSE 10.3 and become one of the main install or update applications on openSUSE 11.0 and the next versions.
Zypper its same thing as apt-get command which is found on the Debian Linux distribution (Ubuntu, Mint, etc.)
General Commands
The following command is the general carried out in the Zypper :
zypper # To display a list of commands and options
zypper help search # To display help for the search
zypper lu # To display the update patch is needed
zypper up # To update software
zypper se SQLite # To find a software package SQLite
zypper rm sqlite2 # To remove the software package SQLite
zypper in sqlite3 # To install a software package SQLite
zypper in yast * # To install all packages that begin with the name 'yast'
zypper up-t package # To upgrade all packages with the latest version
General Use
Main syntax zypper:
zypper [global options] command [command options] [arguments] ...
Commands in square brackets is not absolute and is optional, may not be used, so simple use of zypper is type zypper followed by the desired command, for example:
$ zypper update
Example of use with some options:
$ zypper update - auto-agree-with-licenses
The command above is used to update without having to answer the yes and no license for confirmation.
Category Command Zypper
Zypper provides various commands that can be grouped into several groups as the following:
Management repository, to make handling of repository, such as: refresh, repos, addrepo, removerepo, modifyrepo, namerepo
Package Management, to make the package handling applications such as install, update and delete. Command: install, remove, update, dist-upgrade, source-install
Query Package, to search, such as: search, info, what-provides, list-updates, patch-check, patches, packages, patterns, products
Locking, to locked applications, such as: locks, addlock, removelock
Utility, additional commands such as: verify, new-install-recommends, help
Repository Management
To show list repositories, type :
$ zypper lr
# | Alias | Name | Enabled | Refresh
--+----------------------------+-------------------------------+----------+------------
1 | repo-oss | openSUSE-11.0-Oss | Yes | No
2 | repo-debug | openSUSE-11.0-Debug | Yes | No
3 | repo-non-oss | openSUSE-11.0-Non-Oss | Yes | No
4 | openSUSE-DVD 11.0 | openSUSE-DVD 11.0 | Yes | No
Other examples :
zypper lr-u # Showing repository URL
zypper lr-d # Showing some properties repository
zypper lr-P # Showing repository priority
zypper lr-e opensuse # To export all the definitions into the repository with the file name 'opensuse.repo'
Adding Repositories
Before any packages can be installed at least one repository must be defined. To add a repository, use the addrepo or ar command:
$zypper addrepo --name "openSUSE-11.0 OSS" http://download.opensuse.org/distribution/11.0/repo/oss/ repo-oss
$zypper addrepo --name "openSUSE-11.0 Non-OSS" http://download.opensuse.org/distribution/11.0/repo/non-oss/ repo-non-oss
$zypper addrepo --name "openSUSE-11.0 Updates" http://download.opensuse.org/update/11.0/ repo-update
after adding repositories, it needs to be refreshed. type command below :
$ zypper ref
.................
.................
All repositories have been refreshed.
if autorefresh is enabled, you dont need to refresh it manually. to find out autorefresh enabled or not, type zypper lr.
Update systems to the latest packages
$zypper update
Removing repositories
zypper removerepo [alias repo]
$ zypper removerepo repo-non-oss
Removing repository 'repo-non-oss' [done]
Repository 'repo-non-oss' has been removed.
Installing packages
install packages can easily by type the package name
$ zypper in gtk
Reading installed packages...
The following NEW packages are going to be installed:
gtk glib
Overall download size: 826.0 K. After the operation, additional 2.4 M will be used.
Continue? [YES/no]: yes
Downloading package glib-1.2.10-710.1.i586 (1/2), 115.0 K (333.0 K unpacked)
Installing: glib-1.2.10-710.1 [done]
Downloading package gtk-1.2.10-1049.1.i586 (2/2), 711.0 K (2.1 M unpacked)
Installing: gtk-1.2.10-1049.1 [done]
Other examples :
zypper in yast* # install all yast modules
zypper in -t pattern lamp_server # install lamp_server pattern (packages needed for a LAMP server)
zypper in vim -emacs # install vim and remove emacs in one go
zypper in amarok packman:libxine1 # install libxine1 from packman and amarok from any repo
zypper in bitchx-1.1-81.x86_64.rpm # install bitchx rpm from local directory
zypper in -f subversion # force reinstallation of subversion
Removing packages
remove command is same thing like install command, but has different effect :).
$ zypper remove gtk
Reading installed packages...
The following package is going to be REMOVED:
gtk
After the operation, 2.1 M will be freed.
Continue? [YES/no]: y
Removing gtk-1.2.10-1049.1 [done]
Searching packages
the search command looks for packages of any type, status, etc
$ zypper se git
Reading installed packages...
S | Name | Summary | Type
--+---------------------+--------------------------------------------------------------+--------
| cogito | User-friendly command line frontend for Git | package
i | git | Fast, scalable, distributed revision control system | package
i | git-arch | git-arch - Git tools for importing Arch repositories | package
i | git-core | Core git tools | package
i | git-cvs | Git tools for importing CVS repositories | package
| git-debuginfo | Debug information for package git | package
| git-debugsource | Debug sources for package git | package
i | git-email | Git tools for sending email | package
i | git-svn | Git tools for importing Subversion repositories | package
i | gitk | Git revision tree visualiser | package
| qgit | Graphical Git Repository Viewer | package
| qgit-debuginfo | Debug information for package qgit | package
| qgit-debugsource | Debug sources for package qgit | package
| stgit | Stacked GIT - Source Code Management Tool | package
S (states) letter on first column, provide information about states packages. if there is ( i ) letter it means the packages installed on your machine.
source:http://www.wowtutorial.org/tutorial/230.html
0 comments:
Post a Comment