Both should work just fine in any latest ubuntu server terminal but the former is preferred in a bash script.
Isn't the whole Debian distro trying to drop apt-get in favor of just apt? I gotta admit, habit has me always running apt-get!!