Ubuntu: Can I do a Silent or Unattended Release Upgrade?



Question:

How do I upgrade to a new Ubuntu version without having to react to prompts?

I'm on 12.04 now and would like to install 12.10. When I start the update, it usually downloads stuff, then asks a question, installs a bit, asks a question, etc.. I leave it overnight and sometimes find that it made almost no progress updating. I'd like to just kick of the process, go away and have it finished after a couple of hours. I'm fine with it automatically updating configuration files in /etc and so on. So how to start an unattended upgrade?


Solution:1

The following command upgrades to the new stable release without prompts:

do-release-upgrade -f DistUpgradeViewNonInteractive  

The following command upgrades to the current development release without prompts:

do-release-upgrade -d -f DistUpgradeViewNonInteractive  

I haven't tested it, but it seems it just performs the default action when a question arises. It also times out any scripts if they hang for too long.

You might have to do use dpkg-reconfigure afterwards if you are unhappy with the configuration of certain packages, but most of the time you should be ok.

Source: http://awaseroot.wordpress.com/2012/04/29/ubuntu-release-upgrade-fully-automatic-non-interactive-upgrade/ . In the link there are also other ways to do this.


Solution:2

Just to expand on previous answers, here is how to remotely do the same as the accepted answer, using a passwordless upgrade over ssh that will get your box upgraded to the latest version. It is copied off my own blog entry.

All of these steps assume your package repository is working. Meaning if you execute apt-get update you are not presented with lots of 404s due to having an outdated version. You need to fix that first, so see this answer for that.

0. Update all existing packages

sudo apt-get update  sudo apt-get upgrade  sudo apt-get dist-upgrade  

1. Set up passwordless execution

Add your self to the list of users that can execute do-release-upgrade using sudo without entering a password is achieved by executing

sudo visudo -f /etc/sudoers.d/do-release-upgrade.  

and adding the following line, substituting my-username for your own of course:

my-username ALL=NOPASSWD: /usr/bin/do-release-upgrade  

2. Start incremental upgrades

Log out and execute the following command from your computer. It will do an upgrade without prompting you for input (accepting all default answers), wait for the computer to reboot, and then try upgrading again. It runs until you are upgraded to the latest version.

while true; do       ssh my-user@my-server sudo do-release-upgrade -f DistUpgradeViewNonInteractive;      sleep 120;   done  

3. Fix configuration files to their previous state

Afterwards you will have to move the backed up config files to their previous location as the upgrade process has put default configurations in their place.

Not satisfied with the default answers?

This guy has a way to pre-prepare answers for each prompt, but the downside is that you must know how many prompts there are …


Solution:3

You can do this via the terminal, using sudo apt-get -y upgrade. This will answer "yes" to all prompts. It will not run automatically, though, so you have to run it. It should work. AFAIK there's no way to use the GUI update manager to do unattended upgrades to software (this is NOT the same as a release upgrade!)

If you're trying to upgrade to a different Ubuntu version (aka a release upgrade, and usually the next release in the line of releases relative to your version of Ubuntu), you have to activate that manually. sudo do-release-upgrade may work. There is no way to skip past prompts though. This is why you initiate upgrades when you are going to be around for such prompts - there will be prompts.


Solution:4

Try adding -y option to apt-get but know that it will answer y all queries.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »