SUSE Linux–zypper Command Example

Source: Internet
Author: User

Source: http://www.linuxidc.com/Linux/2014-11/109214.htm

Zypper is the command line interface used by SUSE Linux to install, upgrade, uninstall, manage warehouses, and perform various package queries. This article will discuss several examples of different commands in Zypper.

Grammar:

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

The parts in brackets are not required. The simplest way to execute zypper is to enter Zypper and.

Example 1: List the available global options and commands

Open terminal, enter zypper and press ENTER, it will show all available global options and commands.

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

Syntax: zypper help [command]

  1. Linux-xa3t: ~# zypper help remove
  2. Remove (rm)[options]<capability> ...
  3. Remove Packages with specified capabilities.
  4. A capability is NAME[. ARCH] [op<VERSION;],where OP is one of <,<=,=, >=, a.
  5. Command options:
  6. -r,--<alias|#|>load only the specified repository
  7. -T,--type <type>type of package , patch, Pattern, product).
  8. Default:package.
  9. -N,--name Select packages by plain name, not by capability.
  10. -C,--capability Select Packages by capability.
  11. --Debug-Solver Create Solver test Case for debugging.
  12. -R,--No-Force-resolution don't force the solver to find Solution,let it ask.
  13. --Force-resolution force the Solver to Find a solution (even an aggressive one).
  14. -u,--clean-deps automatically remove unneeded dependencies.
  15. -U,--no-clean-deps no automatic removal of unneeded dependencies.
  16. -D,--dry-run Test the removal, do not 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 warehouses
    1. Linux-xa3t: ~# zypper repos

Or

    1. Linux-xa3t: ~# zypper lr
4.1) List the URI of the warehouse in tabular form

4.2) List warehouses in priority order
    1. Linux-xa3t: ~# zypper lr-p

Example 5: Refreshing the Warehouse
  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 has been refreshed.
Example 6: Modifying the Zypper Warehouse

Zypper warehouses can be modified by aliases, numbers, or URIs, or through the options ' –all, –remote, –local, –medium-type '.

linux-xa3t:~ # zypper mr-d 6 #禁用6号仓库 linux-xa3t:~ # zypper mr-rk-p the upd #启用自动书信并为 ' upd ' warehouse set rpm file ' cache ' and set it to the priority of Linux -xa3t:~ # zypper Mr-ka #为所有的仓库禁用rpm文件缓存 linux-xa3t:~ # zypper Mr-kt #为远程仓库设置rpm文件缓存

Example 7: Adding a warehouse

Syntax: URL or alias for zypper Addrepo or Zypper ar < warehouse >

  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: Removing a warehouse

Syntax: Zypper Removerepo < warehouse name > < aliases >

Or

Zypper RR < warehouse 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 read on to the next page. Highlights : http://www.linuxidc.com/Linux/2014-11/109214p2.htm

SUSE Linux–zypper Command Example

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.