Difference between apt-get update and apt-get -y update

Can anyone tell me difference between sudo apt-get update and sudo apt-get -y update

Dear friend,
apt-get update updates the package sources list to get the latest list of available packages in the repositories and “apt-get upgrade” updates all the packages presently installed in our Linux system to their latest versions.

But @harshmehta010102
my question is diff. between sudo apt-get update and sudo apt-get -y update
please read it carefully brdr

Hi,sudo apt-get update command will update available packages to a newer version if available.
s1
In the screenshot above, “ Hit ” tells you that there’s no new package version available. “ Get ” refers to a new version and it refreshes the database.

While, sudo apt-get-y informs you if new updates to any package is available.

But doesn’t refreshes the database to new version.

Thanks Buddy :grinning:

@djasuja2003

-y is a optional argument passed to assume “yes” as answer to all prompts and run non-interactively.

Thanks brdr :grinning:

apt-get-updates actually updates list of available packages and their versions where apt-get-upgrades installs new version of packages. After installing it sees if there are any updates. If there is update it updates the available packages.

Thanks for your reply @mekalacharan123
but my question is meaning of “-y” not meaning of upgrade

Hi djasuja2003,
While you enter the command sudo apt-get update, if any package that is in need to get updated to newer versions will ask you that this update may take the local disk space of some mb Do you wish to continue (Y or n):
Can you remember this line?
In substitue of this you may also give sudo apt-get -y update, which will not ask you for Do you wish to continue (Y or n): in your terminal. Explanation: Here y is meant for ‘yes’ that you (the user) is willing to update by providing it in a command itself.
That’s it!
Have a nice day…

Thank you, Buddy :innocent: