Score:1

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

ru flag

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.

guiverc avatar
cn flag
I would always `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 likely `full-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.
zzz.rivera24 avatar
ru flag
Thanks @guiverc! I'll take note of the full-upgrade instead of using apt upgrade -y.
zzz.rivera24 avatar
ru flag
hi @N0rbert this helps a lot by providing detailed explanation of the commands. Thank you!
Score:3
sa flag

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.

zzz.rivera24 avatar
ru flag
thank you @karel for answering!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.