Is it always necessary to do "sudo apt update" and "sudo apt upgrade" when a fresh instance is created? [duplicate]

I am a newbie in linux administration. I have always performed "sudo apt update" followed by "sudo apt upgrade -y" after creating a fresh Ubuntu instance (mostly I am using AWS EC2 instances). However, I cannot recall, for the life of me, if it is really necessary or part of what we call "best practice" when administering linux servers. Please let me know if it's best practice and whether I should continue on this "habit" of mine.


Solution 1:

It's a good practice to keep your software updated in order to install all security related updates especially after a new installation of Ubuntu when many new updates are usually available. Installing all security updates is particularly important if your Ubuntu OS is a server.

It's also a good idea to run sudo apt update before running apt commands that would install a large number of packages.