you need to do both lines, I always wrap them in one by doing

apt-get update && apt-get upgrade

update updates the package list and upgrade upgrades the packages. I run a server on Ubuntu(which...