How can I set up Ubuntu to install updates without asking? [duplicate]

Solution 1:

sudo apt-get install unattended-upgrades

unattended-upgrades can be quickly configured to let you upgrade more than just security updates although you should recognise that sometimes (mainly with Firefox in my experience) upgrades can break running applications. That's something you'll have to weigh up yourself.

To configure edit /etc/apt/apt.conf.d/50unattended-upgrades but you can read more about the configuration options on the help site

Solution 2:

In the Ubuntu Software Center, go to the menu "Edit" -> "Software Sources…", then in the third tab "Updates", there is the option to select "Install security updates without confirmation". This will not install all updates automatically, but it will do so for security updates.

There are also other ways (see Oli's answer) in case you want all updates to be installed...

Potential dangers are the same as with all updates: every change can introduce new bugs... (An that's even more so with updates that introduce more features, so it's probably reasonably safe for security fixes, but somewhat less so if you also have repositores like ubuntu-proposed or ubuntu-backports or some PPAs.)