When is apt prompting for user confirmation and if it does so, when does it default to “yes”

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












TL/DR: I think the accepted answer is a complete one to my expectation. Other answers that add useful info to the topic are still welcome.



I have used both rpm(dnf) and apt package management systems. In rpm systems I notice when I update or install new packages it almost always prompts the user for confirmation and the default is "no" most of the time. In the apt system I notice that sometimes it does not prompt for the user confirmation and sometimes prompts the user with a default "yes".



So my question is, when does apt-get or things alike prompt the user for confirmation, and if it does so, when does it defaults to yes?



I think I should be able to find the answer if I dig through the source of apt but I have failed to do it, probably because I haven't used the right tool or the right method for processing the source code.



Note that I am not asking for apt-get -y, apt-get --assume-no or things alike. I know these options and I am not asking for someone to tell me that they exist. I am asking the behavior when no additional command line flags are provided. It may depend on command line options when compiling, but answering the behavior for the apt shipped in the default debian and ubuntu repos should be enough.



Any help will be appreciated. It is also OK if you can shed some light on some advice for me to interpret the source code myself.



Edit:
I know there is Apt-get install does not ask for confirmation on LinuxQuestions.org, but I have always thought that there are cases where the prompt of apt-get defaults to no (i.e. [y/N]), and I want evidence from the source. So I posted my question anyway.



From the accepted answer, it is clear that




If the prompt is in the form



Do you want to continue? [Y/n]


It always defaults to yes.




From the comment in the accepted answer I finally found evidence from the source code that I have been looking for: https://github.com/Debian/apt/search?utf8=%E2%9C%93&q=YnPrompt



So I think I have found a complete answer to my question. Other answers that add more information to the topic are still welcome.







