Ubuntu Secrets Guide?

NoOp glgxg at sbcglobal.net
Fri Oct 19 00:48:46 UTC 2012


On 10/17/2012 01:48 AM, Amichai Rotman wrote:
> Hi all,
> 
> Back in the day, before I discovered the wonders of Linux, around the mid
> 90's, I used to read 1000 pages guides by IDG called "Windows 95 Secrets" -
> books that went deep into details on configuring and tweaking Windows, even
> in the registry.
> 
> I am looking for a similar guide for Ubuntu. A guide that explains the role
> of each configuration file, so I can tweak it to my needs. For example: to
> change the Update Manager interval, I need to edit the /etc/cron.daily/apt
> file. Where do I find tips like that?

I think that such a guide would be too voluminous, and change too
frequently for anyone to keep updated. I think that it would be
categorized along the lines of the softbound book that supposedly
encompassed all of the internet, Usenet links, gopher servers (which
Firefox/SeaMonkey have an addon for: OverbiteFF), et al.

What I would do (and did) is first look at /etc/cron.daily/apt. It's a
shell file, so it most likely contains some info regarding it's use. You
can view in a terminal:
$ cat /etc/cron.daily/apt
or if you are using a local browser (much easier IMO):
file:///etc/cron.daily/apt

The apt shell file starts out as:

> $ cat /etc/cron.daily/apt
> #!/bin/sh
> #set -e
> #
> # This file understands the following apt configuration variables:
> # Values here are the default.
> # Create /etc/apt/apt.conf.d/02periodic file to set your preference.
> #
> #  Dir "/";
> #  - RootDir for all configuration files
> #
> #  Dir::Cache "var/cache/apt/";
> #  - Set apt package cache directory
> #
> #  Dir::Cache::Archives "archives/";
> #  - Set package archive directory
> #
> #  APT::Periodic::Enable "1";
> #  - Enable the update/upgrade script (0=disable)

and goes on to list other values. So you can create the file an provide
your configuration settins... if you understand what they are.

Then turn to:
<https://help.ubuntu.com/12.04/serverguide/automatic-updates.html>
which may/may not be what you are looking for. But combined with the
above, should be sufficient to figure out what you need.

That page doesn't really explain much, but instead just (IMO) gives some
script & install info. IOW it's pretty much nonsense as it doesn't
explain, or give links to explain, what the apt configuration variables
are. The /etc/cron.daily/apt provides significantly more information
than the 'official' serverguide provides. That last does provide
information on the 'unattended-upgrades' package (primarily a shell
script again).

The 'unattended-upgrades' package creates the necessary file to "To
enable automatic updates, edit /etc/apt/apt.conf.d/10periodic and set
the appropriate apt configuration options:".
That file consists of:
$ cat /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";

But again, doesn't explain what those mean.

So we then turn to the man pages... Again I prefer to view them in a
browser rather than a terminal, but you can do either:

Let's skip directly to
$ man apt.conf
http://manpages.ubuntu.com/manpages/precise/man5/apt.conf.5.html
There we find detailed information, but what to use?
Looking at the 'Periodic' section we find:

> PERIODIC AND ARCHIVES OPTIONS
> 
>        APT::Periodic and APT::Archives groups of options configure behavior of
>        apt periodic updates, which is done by /etc/cron.daily/apt script. See
>        header of this script for the brief documentation of these options.
> 

So we could be in an infinate loop.

Let's try:

$ man unattended-upgrade
<http://manpages.ubuntu.com/manpages/precise/man8/unattended-upgrade.8.html>

Doesn't tell you squat... with the exception of this:
CONFIGURATION
The  configuration  is  done  via  the apt configuration mechanism. The
default configuration file can be found at
/etc/apt/apt.conf.d/50unattended-upgrades
And that is probably the most useful information you'll find regarding
this "excercise":

$ cat /etc/apt/apt.conf.d/50unattended-upgrades
file:///etc/apt/apt.conf.d/50unattended-upgrades

That at least includes both some reference as to what the configuration
variables (at least the important ones in this case) mean. And provides
the most useful information of any (IMO) when someone turns on automatic
updates (user or server):

// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";

Take advantage of that. If you do not your server/users/and anyone else
on the connection will be saturated during the automatic update(s). The
updates will consume your entire bandwidth. Other users will complain
and other servers using the same connection will pretty much die until
your 'automatic' machine finishes it's updates download(s).
Note: you can throttle the update download for users. See my bug report
from 2008 (with the last comment in 2010) for details/suggestions:

<https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/193558>
[Wishlist] Include limit-rate bandwidth option












More information about the ubuntu-users mailing list