SUSE Linux-Zypper command example

Source: Internet
Author: User

SUSE Linux-Zypper command example

Zypper is a command line interface used in SUSE Linux to install, upgrade, uninstall, manage repositories, and query various packages. This article will discuss several examples of different commands of zypper.

Syntax:

  1. # Zypper [-- global-opts] <command> [-- command-opts] [command-arguments]

The section in the brackets can be unnecessary. The simplest way to execute zypper is to input zypper and.

Example 1: List available Global Options and commands

Open the terminal, enter zypper, and press enter to display all available Global Options and commands.

  1. Linux-xa3t :~ # Zypper
Example 2: get help from a command of zypper

Syntax: zypper help [command]

  1. Linux-xa3t :~ # Zypper help remove
  2. Remove (rm) [options] <capability>...
  3.  
  4. Remove packages with specified capabilities.
  5. A capability is NAME [. ARCH] [OP <VERSION>], where OP is one of <, <=, =, >=,>.
  6.  
  7. Command options:
  8. -R, -- repo <alias | # | URI> Load only the specified repository.
  9. -T, -- type <type> Type of package (package, patch, pattern, product ).
  10.  
  11. Default: package.
  12. -N, -- name Select packages by plain name, notby capability.
  13. -C, -- capability Select packages by capability.
  14. -- Debug-solver Create solver test casefor debugging.
  15. -R, -- no-force-resolution Donot force the solver to find solution, let it ask.
  16. -- Force-resolution Force the solver to find a solution (even an aggressive one ).
  17. -U, -- clean-deps Automatically remove unneeded dependencies.
  18. -U, -- no-clean-deps No automatic removal of unneeded dependencies.
  19. -D, -- dry-run Test the removal, donot actually remove.
Example 3: Open zypper shell/session
  1. Linux-xa3t :~ # Zypper sh
  2. Zypper>

Or

  1. Linux-xa3t :~ # Zypper shell
  2. Zypper>
Example 4: List the defined Repositories
  1. Linux-xa3t :~ # Zypper repos

Or

  1. Linux-xa3t :~ # Zypper lr
4.1) List warehouse URIs in a table

4.2) List warehouses with priority
  1. Linux-xa3t :~ # Zypper lr-p

Example 5: refresh the Repository
  1. Linux-xa3t :~ # Zypper ref
  2. Repository 'opensuse-13.1-Non-Oss' is up to date.
  3. Repository 'opensuse-13.1-Oss' is up to date.
  4. Repository 'opensuse-13.1-Update' is up to date.
  5. Repository 'opensuse-13.1-Update-Non-Oss' is up to date.
  6. All repositories have been refreshed.
Example 6: Modify the zypper Repository

The zypper repository can be modified using aliases, numbers, or Uris, or '-all,-remote,-local, and-medium-type.

Linux-xa3t :~ # Zypper mr-d 6 # disable warehouse linux-xa3t No. 6 :~ # Zypper mr-rk-p 70 upd # Enable Automatic correspondence and set rpm file 'cache' for the 'upd' warehouse, and set it to priority 70 linux-xa3t :~ # Zypper mr-Ka # disable rpm File Cache linux-xa3t for all repositories :~ # Zypper mr-kt # Set the rpm file cache for the remote Repository

Example 7: Add a repository

Syntax: zypper addrepo or zypper ar <repository URL or alias>

  1. Linux-xa3t :~ # Zypper ar http://download.opensuse.org/update/13.1/ update
  2. Adding repository 'update '................................... .......... [done]
  3. Repository 'update' successfully added
  4. Enabled: Yes
  5. Autorefresh: No
  6. GPG check: Yes
  7. URI: http://download.opensuse.org/update/13.1/
Example 8: Remove a repository

Syntax: zypper removerepo <repository Name> <alias>

Or

Zypper rr <repository Name> <alias>

  1. Linux-xa3t :~ # Zypper rr openSUSE-13.1-1.10 openSUSE-13.1-1.10
  2. Removing repository 'opensuse-13.1-1.10 '...... [done]
  3. Repository 'opensuse-13.1-1.10 'has been removed.

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.