Just for curiosity, sometimes while installing software throught apt-get install software_name
the terminal prompt me for a confirmation "type Yes or No", but not allways.
I dont mean the sudo password prompt, but the message "Will be downloaded and configrated XXX Kb, continue?" (or something similar)
Why?
It will usually ask you if there are suggested or recommended packages that depend on the software you are attempting to install, It might also depend on the size of the program or security of the repository you are downloading from.
apt-get install new-package
will ask for confirmation only if it also installs dependencies of the given package.If just the single package you specified is going to be installed without any additional stuff, it stays quiet as you already "confirmed" you want to have that one by typing it.
But if there are some dependency packages, you might change your mind and want to stop the installation (e.g. because one of them caused trouble before), so it prompts you for the y/n.
Now if you want to see what it will do, you can do a dry-run/simulation of the install command. You set this switch by adding an
-s
to the arguments. Example: Installation of the single packagesudoku
That shows you what will happen, but not how big the downloads will be, as the confirmation prompt would do.
Therefore, another switch may be used,
--print-uris
. The same example:The
--print-uris
switch will not only block the actual install, but show the downloaded and installed sizes and additional information about the package (web address and MD5Sum).Attention: Don't use
--print-uris
and-s
together. It will look like-s
only.Note also that you should add the
-y
switch (= assume yes to every question) if you want to process the output, because this one will prompt you for confirmation following the same rules as normal install without switches.Now if you want to filter out the download and installed file size information only without having to read through all the other things, you can use the following command to achieve this (thanks to @terdon for assisting). Again with the example
sudoku
:You see that the first line of the output is the download size and the second line describes the space needed for the installation.
Because this command is not easy to type and even harder to remember, copy the following into a script file e.g. called
apt-get-install-checker.sh
:Don't forget to
chmod +x apt-install-checker.sh
before you execute it!Example output:
Script still in development! Planned features: It should ask you whether you want to perform the install and then continue and run it. Maybe some other nice gadgets that come into my mind tomorrow...
From what I understand apt-get asks for confirmation only when there are additional dependencies to install. There is no way to force confirmation by default for all packages.
However, it is possible to force confirmation on any install command when using aptitude.