How do i update the droplet? Confused with what command to use seeing the answers.
I am using Ubuntu 14.04 x64. I have tomcat7, Java, nginx, postgres.
Every time i log into my droplet using terminal,i get this :
227 packages can be updated.
126 updates are security updates.
I searched for this question here and got a lot of answers, but i am confused with what command to proceed with. Listed all the questions pointing to the same and their answers :
- Link 1 gives this as an answer : There most likely will be a restart required for a few of them. Shutdown & snapshot then run this: sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo reboot Note: That command will automatically say yes to all updates and will restart one it completes updates. If something breaks or you are having issues, restore back to the snapshot.*
- Link 2 says to use : The most basic way of applying updates would be to use apt-get from the CLI. apt-get update apt-get upgrade Before running apt-get upgrade I would recommend backing up core configuration files though, if you’ve made changes (i.e. nginx.conf, php5-fpm.conf, php.ini etc) as there is potential for them to be overwritten.
- Link 3 gives this as answer : Updating packages normally does not overwrite config files and even if it did, they are usually coded to update your config file with your settings. But it is a good idea to take a snapshot of your droplet before doing any updates. And to update, you can run the following commands, sudo apt-get update sudo apt-get upgrade This is my question only. Im sorry for writing again. Today i was about to do any update and saw a few more answers regarding it, so got confused.
- Link 4 gives this as a answer : You can try the following cli to keep your droplet up-to-date, clean and secure: apt-get update && aptitude dist-upgrade -y && apt-get autoremove -y.
My questions are:
- Are the security updates required command different than the package update required commands?
- Will the commands override any of the config files?
- What commands should i use to update both packages and security updates?
Should i use :
- sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo reboot OR
- apt-get update
apt-get upgrade OR
- apt-get update && aptitude dist-upgrade -y && apt-get autoremove -y.
I am sorry since i am a little nervous with this updates thing. But i know thats its important to have those updates.
Thanks in advance,
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×