title: Programmatically determining Ubuntu distribution and architecture?
body: <p>What's the best way to programmatically determine if the current machine is running Ubuntu, what architecture it has, and what version of Ubuntu it is running?</p>
  
  <p>One way would be to scan the output of <code>uname -a</code> to check for the right kernel version and architecture.</p>
  
  <p>Another way would be to scan <code>/etc/apt/sources.list</code> for the Ubuntu distribution keyword (eq <code>precise</code>, <code>quantal</code>, etc)</p>
  
  <p>Is there a better way?</p>