How to install a package with apt without the “Do you want to continue [Y/n]?” prompt?
Of course when you type:
sudo apt-get install whatever
It asks you:
Do you want to continue [Y/n]?
Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.
apt software-installation
add a comment |
Of course when you type:
sudo apt-get install whatever
It asks you:
Do you want to continue [Y/n]?
Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.
apt software-installation
superuser question superuser.com/questions/164553/…
– αғsнιη
Sep 15 '14 at 12:27
add a comment |
Of course when you type:
sudo apt-get install whatever
It asks you:
Do you want to continue [Y/n]?
Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.
apt software-installation
Of course when you type:
sudo apt-get install whatever
It asks you:
Do you want to continue [Y/n]?
Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.
apt software-installation
apt software-installation
edited Sep 22 '14 at 16:05
Braiam
51.6k20136220
51.6k20136220
asked Sep 14 '14 at 16:35
LukeLuke
4751720
4751720
superuser question superuser.com/questions/164553/…
– αғsнιη
Sep 15 '14 at 12:27
add a comment |
superuser question superuser.com/questions/164553/…
– αғsнιη
Sep 15 '14 at 12:27
superuser question superuser.com/questions/164553/…
– αғsнιη
Sep 15 '14 at 12:27
superuser question superuser.com/questions/164553/…
– αғsнιη
Sep 15 '14 at 12:27
add a comment |
4 Answers
4
active
oldest
votes
sudo apt-get install -y whatever
From the man page (man apt-get
):
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
8
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
1
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
4
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
add a comment |
For apt-get, -y
or --assume-yes
work well (as @rinzwind explained) and I assume that's the best answer here. For many such interactive administrative operations, there is a similar command.
Another pretty generic way to do this is something like :
$ echo "y" | sudo apt-get install edamame_biscuit
(Where edamame-biscuit is the (made-up) package you want to install, and "y" is assumed to be a legitimate response ; substitute with "yes" or other text as needed.)
A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt. If there are some more potentially unwanted prompts you might not want to say yes to, you avoid the situation of having the system roll along without asking.
12
Also,yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.
– Kroltan
Sep 14 '14 at 19:59
13
@Kroltan Theyes
command (by default) just outputs the lettery
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the wordyes
, you have to use the commandyes yes
.
– Jonathan Callen
Sep 14 '14 at 20:03
2
yes
, pardon my mistake
– Kroltan
Sep 14 '14 at 21:22
4
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
2
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
|
show 3 more comments
First of all, lets understand why the message appears. In fact, if the package do not have dependencies that you have not installed already or that you explicitly told it to install, apt never asks you:
➜ ~ sudo apt-get -qq install xfce4-screenshooter
Selecting previously unselected package xfce4-screenshooter.
(Reading database ... 296146 files and directories currently installed.)
Preparing to unpack .../xfce4-screenshooter_1.8.1-2_amd64.deb ...
Unpacking xfce4-screenshooter (1.8.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.56) ...
Setting up xfce4-screenshooter (1.8.1-2) ...
While if you want to install a package that depends on packages you didn't mention it would ask:
➜ ~ sudo apt-get -q install avis
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libjzlib-java libmina-java libslf4j-java
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Need to get 720 kB of archives.
After this operation, 1,258 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Which even so, wouldn't ask if you also implicitly says that you want to install those package:
➜ ~ apt-get -q install avis libjzlib-java libmina-java libslf4j-java
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Inst libjzlib-java (1.1.3-1 Debian:testing [all])
Inst libslf4j-java (1.7.7-1 Debian:testing [all])
Inst libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Inst avis (1.2.2-2 Debian:testing [all])
Conf libjzlib-java (1.1.3-1 Debian:testing [all])
Conf libslf4j-java (1.7.7-1 Debian:testing [all])
Conf libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Conf avis (1.2.2-2 Debian:testing [all])
But, then, how to make it that it doesn't ask you definitively? Through Rizwind answer should cover ad-hoc and scripting solutions (in fact, that option is more used in scripts) you could instead modify your apt.conf
file and add:
APT::Get::Assume-Yes
Something like this should be enough:
echo 'APT::Get::Assume-Yes;' | sudo tee -a /etc/apt/apt.conf.d/00Do-not-ask
Note, this won't allow other more egregious prompts that you should verify, like:
➜ ~ sudo apt-get install sonar
WARNING: The following packages cannot be authenticated!
sonar
Install these packages without verification? [y/N]
Which is why I wouldn't recommend the use of yes | ...
, since this warning would be ignored.
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (python:3.6-slim
). Should I ask a separate question for that?
– Martin Thoma
Nov 5 '18 at 11:26
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
add a comment |
Add -y
to any library install
Eg : sudo apt-get install -y nodejs
Eg : sudo apt-get install -y postgres
Eg : sudo apt-get install -y mongodb
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f523962%2fhow-to-install-a-package-with-apt-without-the-do-you-want-to-continue-y-n-p%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
sudo apt-get install -y whatever
From the man page (man apt-get
):
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
8
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
1
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
4
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
add a comment |
sudo apt-get install -y whatever
From the man page (man apt-get
):
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
8
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
1
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
4
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
add a comment |
sudo apt-get install -y whatever
From the man page (man apt-get
):
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
sudo apt-get install -y whatever
From the man page (man apt-get
):
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
edited Sep 16 '14 at 13:10
Pandya
19.9k2794157
19.9k2794157
answered Sep 14 '14 at 16:37
RinzwindRinzwind
205k28390526
205k28390526
8
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
1
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
4
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
add a comment |
8
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
1
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
4
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
8
8
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
(how to live dangerously file)
– user2413
Sep 14 '14 at 20:00
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
Thank you very much! I really should use that man page more often. :)
– Luke
Sep 15 '14 at 19:52
1
1
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
That is why they are there @KingShimkus ;)
– Rinzwind
Sep 15 '14 at 19:52
4
4
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
sudo apt-get install -yeah whatever...
– BoJack Horseman
Sep 16 '14 at 9:14
add a comment |
For apt-get, -y
or --assume-yes
work well (as @rinzwind explained) and I assume that's the best answer here. For many such interactive administrative operations, there is a similar command.
Another pretty generic way to do this is something like :
$ echo "y" | sudo apt-get install edamame_biscuit
(Where edamame-biscuit is the (made-up) package you want to install, and "y" is assumed to be a legitimate response ; substitute with "yes" or other text as needed.)
A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt. If there are some more potentially unwanted prompts you might not want to say yes to, you avoid the situation of having the system roll along without asking.
12
Also,yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.
– Kroltan
Sep 14 '14 at 19:59
13
@Kroltan Theyes
command (by default) just outputs the lettery
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the wordyes
, you have to use the commandyes yes
.
– Jonathan Callen
Sep 14 '14 at 20:03
2
yes
, pardon my mistake
– Kroltan
Sep 14 '14 at 21:22
4
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
2
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
|
show 3 more comments
For apt-get, -y
or --assume-yes
work well (as @rinzwind explained) and I assume that's the best answer here. For many such interactive administrative operations, there is a similar command.
Another pretty generic way to do this is something like :
$ echo "y" | sudo apt-get install edamame_biscuit
(Where edamame-biscuit is the (made-up) package you want to install, and "y" is assumed to be a legitimate response ; substitute with "yes" or other text as needed.)
A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt. If there are some more potentially unwanted prompts you might not want to say yes to, you avoid the situation of having the system roll along without asking.
12
Also,yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.
– Kroltan
Sep 14 '14 at 19:59
13
@Kroltan Theyes
command (by default) just outputs the lettery
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the wordyes
, you have to use the commandyes yes
.
– Jonathan Callen
Sep 14 '14 at 20:03
2
yes
, pardon my mistake
– Kroltan
Sep 14 '14 at 21:22
4
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
2
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
|
show 3 more comments
For apt-get, -y
or --assume-yes
work well (as @rinzwind explained) and I assume that's the best answer here. For many such interactive administrative operations, there is a similar command.
Another pretty generic way to do this is something like :
$ echo "y" | sudo apt-get install edamame_biscuit
(Where edamame-biscuit is the (made-up) package you want to install, and "y" is assumed to be a legitimate response ; substitute with "yes" or other text as needed.)
A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt. If there are some more potentially unwanted prompts you might not want to say yes to, you avoid the situation of having the system roll along without asking.
For apt-get, -y
or --assume-yes
work well (as @rinzwind explained) and I assume that's the best answer here. For many such interactive administrative operations, there is a similar command.
Another pretty generic way to do this is something like :
$ echo "y" | sudo apt-get install edamame_biscuit
(Where edamame-biscuit is the (made-up) package you want to install, and "y" is assumed to be a legitimate response ; substitute with "yes" or other text as needed.)
A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt. If there are some more potentially unwanted prompts you might not want to say yes to, you avoid the situation of having the system roll along without asking.
edited Sep 15 '14 at 21:15
answered Sep 14 '14 at 19:26
belacquabelacqua
15.7k1473103
15.7k1473103
12
Also,yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.
– Kroltan
Sep 14 '14 at 19:59
13
@Kroltan Theyes
command (by default) just outputs the lettery
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the wordyes
, you have to use the commandyes yes
.
– Jonathan Callen
Sep 14 '14 at 20:03
2
yes
, pardon my mistake
– Kroltan
Sep 14 '14 at 21:22
4
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
2
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
|
show 3 more comments
12
Also,yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.
– Kroltan
Sep 14 '14 at 19:59
13
@Kroltan Theyes
command (by default) just outputs the lettery
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the wordyes
, you have to use the commandyes yes
.
– Jonathan Callen
Sep 14 '14 at 20:03
2
yes
, pardon my mistake
– Kroltan
Sep 14 '14 at 21:22
4
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
2
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
12
12
Also,
yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.– Kroltan
Sep 14 '14 at 19:59
Also,
yes | sudo apt-get install edamame-biscuit
. Yes is a command that spams the word "yes" to its output. You can also make it output any other text as needed, see manpage.– Kroltan
Sep 14 '14 at 19:59
13
13
@Kroltan The
yes
command (by default) just outputs the letter y
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the word yes
, you have to use the command yes yes
.– Jonathan Callen
Sep 14 '14 at 20:03
@Kroltan The
yes
command (by default) just outputs the letter y
followed by a newline as many times as is needed to fill the pipe buffer. To actually print the word yes
, you have to use the command yes yes
.– Jonathan Callen
Sep 14 '14 at 20:03
2
2
yes
, pardon my mistake– Kroltan
Sep 14 '14 at 21:22
yes
, pardon my mistake– Kroltan
Sep 14 '14 at 21:22
4
4
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
@Braiam I think that was the point, so it doesn't do anything if someone just pastes this in his/her shell.
– Kroltan
Sep 15 '14 at 2:10
2
2
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
I particularly like the part "A 'feature' of this method is that this will break if you are incorrectly assuming only one interactive prompt." as spamming yes to everything can be extra dangerous.
– BeowulfNode42
Sep 16 '14 at 7:21
|
show 3 more comments
First of all, lets understand why the message appears. In fact, if the package do not have dependencies that you have not installed already or that you explicitly told it to install, apt never asks you:
➜ ~ sudo apt-get -qq install xfce4-screenshooter
Selecting previously unselected package xfce4-screenshooter.
(Reading database ... 296146 files and directories currently installed.)
Preparing to unpack .../xfce4-screenshooter_1.8.1-2_amd64.deb ...
Unpacking xfce4-screenshooter (1.8.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.56) ...
Setting up xfce4-screenshooter (1.8.1-2) ...
While if you want to install a package that depends on packages you didn't mention it would ask:
➜ ~ sudo apt-get -q install avis
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libjzlib-java libmina-java libslf4j-java
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Need to get 720 kB of archives.
After this operation, 1,258 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Which even so, wouldn't ask if you also implicitly says that you want to install those package:
➜ ~ apt-get -q install avis libjzlib-java libmina-java libslf4j-java
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Inst libjzlib-java (1.1.3-1 Debian:testing [all])
Inst libslf4j-java (1.7.7-1 Debian:testing [all])
Inst libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Inst avis (1.2.2-2 Debian:testing [all])
Conf libjzlib-java (1.1.3-1 Debian:testing [all])
Conf libslf4j-java (1.7.7-1 Debian:testing [all])
Conf libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Conf avis (1.2.2-2 Debian:testing [all])
But, then, how to make it that it doesn't ask you definitively? Through Rizwind answer should cover ad-hoc and scripting solutions (in fact, that option is more used in scripts) you could instead modify your apt.conf
file and add:
APT::Get::Assume-Yes
Something like this should be enough:
echo 'APT::Get::Assume-Yes;' | sudo tee -a /etc/apt/apt.conf.d/00Do-not-ask
Note, this won't allow other more egregious prompts that you should verify, like:
➜ ~ sudo apt-get install sonar
WARNING: The following packages cannot be authenticated!
sonar
Install these packages without verification? [y/N]
Which is why I wouldn't recommend the use of yes | ...
, since this warning would be ignored.
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (python:3.6-slim
). Should I ask a separate question for that?
– Martin Thoma
Nov 5 '18 at 11:26
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
add a comment |
First of all, lets understand why the message appears. In fact, if the package do not have dependencies that you have not installed already or that you explicitly told it to install, apt never asks you:
➜ ~ sudo apt-get -qq install xfce4-screenshooter
Selecting previously unselected package xfce4-screenshooter.
(Reading database ... 296146 files and directories currently installed.)
Preparing to unpack .../xfce4-screenshooter_1.8.1-2_amd64.deb ...
Unpacking xfce4-screenshooter (1.8.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.56) ...
Setting up xfce4-screenshooter (1.8.1-2) ...
While if you want to install a package that depends on packages you didn't mention it would ask:
➜ ~ sudo apt-get -q install avis
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libjzlib-java libmina-java libslf4j-java
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Need to get 720 kB of archives.
After this operation, 1,258 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Which even so, wouldn't ask if you also implicitly says that you want to install those package:
➜ ~ apt-get -q install avis libjzlib-java libmina-java libslf4j-java
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Inst libjzlib-java (1.1.3-1 Debian:testing [all])
Inst libslf4j-java (1.7.7-1 Debian:testing [all])
Inst libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Inst avis (1.2.2-2 Debian:testing [all])
Conf libjzlib-java (1.1.3-1 Debian:testing [all])
Conf libslf4j-java (1.7.7-1 Debian:testing [all])
Conf libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Conf avis (1.2.2-2 Debian:testing [all])
But, then, how to make it that it doesn't ask you definitively? Through Rizwind answer should cover ad-hoc and scripting solutions (in fact, that option is more used in scripts) you could instead modify your apt.conf
file and add:
APT::Get::Assume-Yes
Something like this should be enough:
echo 'APT::Get::Assume-Yes;' | sudo tee -a /etc/apt/apt.conf.d/00Do-not-ask
Note, this won't allow other more egregious prompts that you should verify, like:
➜ ~ sudo apt-get install sonar
WARNING: The following packages cannot be authenticated!
sonar
Install these packages without verification? [y/N]
Which is why I wouldn't recommend the use of yes | ...
, since this warning would be ignored.
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (python:3.6-slim
). Should I ask a separate question for that?
– Martin Thoma
Nov 5 '18 at 11:26
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
add a comment |
First of all, lets understand why the message appears. In fact, if the package do not have dependencies that you have not installed already or that you explicitly told it to install, apt never asks you:
➜ ~ sudo apt-get -qq install xfce4-screenshooter
Selecting previously unselected package xfce4-screenshooter.
(Reading database ... 296146 files and directories currently installed.)
Preparing to unpack .../xfce4-screenshooter_1.8.1-2_amd64.deb ...
Unpacking xfce4-screenshooter (1.8.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.56) ...
Setting up xfce4-screenshooter (1.8.1-2) ...
While if you want to install a package that depends on packages you didn't mention it would ask:
➜ ~ sudo apt-get -q install avis
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libjzlib-java libmina-java libslf4j-java
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Need to get 720 kB of archives.
After this operation, 1,258 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Which even so, wouldn't ask if you also implicitly says that you want to install those package:
➜ ~ apt-get -q install avis libjzlib-java libmina-java libslf4j-java
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Inst libjzlib-java (1.1.3-1 Debian:testing [all])
Inst libslf4j-java (1.7.7-1 Debian:testing [all])
Inst libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Inst avis (1.2.2-2 Debian:testing [all])
Conf libjzlib-java (1.1.3-1 Debian:testing [all])
Conf libslf4j-java (1.7.7-1 Debian:testing [all])
Conf libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Conf avis (1.2.2-2 Debian:testing [all])
But, then, how to make it that it doesn't ask you definitively? Through Rizwind answer should cover ad-hoc and scripting solutions (in fact, that option is more used in scripts) you could instead modify your apt.conf
file and add:
APT::Get::Assume-Yes
Something like this should be enough:
echo 'APT::Get::Assume-Yes;' | sudo tee -a /etc/apt/apt.conf.d/00Do-not-ask
Note, this won't allow other more egregious prompts that you should verify, like:
➜ ~ sudo apt-get install sonar
WARNING: The following packages cannot be authenticated!
sonar
Install these packages without verification? [y/N]
Which is why I wouldn't recommend the use of yes | ...
, since this warning would be ignored.
First of all, lets understand why the message appears. In fact, if the package do not have dependencies that you have not installed already or that you explicitly told it to install, apt never asks you:
➜ ~ sudo apt-get -qq install xfce4-screenshooter
Selecting previously unselected package xfce4-screenshooter.
(Reading database ... 296146 files and directories currently installed.)
Preparing to unpack .../xfce4-screenshooter_1.8.1-2_amd64.deb ...
Unpacking xfce4-screenshooter (1.8.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.56) ...
Setting up xfce4-screenshooter (1.8.1-2) ...
While if you want to install a package that depends on packages you didn't mention it would ask:
➜ ~ sudo apt-get -q install avis
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libjzlib-java libmina-java libslf4j-java
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Need to get 720 kB of archives.
After this operation, 1,258 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Which even so, wouldn't ask if you also implicitly says that you want to install those package:
➜ ~ apt-get -q install avis libjzlib-java libmina-java libslf4j-java
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Inst libjzlib-java (1.1.3-1 Debian:testing [all])
Inst libslf4j-java (1.7.7-1 Debian:testing [all])
Inst libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Inst avis (1.2.2-2 Debian:testing [all])
Conf libjzlib-java (1.1.3-1 Debian:testing [all])
Conf libslf4j-java (1.7.7-1 Debian:testing [all])
Conf libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Conf avis (1.2.2-2 Debian:testing [all])
But, then, how to make it that it doesn't ask you definitively? Through Rizwind answer should cover ad-hoc and scripting solutions (in fact, that option is more used in scripts) you could instead modify your apt.conf
file and add:
APT::Get::Assume-Yes
Something like this should be enough:
echo 'APT::Get::Assume-Yes;' | sudo tee -a /etc/apt/apt.conf.d/00Do-not-ask
Note, this won't allow other more egregious prompts that you should verify, like:
➜ ~ sudo apt-get install sonar
WARNING: The following packages cannot be authenticated!
sonar
Install these packages without verification? [y/N]
Which is why I wouldn't recommend the use of yes | ...
, since this warning would be ignored.
edited Oct 22 '15 at 10:35
answered Sep 22 '14 at 16:37
BraiamBraiam
51.6k20136220
51.6k20136220
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (python:3.6-slim
). Should I ask a separate question for that?
– Martin Thoma
Nov 5 '18 at 11:26
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
add a comment |
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (python:3.6-slim
). Should I ask a separate question for that?
– Martin Thoma
Nov 5 '18 at 11:26
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (
python:3.6-slim
). Should I ask a separate question for that?– Martin Thoma
Nov 5 '18 at 11:26
For "WARNING: The following packages cannot be authenticated!", what should one do about it? I get this for a Docker image (
python:3.6-slim
). Should I ask a separate question for that?– Martin Thoma
Nov 5 '18 at 11:26
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
@MartinThoma usually, that's a problem with non-updated package list. Run apt-get update before installing. If that doesn't remove the message, ask a question with as much details you can, up to how you created the docker image.
– Braiam
Nov 5 '18 at 11:47
add a comment |
Add -y
to any library install
Eg : sudo apt-get install -y nodejs
Eg : sudo apt-get install -y postgres
Eg : sudo apt-get install -y mongodb
add a comment |
Add -y
to any library install
Eg : sudo apt-get install -y nodejs
Eg : sudo apt-get install -y postgres
Eg : sudo apt-get install -y mongodb
add a comment |
Add -y
to any library install
Eg : sudo apt-get install -y nodejs
Eg : sudo apt-get install -y postgres
Eg : sudo apt-get install -y mongodb
Add -y
to any library install
Eg : sudo apt-get install -y nodejs
Eg : sudo apt-get install -y postgres
Eg : sudo apt-get install -y mongodb
answered Jan 6 at 7:18
vijayvijay
1013
1013
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f523962%2fhow-to-install-a-package-with-apt-without-the-do-you-want-to-continue-y-n-p%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
superuser question superuser.com/questions/164553/…
– αғsнιη
Sep 15 '14 at 12:27