Ubuntu Edgy Installation

From MythTV

Jump to: navigation, search
See Ubuntu Installation Guides for installing on other Ubuntu versions.

Contents

Installing MythTV from source on Ubuntu Edgy 6.10

This guide assumes you have installed the base Edgy system (currently Alpha 3 as of this writing) successfully, you have installed accelerated video drivers, and your system is connected to the internet and fully functional. Note that all shell commands, unless otherwise noted, are from the main user's home directory, and are all executed by the main user with sudoer privileges.


Edit /etc/apt/sources.list

Using your favorite text editor, first back up the file /etc/apt/sources.list:

~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
Then, using your favorite text editor with root privileges, open /etc/apt/sources.list and give your system access to dependencies it will need to compile myth (i.e.)
~$ gksudo gedit /etc/apt/sources.list
or
~$ sudo nano /etc/apt/sources.list
You can just copy and paste the next block of text into your sources.list file...it provided me with a 3D spinny-cube desktop, google earth, and Nintendo 64 on the same box as my backend and one of my front ends runs on:
## Add comments (##) in front of any line to remove it from being checked.   
## Use the following sources.list at your own risk.  

deb http://archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse 

## MAJOR BUG FIX UPDATES produced after the final release
deb http://archive.ubuntu.com/ubuntu/ edgy-updates main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ edgy-updates main restricted universe multiverse 

## UBUNTU SECURITY UPDATES
deb http://security.ubuntu.com/ubuntu/ edgy-security main restricted universe multiverse 
deb-src http://security.ubuntu.com/ubuntu/ edgy-security main restricted universe multiverse 

## BACKPORTS REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
deb http://archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse 

## PLF REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
deb http://packages.freecontrib.org/plf/ dapper free non-free 
deb-src http://packages.freecontrib.org/plf/ dapper free non-free 

## CANONICAL COMMERCIAL REPOSITORY (Hosted on Canonical servers, not Ubuntu
## servers. RealPlayer10, Opera and more to come.) 
deb http://archive.canonical.com/ubuntu/ dapper-commercial main 
deb http://www.getautomatix.com/apt/ dapper main 

# Google Picasa for Linux repository
deb http://dl.google.com/linux/deb/ stable non-free 

# Repository for wine
deb http://wine.budgetdedicated.com/apt/ dapper main 
deb-src http://wine.budgetdedicated.com/apt/ dapper main 

#Compiz
deb http://www.beerorkid.com/compiz/ edgy main-edgy 
deb-src http://www.beerorkid.com/compiz/ edgy main-edgy 
deb http://media.blutkind.org/xgl/ dapper main 
deb http://ubuntu.compiz.net/ dapper main 

#Emulators
deb http://ma.ath.cx/debian-emu-rep binary/ 

Save and exit.

Update your system, prep the mythtv user, install dependencies, download Myth

Next, update your apt repositories:

~$sudo apt-get update

Update your system:

~$sudo apt-get upgrade

If your kernel was updated, please reboot your system now.

Create the mythtv user:

~$sudo useradd mythtv

You will need to add the mythtv user to some groups to make things work. Do it through your favorite GUI tool or from the shell if you like. mythtv is an account that logs on automatically on my box, and I don't keep national security secrets on this computer (I have those on my direct-from-the-install-CD windows NT-4 Server/IIS4 box with ports 21, 80, 445, and 3389 forwarded to it, with no administrator password!), and physical access is limited to me, my roommate, and my girlfriend, none of which know my password, so I put the mythtv user in a lot of secondary groups to make life easy:

