Results 1 to 4 of 4

Thread: 使用zypper时,如何才能自动选 yes

  1. #1

    Default 使用zypper时,如何才能自动选 yes

    像 yum,会有个 yum -y 参数设置,可以自动选yes,而不需要人工输入
    想把zypper install xxxxx 写入 .sh脚本中,但是运行时会有 “Continue? [y/n/...? shows all options] (y):”,这时还是需要人工输入;
    zypper 有没有什么参数设置,可以设置后,这个地方默认取参数而不需要人工输入??

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,299
    Blog Entries
    15

    Default Re: 使用zypper时,如何才能自动选 yes

    Hi
    The command would be;
    Code:
    zypper in -y or --no-confirm xxxxx
    zypper in --help for more options
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default 回复: Re: 使用zypper时,如何才能自动选 yes

    Quote Originally Posted by malcolmlewis View Post
    Hi
    The command would be;
    Code:
    zypper in -y or --no-confirm xxxxx
    zypper in --help for more options
    thx,十分感谢,我之前把 -y放在的install 前,不好使,原来是放在后面,再次感谢

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,806
    Blog Entries
    1

    Default Re: 使用zypper时,如何才能自动选 yes

    Useful zypper commands for BASH scripting

    https://en.opensuse.org/User:Tsu2/BASH_zypper

    You'll find various install scripts sprinkled through a number of articles in my wiki

    https://en.opensuse.org/User:Tsu2

    You'll also see an example of what you're asking about in a script I wrote recently
    If for instance you're only interested in the early part of this script, strip out anything you don't want and insert what you want your script to do.
    This script does the following automatically without any User interaction
    • Detect whether your openSUSE is LEAP or Tumbleweed (or something else)
    • Add repos, appropriately named for the openSUSE version
    • Auto agree to accept the repo gpg keys
    • Install packagesi


    https://github.com/putztzu/lc0/blob/...penSUSE_lc0.sh

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •