Ubuntu: Questions and Answers (2014)
Updates
Questions
Q: How do I enable automatic updates?
Tags: updates (Next Q)
Update Manager is constantly offering me updates (e.g. security fixes, updates from PPAs).
How can I tell my Ubuntu installation to automatically download and install updates whenever they become available?
Tags: updates (Next Q)
User: david-siegel
Answer by thisfred
You can do this for security updates, but not for all updates, or at least not very easily. To enable automatic security updates:
From System Settings open Update Manager. Click the 'Settings...' button, then on the 'Updates' tab, select the radio button 'Install security updates without confirmation.'
Answer by weboide
Although it is not wrong or dangerous (see comments to this answer), using apt-get upgrade -y is not the best way to achieve this.
unattended-upgrades is one of the best practices of having automatic updates, especially for headless machines or servers!
You can set up unattended-upgrades pretty easily by typing this in a terminal:
sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
From the description:
This package can download and install security upgrades automatically
and unattended, taking care to only install packages from the
configured APT source, and checking for dpkg prompts about
configuration file changes.
Answer by jorge-castro
In the Update Manager click the Settings button. This dialog will show up:
Select the "Install security updates without confirmation". This will automatically install security updates. If you want to set this up for them remotely via, you can do this:
sudo apt-get install unattended-upgrades
If the package is installed already you can do:
sudo dpkg-reconfigure unattended-upgrades
to change it's behavior. Follow the prompts to enable the feature once you run the command. There's currently no graphical method to just set the entire system to update unattended for everything (you want to play it safe when it comes to automatic upgrades), but setting security updates automatically is a good idea.
Check out the pages for more information if you want to automate getting -updates and -backports:
· https://help.ubuntu.com/community/AutomaticSecurityUpdates#Using_the_.22unattended-upgrades.22_package
· How to enable silent automatic updates for any repository?
· How do I enable automatic updates of all packages?
Tags: updates (Next Q)
Q: Trouble downloading updates due to a "Hash sum mismatch" error
Tags: updates
When I check for updates, I get a "Failed To Download Repository Information" error.
This is what comes up under details:
W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_natty_main_source_Sources Hash Sum mismatch,
E: Some index files failed to download. They have been ignored, or old ones used instead.
Tags: updates
User: rob
Answer by lorem
Just remove the content of /var/lib/apt/lists directory:
sudo rm -fR /var/lib/apt/lists/*
then run:
sudo apt-get update
Answer by robie-basak
This is a known issue, and is exacerbated for clients behind proxy caches. Some large organisations and ISPs (especially in remote parts of the world) have transparent caches of which you may not be aware.
The fundamental issue is that the apt repository format is subject to race conditions when a mirror is updated. This problem particularly affects repositories that change rapidly, such as the development release.
You can track progress on the fix for this in this bug (please mark yourself as "affects me too" in the bug) and this blueprint. But be aware that it is a complex issue and may take more than one release to resolve.
Tags: updates
Q: How do I enable automatic updates?
Q: How can I install just security updates from the command line?
Q: How to prevent updating of a specific package?
Q: Trouble downloading updates due to a "Hash sum mismatch" error
Q: Why can't I update applications without upgrading the whole OS?
Q: What does "sudo apt-get update" do?