daemon, bin, sys, disk, cdrom, audio, www-data, video, plugdev, games, users, ssh, haldaemon, rich(that's me), admin, mysql

Build dependencies for MythTV:

~$sudo apt-get build-dep mythtv

This should install almost all dependencies to install MythTV, including build-essential. One additional package needs to be downloaded in addition:

~$sudo apt-get install libqt3-mt-mysql

Install MySQL Server:

~$sudo apt-get install mysql-server-5.0
    • Optional**

If you plan on using a DVB tuner card, download the kernel headers so you can use them when compiling myth:

~$sudo apt-get install linux-headers-`uname -r`

You may need firmware for DVB or other cards...information that will lead you on the right track can be found here: AVerTV HD A180

Prepare the Shared Libraries:

Edit /etc/ld.so.conf and add:

/usr/local/lib

Now download and extract MythTV:

From GUI, go Here, download, and extract using your favorite decompressor, or

~$wget 'http://mythtv.org/modules.php?name=Downloads&d_op=getit&lid=129'
~$tar xvfj mythtv-0.20.tar.bz2

Compiling MythTV

This is where you may need to make some changes depending on your hardware set up. This is for a set up with a DVB tuner card; just delete the last two configure options if you don't need DVB, and change the directory containing the kernel headers (apt-getted above) depending on your version of the linux kernel if you do need DVB:

~$cd mythtv-0.20
~/mythtv-0.20$./configure --prefix=/usr --enable-xvmc --enable-opengl-vsync --enable-proc-opt --dvb-path=/usr/src/linux-headers-2.6.17-8/include/ --enable-dvb

The first option is the most important, as otherwise Myth won't work after installing as it will get put in the wrong directory. Now:

~/mythtv-0.20$qmake mythtv.pro
~/mythtv-0.20$make

Installing MythTV

Go have a beer or five, depending on how fast your system is. Return, hopefully with no errors while compiling, and:

~/mythtv-0.20$sudo make install

Now comes the tricky part. First, create the mythconverg database in mysql:

~/mythtv-0.20$cd database
~/mythtv-0.20/database$mysql -u root < mc.sql
~/mythtv-0.20/database$

The lack of verbage, and just a prompt on next line is a good sign that mysql is in fact running, and the database was created successfully.

Next, create a script so mythbackend starts automagically upon system boot and the daemon is started and stopped properly (cd back into your home folder so it looks the same as this: '$cd ~'):

~$sudo nano /etc/init.d/mythbackend

Again, use your favorite text editor to copy and paste this chunk of text into the file, if you don't like nano...


##############################################################################
#! /bin/sh
#
# mythtv-server MythTV capture and encoding backend
#
# Based on:
#
# skeleton      example file to build /etc/init.d/ scripts.
#               This file should be used to construct scripts for /etc/init.d.
#
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#               Modified for Debian GNU/Linux
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#               and again by Steve Adeff <adeffs@gmail.com>
#
# Version:      @(#)skeleton  1.9.1  08-Apr-2002  miquels@cistron.nl
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
LOCATION=/usr/bin
DAEMON=$LOCATION/mythbackend
NAME="mythbackend"
DESC="MythTV Backend"
HOME=/root

test -x $DAEMON || exit 0

set -e

USER=mythtv
RUNDIR=/var/run/mythtv
ARGS="-d --logfile /var/log/mythtv/mythbackend.log --pidfile $RUNDIR/$NAME.pid"
#EXTRA_ARGS="-v none"
NICE=0

if [ -f /etc/mythtv/mythbackend ]; then
  . /etc/mythtv/mythbackend
fi

ARGS="$ARGS $EXTRA_ARGS"

mkdir -p $RUNDIR
chown -R $USER $RUNDIR


case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
#       /usr/local/bin/plugset2
        start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME "
        start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --exec $DAEMON -- $ARGS
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --exec $DAEMON -- $ARGS
        echo "."
        sleep 3
        start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
        echo "."
        ;;
  *)
        N=/etc/init.d/$NAME
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
##############################################################################

Save and exit. Now make that file executable:

~$sudo chmod +x /etc/init.d/mythbackend

Now add it to startup services:

~$sudo update-rc.d mythbackend defaults

Finishing up

Now, run mythtv-setup and configure your back end, run mythfilldatabase to populate some data into your TV listings, reboot for $h1ts and giggles, then type mythfrontend into a shell, take a really really deep breath, slowly, gently press the enter key, and hope when you go to watch live tv, it actually works. If you have other front ends, or plan to have this as a back end only machine, be sure to edit /etc/mysql/my.cnf (sudo'ed), find this line:

bind-address           = 127.0.0.1

and change it to this:

#bind-address           = 127.0.0.1

There is a wealth of information on what's covered in the Finishing up section here elsewhere in this Wiki, but I did my best to give a thorough walkthrough of what it took to get this running on Edgy.

Installing the pre-compiled MythTV 0.20 packages from the official repositories Ubuntu Edgy 6.10

Please follow the official documentation provided by the Ubuntu MythTV team.

The old content of this section may be found in the history

Personal tools