User Tools

Site Tools


start

This blog is my notebook for computer and technology related information, copies of useful webcontent (with refs of course), troubleshooting, general tips and setups that work well for me.

Useful tags:

Blog

Remote debian updates using apt-dater

Apt-dater is a relatively new utility that allows easy package management of multiple Debian servers from a central control server. I wrote up the necessary steps below, as the existing instructions (http://www.ibh.de/apt-dater/) are slightly unclear on a couple of things.

We run Debian stable (currently lenny) on many servers. Apt-dater is new enough that it is currently only available via the lenny-backports repository. (NB: in what follows I assume knowledge of basic package management and ssh configuration. Help with both of these is widely available on the 'Net.)

On the apt-dater control server:

enable the lenny-backports repository

#lenny backports
deb http://www.backports.org/debian lenny-backports main

add the backports repo key

apt-get update; apt-get install debian-backports-keyring; apt-get update;

install apt-dater

apt-get install apt-dater

generate an ssh key for the apt-dater control user

ssh-keygen -t rsa

configure apt-dater (config files are located in ~/.config/apt-dater by default; running apt-dater as the apt-dater user will generate them in the correct location)

in apt-dater.conf, add the options that allow ssh-agent to use your ssh key (modify for your username and keyfile, of course):

SpawnAgent=true    
AddKeys=/home/apt-dater/.ssh/id_rsa

in hosts.conf, create host groups and hosts as desired

On the remote machines:

enable the lenny-backports repository and install the repo key (as above)

install the apt-dater host program

apt-get install apt-dater-host

create a user account to run the apt-dater commands (the following assumes the user is called 'apt-dater')

  copy the public key from the control server user to the apt-dater user's ~/.ssh/authorized_keys file
  give the apt-date user password-less sudo access to the required privileged commands by adding the following to sudoers
# apt-dater remote updates
apt-dater ALL=NOPASSWD: /usr/bin/apt-get, /usr/bin/aptitude

The magic happens

If you have just added a new host and have not connected to it via ssh before, either ssh directly to the host to accept its host key before starting apt-dater or use 'c' to connect to the host from within apt-dater.

Once your ssh connection works, you should be able to run apt-dater and see the hosts grouped according to your setup in hosts.conf. Refresh the status report on a given host or group of hosts by hitting 'g'; update using 'u'. The '?' key gives you a full list of commands.

Using apt-dater you can install or update individual packages or all packages for individual hosts or groups of hosts. I've just started working with it, but it promises to make my job of staying on top of 10+ Debian servers a whole lot easier.

Ref:

~~LINKBACK~~

2011-10-01 17:44 · brb · 0 Comments

Archive

Blog History

2009-05: 18 entries 2009-06: 12 entries 2009-07: 9 entries 2009-08: 5 entries 2009-09: 2 entries 2009-10: 2 entries 2009-11: 5 entries 2009-12: 4 entries 2010-01: 1 entry 2010-02: 3 entries 2010-03: 2 entries 2010-04: 2 entries 2010-05: 3 entries 2010-06: 10 entries 2010-07: 8 entries 2010-08: 5 entries 2010-09: 4 entries 2010-10: 6 entries 2010-11: 2 entries 2010-12: 6 entries 2011-01: 5 entries 2011-02: 3 entries 2011-03: 5 entries 2011-04: 2 entries 2011-05: 4 entries 2011-06: 5 entries 2011-07: 11 entries 2011-08: 12 entries 2011-09: 4 entries 2011-10: 4 entries 2011-11: 2 entries 2011-12: 1 entry 2012-01: 5 entries 2012-02: 2 entries 2012-04: 3 entries 2012-06: 1 entry 2012-09: 4 entries 2012-10: 1 entry 2013-04: 1 entry 2014-04: 10 entries 2014-08: 2 entries 2015-04: 1 entry 2015-09: 3 entries 2016-04: 1 entry 2016-05: 1 entry 2016-06: 1 entry 2016-07: 2 entries 2016-10: 1 entry 2017-01: 1 entry 2017-02: 2 entries 2017-04: 1 entry 2017-05: 1 entry 2017-07: 2 entries 2017-08: 1 entry 2017-10: 1 entry 2017-11: 1 entry 2017-12: 2 entries 2018-10: 1 entry 2019-02: 1 entry 2019-05: 1 entry 2019-09: 1 entry 2019-10: 2 entries 2020-08: 1 entry 2020-01: 1 entry 2021-01: 1 entry 2021-02: 1 entry 2021-07: 1 entry 2022-05: 2 entries 2022-06: 1 entry 2022-11: 1 entry 2023-05: 1 entry 2023-09: 2 entries 2023-12: 2 entries 2024-09: 1 entry

2024

September

2023

December

September

May

2022

November

June

May

2021

July

February

January

2020

January

August

2019

October

September

May

February

2018

October

2017

December

November

October

August

July

May

April

February

January

2016

October

July

June

May

April

2015

September

April

2014

August

April

2013

April

2012

October

September

June

April

February

January

2011

December

November

October

September

August

July

June

May

April

March

February

January

2010

December

November

October

September

August

July

June

May

April

March

February

January

2009

December

November

October

September

August

July

June

May

start.txt · Last modified: 2022-11-29 08:28 by brb