How to use zypper in bash scripts for someone coming from apt-get?
I have a few questions about moving from apt-get to zypper in bash scripts.
What is the equivalent of this?
sudo apt-get install curl --assume-yes
(where curl could be any package)
I found the Zypper Cheat Sheet - openSUSE. Very nice! But I would appreciate the voice of experience here -- what's the right way to use zypper in a script where I want to auto agree to all prompts and not skip things that need a response?
With my inexperience I would be tempted to use:
sudo zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses curl
But is that really the equivalent of --assume-yes
?
What about the equivalent for these?
sudo apt-get autoremove -y
sudo apt-get autoclean -y
This suggests there isn't one...
Is there a replacement for gdebi-core? Or is gdebi not ever needed with zypper's "powerful satisfiability solver"? I use gdebi for situations where I need to install a package on an older version and I have a .deb file already (but not all the dependencies).
bash package-management apt opensuse zypper
add a comment |
I have a few questions about moving from apt-get to zypper in bash scripts.
What is the equivalent of this?
sudo apt-get install curl --assume-yes
(where curl could be any package)
I found the Zypper Cheat Sheet - openSUSE. Very nice! But I would appreciate the voice of experience here -- what's the right way to use zypper in a script where I want to auto agree to all prompts and not skip things that need a response?
With my inexperience I would be tempted to use:
sudo zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses curl
But is that really the equivalent of --assume-yes
?
What about the equivalent for these?
sudo apt-get autoremove -y
sudo apt-get autoclean -y
This suggests there isn't one...
Is there a replacement for gdebi-core? Or is gdebi not ever needed with zypper's "powerful satisfiability solver"? I use gdebi for situations where I need to install a package on an older version and I have a .deb file already (but not all the dependencies).
bash package-management apt opensuse zypper
add a comment |
I have a few questions about moving from apt-get to zypper in bash scripts.
What is the equivalent of this?
sudo apt-get install curl --assume-yes
(where curl could be any package)
I found the Zypper Cheat Sheet - openSUSE. Very nice! But I would appreciate the voice of experience here -- what's the right way to use zypper in a script where I want to auto agree to all prompts and not skip things that need a response?
With my inexperience I would be tempted to use:
sudo zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses curl
But is that really the equivalent of --assume-yes
?
What about the equivalent for these?
sudo apt-get autoremove -y
sudo apt-get autoclean -y
This suggests there isn't one...
Is there a replacement for gdebi-core? Or is gdebi not ever needed with zypper's "powerful satisfiability solver"? I use gdebi for situations where I need to install a package on an older version and I have a .deb file already (but not all the dependencies).
bash package-management apt opensuse zypper
I have a few questions about moving from apt-get to zypper in bash scripts.
What is the equivalent of this?
sudo apt-get install curl --assume-yes
(where curl could be any package)
I found the Zypper Cheat Sheet - openSUSE. Very nice! But I would appreciate the voice of experience here -- what's the right way to use zypper in a script where I want to auto agree to all prompts and not skip things that need a response?
With my inexperience I would be tempted to use:
sudo zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses curl
But is that really the equivalent of --assume-yes
?
What about the equivalent for these?
sudo apt-get autoremove -y
sudo apt-get autoclean -y
This suggests there isn't one...
Is there a replacement for gdebi-core? Or is gdebi not ever needed with zypper's "powerful satisfiability solver"? I use gdebi for situations where I need to install a package on an older version and I have a .deb file already (but not all the dependencies).
bash package-management apt opensuse zypper
bash package-management apt opensuse zypper
edited Jul 6 '13 at 23:16
MountainX
asked Jul 6 '13 at 19:05
MountainXMountainX
5,1412675133
5,1412675133
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
zypper
is not very consistent with naming flags for subcommands. For install
you should use --non-interactive
mode, in shortcut -n
:
zypper -n install curl
That might be quite confusing for someone coming from apt-get install -y curl
. Although zypper's legacy option is -y/--no-confirm
(sometimes the only option that actually works).
According to documentation there's no way how to accept a GPG key without interactive mode:
a new key can be trusted or imported in the interactive mode only
Even with --no-gpgp-checks
the GPG key will be rejected.
A workaround for scripts is to use pipe and echo
:
zypper addrepo http://repo.example.org my_name | echo 'a'
add a comment |
You have the --non-interactive option. From the man page:
Switches to non-interactive mode.
In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
The behaviour of this option is somewhat different than that of options like '--yes', since zypper can answer different answers to different questions.
The answers also depend on other options like '--no-gpg-checks'.
There is no real correspondense to apt-get's autoremove. The closest is the --clean-deps
option of the remove
command, which cleans dependencies right away (but not afterwards).
is it possible to add such an option inzypper.conf
for permanent confirmation as in other package managers?
– w17t
Oct 23 '17 at 16:40
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
add a comment |
That is a sample
zypper --non-interactive --quiet addrepo --refresh -p 90 http://packman.inode.at/suse/openSUSE_Leap_15.0/ 'packman'
zypper --gpg-auto-import-keys refresh
zypper --non-interactive dist-upgrade --allow-vendor-change --from packman
zypper --non-interactive install vlc vlc-codecs
Of course you can include more options like --auto-agree-with-licenses
but remember that makes difference if its before or after install
add a comment |
This worked for me (checked on SLES12SP3):
zypper --non-interactive --quiet ar -C http://myrepo myrepo
zypper --gpg-auto-import-keys ref
Note -C/--no-check
for zypper ar
.
Now you can install packages:
zypper in -y --auto-agree-with-licenses vim
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f82016%2fhow-to-use-zypper-in-bash-scripts-for-someone-coming-from-apt-get%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
zypper
is not very consistent with naming flags for subcommands. For install
you should use --non-interactive
mode, in shortcut -n
:
zypper -n install curl
That might be quite confusing for someone coming from apt-get install -y curl
. Although zypper's legacy option is -y/--no-confirm
(sometimes the only option that actually works).
According to documentation there's no way how to accept a GPG key without interactive mode:
a new key can be trusted or imported in the interactive mode only
Even with --no-gpgp-checks
the GPG key will be rejected.
A workaround for scripts is to use pipe and echo
:
zypper addrepo http://repo.example.org my_name | echo 'a'
add a comment |
zypper
is not very consistent with naming flags for subcommands. For install
you should use --non-interactive
mode, in shortcut -n
:
zypper -n install curl
That might be quite confusing for someone coming from apt-get install -y curl
. Although zypper's legacy option is -y/--no-confirm
(sometimes the only option that actually works).
According to documentation there's no way how to accept a GPG key without interactive mode:
a new key can be trusted or imported in the interactive mode only
Even with --no-gpgp-checks
the GPG key will be rejected.
A workaround for scripts is to use pipe and echo
:
zypper addrepo http://repo.example.org my_name | echo 'a'
add a comment |
zypper
is not very consistent with naming flags for subcommands. For install
you should use --non-interactive
mode, in shortcut -n
:
zypper -n install curl
That might be quite confusing for someone coming from apt-get install -y curl
. Although zypper's legacy option is -y/--no-confirm
(sometimes the only option that actually works).
According to documentation there's no way how to accept a GPG key without interactive mode:
a new key can be trusted or imported in the interactive mode only
Even with --no-gpgp-checks
the GPG key will be rejected.
A workaround for scripts is to use pipe and echo
:
zypper addrepo http://repo.example.org my_name | echo 'a'
zypper
is not very consistent with naming flags for subcommands. For install
you should use --non-interactive
mode, in shortcut -n
:
zypper -n install curl
That might be quite confusing for someone coming from apt-get install -y curl
. Although zypper's legacy option is -y/--no-confirm
(sometimes the only option that actually works).
According to documentation there's no way how to accept a GPG key without interactive mode:
a new key can be trusted or imported in the interactive mode only
Even with --no-gpgp-checks
the GPG key will be rejected.
A workaround for scripts is to use pipe and echo
:
zypper addrepo http://repo.example.org my_name | echo 'a'
edited Feb 14 '17 at 19:39
Brock
31
31
answered Jan 18 '17 at 12:51
TombartTombart
90021626
90021626
add a comment |
add a comment |
You have the --non-interactive option. From the man page:
Switches to non-interactive mode.
In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
The behaviour of this option is somewhat different than that of options like '--yes', since zypper can answer different answers to different questions.
The answers also depend on other options like '--no-gpg-checks'.
There is no real correspondense to apt-get's autoremove. The closest is the --clean-deps
option of the remove
command, which cleans dependencies right away (but not afterwards).
is it possible to add such an option inzypper.conf
for permanent confirmation as in other package managers?
– w17t
Oct 23 '17 at 16:40
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
add a comment |
You have the --non-interactive option. From the man page:
Switches to non-interactive mode.
In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
The behaviour of this option is somewhat different than that of options like '--yes', since zypper can answer different answers to different questions.
The answers also depend on other options like '--no-gpg-checks'.
There is no real correspondense to apt-get's autoremove. The closest is the --clean-deps
option of the remove
command, which cleans dependencies right away (but not afterwards).
is it possible to add such an option inzypper.conf
for permanent confirmation as in other package managers?
– w17t
Oct 23 '17 at 16:40
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
add a comment |
You have the --non-interactive option. From the man page:
Switches to non-interactive mode.
In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
The behaviour of this option is somewhat different than that of options like '--yes', since zypper can answer different answers to different questions.
The answers also depend on other options like '--no-gpg-checks'.
There is no real correspondense to apt-get's autoremove. The closest is the --clean-deps
option of the remove
command, which cleans dependencies right away (but not afterwards).
You have the --non-interactive option. From the man page:
Switches to non-interactive mode.
In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
The behaviour of this option is somewhat different than that of options like '--yes', since zypper can answer different answers to different questions.
The answers also depend on other options like '--no-gpg-checks'.
There is no real correspondense to apt-get's autoremove. The closest is the --clean-deps
option of the remove
command, which cleans dependencies right away (but not afterwards).
edited Apr 21 '15 at 7:11
answered Jul 9 '13 at 13:59
matmat
21818
21818
is it possible to add such an option inzypper.conf
for permanent confirmation as in other package managers?
– w17t
Oct 23 '17 at 16:40
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
add a comment |
is it possible to add such an option inzypper.conf
for permanent confirmation as in other package managers?
– w17t
Oct 23 '17 at 16:40
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
is it possible to add such an option in
zypper.conf
for permanent confirmation as in other package managers?– w17t
Oct 23 '17 at 16:40
is it possible to add such an option in
zypper.conf
for permanent confirmation as in other package managers?– w17t
Oct 23 '17 at 16:40
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
I don't know. I haven't used suse in a while, so I can't check it.
– mat
Oct 26 '17 at 20:57
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
it seems its impossible for zypper unlike pacman, apt, and yum/dnf :-(
– w17t
Oct 27 '17 at 15:43
add a comment |
That is a sample
zypper --non-interactive --quiet addrepo --refresh -p 90 http://packman.inode.at/suse/openSUSE_Leap_15.0/ 'packman'
zypper --gpg-auto-import-keys refresh
zypper --non-interactive dist-upgrade --allow-vendor-change --from packman
zypper --non-interactive install vlc vlc-codecs
Of course you can include more options like --auto-agree-with-licenses
but remember that makes difference if its before or after install
add a comment |
That is a sample
zypper --non-interactive --quiet addrepo --refresh -p 90 http://packman.inode.at/suse/openSUSE_Leap_15.0/ 'packman'
zypper --gpg-auto-import-keys refresh
zypper --non-interactive dist-upgrade --allow-vendor-change --from packman
zypper --non-interactive install vlc vlc-codecs
Of course you can include more options like --auto-agree-with-licenses
but remember that makes difference if its before or after install
add a comment |
That is a sample
zypper --non-interactive --quiet addrepo --refresh -p 90 http://packman.inode.at/suse/openSUSE_Leap_15.0/ 'packman'
zypper --gpg-auto-import-keys refresh
zypper --non-interactive dist-upgrade --allow-vendor-change --from packman
zypper --non-interactive install vlc vlc-codecs
Of course you can include more options like --auto-agree-with-licenses
but remember that makes difference if its before or after install
That is a sample
zypper --non-interactive --quiet addrepo --refresh -p 90 http://packman.inode.at/suse/openSUSE_Leap_15.0/ 'packman'
zypper --gpg-auto-import-keys refresh
zypper --non-interactive dist-upgrade --allow-vendor-change --from packman
zypper --non-interactive install vlc vlc-codecs
Of course you can include more options like --auto-agree-with-licenses
but remember that makes difference if its before or after install
answered Apr 16 '18 at 23:42
Marcelo AtieMarcelo Atie
111
111
add a comment |
add a comment |
This worked for me (checked on SLES12SP3):
zypper --non-interactive --quiet ar -C http://myrepo myrepo
zypper --gpg-auto-import-keys ref
Note -C/--no-check
for zypper ar
.
Now you can install packages:
zypper in -y --auto-agree-with-licenses vim
New contributor
add a comment |
This worked for me (checked on SLES12SP3):
zypper --non-interactive --quiet ar -C http://myrepo myrepo
zypper --gpg-auto-import-keys ref
Note -C/--no-check
for zypper ar
.
Now you can install packages:
zypper in -y --auto-agree-with-licenses vim
New contributor
add a comment |
This worked for me (checked on SLES12SP3):
zypper --non-interactive --quiet ar -C http://myrepo myrepo
zypper --gpg-auto-import-keys ref
Note -C/--no-check
for zypper ar
.
Now you can install packages:
zypper in -y --auto-agree-with-licenses vim
New contributor
This worked for me (checked on SLES12SP3):
zypper --non-interactive --quiet ar -C http://myrepo myrepo
zypper --gpg-auto-import-keys ref
Note -C/--no-check
for zypper ar
.
Now you can install packages:
zypper in -y --auto-agree-with-licenses vim
New contributor
New contributor
answered 17 mins ago
amaslennamaslenn
1012
1012
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f82016%2fhow-to-use-zypper-in-bash-scripts-for-someone-coming-from-apt-get%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown