Installing MythTV on Debian Etch

From MythTV Official Wiki
Revision as of 10:41, 11 July 2007 by Dagaroth (talk | contribs) (Debian GNU/Linux 4.0 ('Etch') Base System Installation)

Jump to: navigation, search

This is a Tutorial to install MythTV on a Debian GNU/Linux 4.0 ('etch') machine.

Debian GNU/Linux 4.0 ('Etch') Base System Installation

Download the netinst disk for your favorite platform from or one of the mirrors.

  1. Boot the target PC from the Debian CD
  2. At the Debian Boot Screen, hit enter
  3. Choose your preferred language, Country or Region, and Keyboard Layout
  4. Choose a servername and domain
  5. Accept automatic partition changes
  6. Install GRUB to the MBR
  7. Reboot
  8. Debian starts its post install configuration routine
  9. Choose your Time Zone
  10. IMPORTANT: do not use the username "mythtv". The user "mythtv" is reserved for use by mythtv
  11. Enter your new root password and the information for your new user account
  12. Add
  13. Make sure that only Base or Standard System is checked
  14. The Debian Netinst installer should now leave you with a login screen

MythTV Installation and Configuration


become root

 su -

now at first we need the mysql server:

apt-get install mysql-server

now set the mysql root user password

mysqladmin -u root password yourpasswordhere


For sound, I ran

apt-get install alsa-base alsa-utils

IvTV driver packages

If you need ivtv for your TV Tuner, then run (NOTE: The following command is one line long. The `uname -r` part is placing your specific linux kernel version, so you may run into trouble if you have compiled your own kernel, in which case you should run 'apt-cache search ivtv' and find the correct modules for your system. You will also need to keep an eye on the 'linux-source-2.6.18' package, and be sure that you are getting the correct version.)

 apt-get install ivtv-utils ivtv-modules-`uname -r` linux-source-2.6.18 linux-headers-`uname -r` module-assistant

Note: If ivtv-utils is not found in apt, you may need to add the contrib packages to your sources.list file

 deb etch contrib
 deb-src etch contrib

If you are using a Hauppauge PVR-150 TV Tuner, then get latest pvr-150 firmware from and put the *.fw files (except the usb-related files, indicated by their filenames) in /lib/firmware, then run

 modprobe ivtv

Please note: Debian GNU/Linux 4.0 comes with IVTV version 0.8.2. If for some odd reason you need newer IVTV drivers, then the two options are:

1) Grab the latest greatest out-of-the-box packages from 'sid'.

2) Build the IVTV drivers from source as described on the IVTV wiki page

Both are not explained in detail over here.

Linux Infra Red Remote Control lirc

Please see LIRC_on_Debian_Etch.

Graphical User Interface (GUI):

In order to run X, I ran (The last entry, fluxbox, is the window manager. It is up to you to decide which window manager you want to run.)

 apt-get install xfonts-base xbase-clients xserver-xorg xfonts-75dpi fluxbox

After installing X, you will need to modify your /etc/X11/xorg.conf file.

Getting MythTV

Out-of-the-box packages

Add the MythTV sources to /etc/apt/sources.list accordingly

 deb etch main
 deb-src etch main

Before we can use apt, we must import the gpg keys for the site by installing the debian-multimedia-keyring package. The "apt-get update" command will give a warning about missing GPG key. Type 'yes' if prompted to install "untrusted" package for the "apt-get install" command:

apt-get update
apt-get install debian-multimedia-keyring

Now we can get the rest of the needed package to build myth via:

apt-get build-dep mythtv

Now you can get mythtv:

apt-get install mythtv

and if you want extras you can search for them with

apt-cache search mythtv

Building from source

If you really insist building yourself:

add your user to the staff group so you get write permission to usr/local now after logging in as a user (DON'T USE ROOT) do this:

svn co

This creates a folder called mythtv where the actual sources are in.

cd mythtv

and compile it with something like:

 ./configure --prefix=/usr/local --arch=athlon-xp --enable-dvb --enable-dvb-eit
make install

The configure line above is only an example. In this example, the installation is configured to be under /usr/local. If you want to put it somewhere else, you can alter the --prefix argument. Run ./configure --help to see what options are available and necessary for you.

You will probably want to be root to run the "make install" part, though, because that target invokes ldconfig to set up shared library paths, and usually nobody but root can do this.

Starting MythTV

Set the mythtv user's password:

 passwd mythtv

Log in as the mythtv user, then start an X session:


Open up XTerm and run the MythTV Setup program:


After configuring MythTV, you can start the MythTV Backend:

 sudo /etc/init.d/mythtv-backend start

You will then need to pull your channel information:


Additional (and Optional) MythTV System Configuration

Auto Login

If you would like the mythtv user to automatically log in, but don't want to use gdm, then follow these simple instructions. First you will need to install rungetty which will allow you to enable the automatic login of the mythtv user.

 apt-get install rungetty

Then, you will set the first screen to automatically log the mythtv user in, instead of displaying a login prompt and waiting for user input. To do this you will edit the /etc/inittab file to change the line:

 1:2345:respawn:/sbin/getty 38400 tty1

to read

 1:2345:respawn:/sbin/rungetty tty1 --autologin mythtv

You will then need to set up the mythtv user account to automatically start X, and also automatically restart X in the event of any type of exit. To do this you will modify the file /home/mythtv/.profile to read:

Script.png /home/mythtv/.profile

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
while [ 1 == 1 ]
                sleep 10

At this point, X will start, but it will just sit there waiting for user input. In order to automatically start mythfrontend when X starts, you will need to edit /home/mythtv/.xinitrc to something like:

 exec irexec &
 exec xset s off &
 exec fluxbox & wmpid=$!
 exec mythfrontend 2>> /home/mythtv/MYTHERRORS &
 wait $wmpid

A few notes on the above suggestion:

  1. The irexec line is starting the IR interpreter program. This is useful if you have edited your lirc configuration files to allow button presses on your remote to operate things outside of MythTV. This line is optional according to whether or not you use irexec.
  2. The xset line is disabling your screen saver and/or screen blanking. This is completely optional.
  3. The fluxbox line is starting the chosen window manager (Fluxbox, in this case), and noting its pid. The window manager that you choose is optional, however the 'wmpid=$!' is not optional without reworking this file.
  4. The mythfrontend line is starting mythfrontend, and appending the MYTHERRORS file with any errors that would normally be lost in the console. This might be helpful for debugging, but please note that it appends to this file, meaning it will continue to grow and should be watched over. The '2>> /home/mythtv/MYTHERRORS' part is optional (the & is NOT optional).
  5. The wmpid line is waiting for Fluxbox to close. This line is not optional without reworking this file.

IMDB Fetch Problems?

The original source of this section is (this is more or less a word-for-word copy):

If you have trouble with the getting all of a movie's information pulled from IMDB (plot, director, ratings, etc), then follow these steps to correct the issue.

First create a backup of the original script

 sudo cp /usr/share/mythtv/mythvideo/scripts/ /usr/share/mythtv/mythvideo/scripts/

Download the SVN Copy


Rename the script


Replace the old script with the new one

 sudo cp /usr/share/mythtv/mythvideo/scripts/