share|improve this question


























    up vote
    0
    down vote

    favorite












    TL/DR: I think the accepted answer is a complete one to my expectation. Other answers that add useful info to the topic are still welcome.



    I have used both rpm(dnf) and apt package management systems. In rpm systems I notice when I update or install new packages it almost always prompts the user for confirmation and the default is "no" most of the time. In the apt system I notice that sometimes it does not prompt for the user confirmation and sometimes prompts the user with a default "yes".



    So my question is, when does apt-get or things alike prompt the user for confirmation, and if it does so, when does it defaults to yes?



    I think I should be able to find the answer if I dig through the source of apt but I have failed to do it, probably because I haven't used the right tool or the right method for processing the source code.



    Note that I am not asking for apt-get -y, apt-get --assume-no or things alike. I know these options and I am not asking for someone to tell me that they exist. I am asking the behavior when no additional command line flags are provided. It may depend on command line options when compiling, but answering the behavior for the apt shipped in the default debian and ubuntu repos should be enough.



    Any help will be appreciated. It is also OK if you can shed some light on some advice for me to interpret the source code myself.



    Edit:
    I know there is Apt-get install does not ask for confirmation on LinuxQuestions.org, but I have always thought that there are cases where the prompt of apt-get defaults to no (i.e. [y/N]), and I want evidence from the source. So I posted my question anyway.



    From the accepted answer, it is clear that




    If the prompt is in the form



    Do you want to continue? [Y/n]


    It always defaults to yes.




    From the comment in the accepted answer I finally found evidence from the source code that I have been looking for: https://github.com/Debian/apt/search?utf8=%E2%9C%93&q=YnPrompt



    So I think I have found a complete answer to my question. Other answers that add more information to the topic are still welcome.







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      TL/DR: I think the accepted answer is a complete one to my expectation. Other answers that add useful info to the topic are still welcome.



      I have used both rpm(dnf) and apt package management systems. In rpm systems I notice when I update or install new packages it almost always prompts the user for confirmation and the default is "no" most of the time. In the apt system I notice that sometimes it does not prompt for the user confirmation and sometimes prompts the user with a default "yes".



      So my question is, when does apt-get or things alike prompt the user for confirmation, and if it does so, when does it defaults to yes?



      I think I should be able to find the answer if I dig through the source of apt but I have failed to do it, probably because I haven't used the right tool or the right method for processing the source code.



      Note that I am not asking for apt-get -y, apt-get --assume-no or things alike. I know these options and I am not asking for someone to tell me that they exist. I am asking the behavior when no additional command line flags are provided. It may depend on command line options when compiling, but answering the behavior for the apt shipped in the default debian and ubuntu repos should be enough.



      Any help will be appreciated. It is also OK if you can shed some light on some advice for me to interpret the source code myself.



      Edit:
      I know there is Apt-get install does not ask for confirmation on LinuxQuestions.org, but I have always thought that there are cases where the prompt of apt-get defaults to no (i.e. [y/N]), and I want evidence from the source. So I posted my question anyway.



      From the accepted answer, it is clear that




      If the prompt is in the form



      Do you want to continue? [Y/n]


      It always defaults to yes.




      From the comment in the accepted answer I finally found evidence from the source code that I have been looking for: https://github.com/Debian/apt/search?utf8=%E2%9C%93&q=YnPrompt



      So I think I have found a complete answer to my question. Other answers that add more information to the topic are still welcome.







      share|improve this question














      TL/DR: I think the accepted answer is a complete one to my expectation. Other answers that add useful info to the topic are still welcome.



      I have used both rpm(dnf) and apt package management systems. In rpm systems I notice when I update or install new packages it almost always prompts the user for confirmation and the default is "no" most of the time. In the apt system I notice that sometimes it does not prompt for the user confirmation and sometimes prompts the user with a default "yes".



      So my question is, when does apt-get or things alike prompt the user for confirmation, and if it does so, when does it defaults to yes?



      I think I should be able to find the answer if I dig through the source of apt but I have failed to do it, probably because I haven't used the right tool or the right method for processing the source code.



      Note that I am not asking for apt-get -y, apt-get --assume-no or things alike. I know these options and I am not asking for someone to tell me that they exist. I am asking the behavior when no additional command line flags are provided. It may depend on command line options when compiling, but answering the behavior for the apt shipped in the default debian and ubuntu repos should be enough.



      Any help will be appreciated. It is also OK if you can shed some light on some advice for me to interpret the source code myself.



      Edit:
      I know there is Apt-get install does not ask for confirmation on LinuxQuestions.org, but I have always thought that there are cases where the prompt of apt-get defaults to no (i.e. [y/N]), and I want evidence from the source. So I posted my question anyway.



      From the accepted answer, it is clear that




      If the prompt is in the form



      Do you want to continue? [Y/n]


      It always defaults to yes.




      From the comment in the accepted answer I finally found evidence from the source code that I have been looking for: https://github.com/Debian/apt/search?utf8=%E2%9C%93&q=YnPrompt



      So I think I have found a complete answer to my question. Other answers that add more information to the topic are still welcome.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 4 at 4:57

























      asked Jan 4 at 2:35









      Weijun Zhou

      1,434119




      1,434119




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          apt-get upgrade will always prompt.



          apt-get install will only install automatically if there are no conflicts, held packages and all of the new packages to be installed were explicitly specified. That is if it brings in dependencies automatically it will prompt.






          share|improve this answer




















          • So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
            – Weijun Zhou
            Jan 4 at 3:01










          • It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
            – jdwolf
            Jan 4 at 3:06










          • I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
            – Weijun Zhou
            Jan 4 at 3:12










          • That particular prompt will always be "Y/n" so if you press enter it assumes yes.
            – jdwolf
            Jan 4 at 3:27










          • Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
            – Weijun Zhou
            Jan 4 at 3:30










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414687%2fwhen-is-apt-prompting-for-user-confirmation-and-if-it-does-so-when-does-it-defa%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          apt-get upgrade will always prompt.



          apt-get install will only install automatically if there are no conflicts, held packages and all of the new packages to be installed were explicitly specified. That is if it brings in dependencies automatically it will prompt.






          share|improve this answer




















          • So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
            – Weijun Zhou
            Jan 4 at 3:01










          • It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
            – jdwolf
            Jan 4 at 3:06










          • I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
            – Weijun Zhou
            Jan 4 at 3:12










          • That particular prompt will always be "Y/n" so if you press enter it assumes yes.
            – jdwolf
            Jan 4 at 3:27










          • Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
            – Weijun Zhou
            Jan 4 at 3:30














          up vote
          1
          down vote



          accepted










          apt-get upgrade will always prompt.



          apt-get install will only install automatically if there are no conflicts, held packages and all of the new packages to be installed were explicitly specified. That is if it brings in dependencies automatically it will prompt.






          share|improve this answer




















          • So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
            – Weijun Zhou
            Jan 4 at 3:01










          • It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
            – jdwolf
            Jan 4 at 3:06










          • I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
            – Weijun Zhou
            Jan 4 at 3:12










          • That particular prompt will always be "Y/n" so if you press enter it assumes yes.
            – jdwolf
            Jan 4 at 3:27










          • Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
            – Weijun Zhou
            Jan 4 at 3:30












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          apt-get upgrade will always prompt.



          apt-get install will only install automatically if there are no conflicts, held packages and all of the new packages to be installed were explicitly specified. That is if it brings in dependencies automatically it will prompt.






          share|improve this answer












          apt-get upgrade will always prompt.



          apt-get install will only install automatically if there are no conflicts, held packages and all of the new packages to be installed were explicitly specified. That is if it brings in dependencies automatically it will prompt.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 4 at 2:57









          jdwolf

          2,392116




          2,392116











          • So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
            – Weijun Zhou
            Jan 4 at 3:01










          • It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
            – jdwolf
            Jan 4 at 3:06










          • I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
            – Weijun Zhou
            Jan 4 at 3:12










          • That particular prompt will always be "Y/n" so if you press enter it assumes yes.
            – jdwolf
            Jan 4 at 3:27










          • Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
            – Weijun Zhou
            Jan 4 at 3:30
















          • So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
            – Weijun Zhou
            Jan 4 at 3:01










          • It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
            – jdwolf
            Jan 4 at 3:06










          • I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
            – Weijun Zhou
            Jan 4 at 3:12










          • That particular prompt will always be "Y/n" so if you press enter it assumes yes.
            – jdwolf
            Jan 4 at 3:27










          • Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
            – Weijun Zhou
            Jan 4 at 3:30















          So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
          – Weijun Zhou
          Jan 4 at 3:01




          So if apt-get install prompts, when does it default to yes (i.e. [Y/n]) and when does it default to no (i.e. [y/N])?
          – Weijun Zhou
          Jan 4 at 3:01












          It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
          – jdwolf
          Jan 4 at 3:06




          It doesn't. Either it prompts or it doesn't prompt. If you're talking about where --assume-yes will fail thats a different question isn't it?
          – jdwolf
          Jan 4 at 3:06












          I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
          – Weijun Zhou
          Jan 4 at 3:12




          I mean, "Do you want to continue? [Y/n]" vs. "Do you want to continue?[y/N]" I have seen both cases if I remember correctly.
          – Weijun Zhou
          Jan 4 at 3:12












          That particular prompt will always be "Y/n" so if you press enter it assumes yes.
          – jdwolf
          Jan 4 at 3:27




          That particular prompt will always be "Y/n" so if you press enter it assumes yes.
          – jdwolf
          Jan 4 at 3:27












          Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
          – Weijun Zhou
          Jan 4 at 3:30




          Thank you. Then maybe I have some confusion here, with the rpm system. I will mark the answer accepted.
          – Weijun Zhou
          Jan 4 at 3:30












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414687%2fwhen-is-apt-prompting-for-user-confirmation-and-if-it-does-so-when-does-it-defa%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay