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.
Asked
Active
Viewed 109 times
1
1 Answers
3
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.

karel
- 114,770
sudo apt update
as it allows me to validate the system is what I expect it is, and various issues don't exist. I wouldn't use the-y
when you don't know what the results will be & would more likelyfull-upgrade
to ensure all packages get installed rather than leaving some for later - but your packages installed/system will dictate what's best for you. – guiverc Sep 17 '21 at 07:19