Archive

Posts Tagged ‘aptitude’

Email Notification of Available Updates: Ubuntu/Debian Server

February 21st, 2009 9 comments

At work we run a number of Red Hat Enterprise machines and CentOS servers.  After finding a large number of machines that were grossly outdated I decided to add a weekly cron job to notify us of available updates.  I used something along the lines of:

#!/bin/bash

yum check-update | mail -s “Weekly Errata Report for $(hostname)” admin@domain.tld

After dropping this little one-liner into /etc/cron.weekly/ we’re now notified of available package updates on a weekly basis, and our machines are keeping up to date much better!

I got to thinking this evening about how to achieve the same results on my Ubuntu and Debian servers.  There does not seem to be an equivalent command to ‘yum check-update‘, but there appears to be a similar solution.

#!/bin/bash

(apt-get update && apt-get -s safe-upgrade && apt-get -s full-upgrade) | mail -s “Weekly Errata Report for $(hostname)” admin@domain.tld

The apt-get equivalent command above is a bit more verbose but it basically does the same thing.  note: the parens are required so that the collective output of the three commands will be piped to the mail utility.

Does anyone else have any suggestions an how to accomplish this with standard Ubuntu/Debian tools?

Categories: Server Tags: , ,

View A Package Changelog Entry With Aptitude or Synaptic

June 29th, 2008 5 comments

Last week Aaron asked me if I knew the reason behind the latest kernel update, or if I knew where to find the changelog.  I poked around a bit and found that Aptitude, the command-line package management tool, has a changelog option.  If you’d like to see the changelog for a package before you update, or even after you’ve updated, you can do so with Aptitude.

Viewing the Changelog From The Terminal

Taking a look at the changelog for a package can be done at the command line by using:

aptitude changelog <packagename>

This only works for officially supported packages, so it’ll complain if you try it against something from a PPA, but this still covers quite a few packages.  So, if you’ve ever wondered the reason behind the update, you can check out the changelog and take a look!

Viewing the Changelog From Synaptic

The same functionality is available within Synaptic as well.  Navigate to:

“System > Administration > Synaptic Package Manager”

synaptic package manager

Find the package you’re interested in using the “Search” button and then select “Package > Download Changelog” from the Synaptic File menu.

download changelog

Categories: Ubuntu Tags: , ,

Getting the source package with aptitude?

September 15th, 2007 7 comments

Ever since I learned about the benefits of aptitude vs apt-get I’ve switched over. It’s been great and I’m sure I’ve preached about the benefits before (/me does some digging and pulls up links) here.

Well, I ran into something yesterday that I haven’t been able to solve with aptitude. Is it possible to pull down the source code from the deb-src repository via aptitude and not apt-get source?

I’d sure appreciate if anyone can tell me a way.

Categories: Randomness Tags: , ,

How to add extra repositories : Ubuntu (5.10 / 6.06.1 / 6.10)

November 19th, 2006 No comments

This post is something that may be fairly basic for many of you, but extremely helpful for anyone new to using Ubuntu. In an attempt to be as comprehensive as I can with my tutorials I wanted to go back to the basics.

Ubuntu (and Debian) use a package management system called APT. This system uses a list of repositories to access updates and install programs specifically designed for your distribution and version. This system is generally more secure and more stable than other methods. Mainly for the reasons that access into these public repositories is kept very strict, and each package is thouroughly tested before it is included. Packages are also digitally signed for verification and security.
This tutorial will outline how to manually edit and update your repository source list to access whatever program you might need.

As usual, before editing any system file you will want to back it up. You should backup your sources.list file using the following command at a terminal:

sudo cp /etc/apt/sources.list /etc/apt/sources.list-backup

Below is an example of a sources list for Ubuntu including main, restricted, security, universe and multiverse. This will give you access to everything in the official Ubuntu repositories (over 20,000 packages)

# Ubuntu supported packages
deb http://archive.ubuntu.com/ubuntu edgy main restricted
deb http://archive.ubuntu.com/ubuntu edgy-updates main restricted
deb http://security.ubuntu.com/ubuntu edgy-security main restricted

# Ubuntu community supported packages
deb http://archive.ubuntu.com/ubuntu edgy universe multiverse
deb http://archive.ubuntu.com/ubuntu edgy-updates universe multiverse
deb http://security.ubuntu.com/ubuntu edgy-security universe multiverse

To update your current sources.list to this expanded list (by default the universe and multiverse are not activated) run the following command:

sudo gedit /etc/apt/sources.list

..and overwrite the contents of the existing file with the example above. Note: the example above does not include the “source” for these packages. Normal users generally don’t make use of the source for the packages. Unless you know you are going to be manually compiling and editing the source for the programs you don’t need to worry about it. If you do want the source simply add a duplicate line using the prefix deb-src instead of deb.
After you’ve made changes to your sources.list file you can update to the latest list using the command:

sudo aptitude update

At that point you can request any available updates using the command:

sudo aptitude upgrade

At this point the system will compare any current versions you have and install any upgrades that are available on the public repositories. Your system will automagically check for updates normally on a daily basis.
EDIT: To create a customized sources.list file based on your interests or needs you can visit the Source-O-Matic published by the Ubuntu Netherlands Team. (note: the source-o-matic currently only supports up to Dapper and NOT edgy.)

You may also be interested in my recent post, Seveas Repository.

technorati tags:, , , , , , , , ,

Categories: Ubuntu Tags: , ,