This is the first of a series of articles useful for any Ubuntu user transitioning to Debian (on which Ubuntu is based). Though of course they are very similar at the core, the ideologies and with that the communities are very different. The differing ideology leads to much less support in some areas that are just ‘point and click’ simple in Ubuntu. I’m writing these articles because I feel that things like this aren’t often documented by the Debian community, for a number of reasons that I won’t get into here.

Last night, I moved my desktop to Debian Lenny (from Ubuntu Hardy Heron, the version that will be released in April). I always keep my /home in a separate partition for just such an occasion. This morning I set out to get some of the apps I use on the desktop installed. Of course not being as focused on ease of use, I knew it wasn’t going to be just a few clicks of the mouse as it is on Ubuntu.

Step I: Setting up Repositories

The default Debian repositories have only free (as in speech AND beer) software, and because of some dependencies Mythtv does not make the cut. Third party repositories step in to fill the void. The obvious one to use for this is Debian Multimedia. To get started, as root open your sources.list file (/etc/apt/sources.list) in your favourite editor (vi, nano, etc). Your file will look close to this example:

# deb cdrom:[Debian GNU/Linux testing _Lenny_ - Official Snapshot i386 CD Binary-1 20080128-10:37]/ lenny main
# deb cdrom:[Debian GNU/Linux testing _Lenny_ - Official Snapshot i386 CD Binary-1 20080128-10:37]/ lenny main
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
 deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib non-free
 deb-src http://security.debian.org/ lenny/updates main contrib non-free

By default, the only difference seen in the example is the addition of the ‘contrib’ and ‘non-free’ sections of the repository. We will be adding a few new lines to the file. On the Debian Multimedia site, there is a list of available mirrors. For this guide, the list of ‘testing’ mirrors is of interest. You’ll notice there are no United States mirrors, so just pick whatever is geographically closest to you. The mirrors host CSS (Content Scramble System) packages, which is illegal in the United States under the Digital Millenium Copyright Act. For me, geographically closest was the University of Waterloo.

In my sources.list, I added the following lines:

#debian-multimedia.org
 deb http://mirror.csclub.uwaterloo.ca/debian-multimedia/ testing main
 deb-src http://mirror.csclub.uwaterloo.ca/debian-multimedia/ testing main

After adding the lines, you’ll want to run ‘apt-get update’ to download the package lists from the mirror. You will see an error about a missing GPG key, just ignore it for now. When the update is done, you need to install the GPG keyring for the mirror, which is conveniently available as a package on the mirror. Just use ‘apt-get install debian-multimedia-keyring’, and follow that with another ‘apt-get update’ to be sure you no longer receive the error message. When installing debian-multimedia-keyring apt will warn you that the package is not authenticated. If you don’t feel comfortable installing without verification, you can download and install a .deb package of the keyring from the Debian Multimedia site.

Step II: Installing Packages

With your favourite package manager, it is now time to install the mythtv packages. For this step I used Synaptic. Just open Synaptic (it’s on the System > Administration menu), and in the search dialog search names only for “myth” to get a nice list of Myth-related packages. As this guide is for the frontend only (a backend guide will come when I move my dedicated server from Ubuntu Server LTS to Debian Stable), only a specific subset of the packages are of interest. For starters, mark ‘mythtv-frontend’ for installation. It will install mythtv-common, libmyth, mythtv-doc, mysql-client, mysql-client-5.0, mysql-common, and a couple other small dependencies. The following is a list of some other packages you may want:

  • ‘mythtv-themes’, additional themes for the interface and OSD (inclluding widescreen themes).
  • ‘mythvideo’ for browsing and playing videos. Useful for watching movies stored on an NFS server for instance.
  • ‘mythnews’, an RSS feed reader.
  • ‘mythmusic’ for playing music.
  • ‘mythplugsin’ if you just want all of the above plugins and more.

There are some packages that you will not want installed for this guide, specifically ‘mythtv-database’ and ‘mythtv-backend’. The server hosting the tv tuner cards and storage runs these packages as well as a MySQL database server and optionally an Apache web server. Apply your changes, and once the installation is finished you can move on to the final step.

Step III: Configuration

This step is where some of the differences between Ubuntu and Debian get in the way. In Ubuntu, on first launch of the Mythtv frontend, it will prompt you to ask you if you would like to be automatically added to the mythtv user group. The frontend will not run unless you are a part of that group. It isn’t a big deal to do manually, but on Debian if you ran the frontend from the Applications menu and not a terminal window, you would never be presented with the error messages –not that the error messages at all indicate what the source of the problem is. If you can’t get past the lack of hand-holding, Debian is probably not an appropriate distribution for you.

Open a terminal window and switch to the root user (i.e. ’su’ and then enter the root password). To add your user to the mythtv group, we will use the adduser command. The syntax for this operation is ‘adduser [USERNAME] [GROUPNAME]‘. For example, I used ‘adduser chris mythtv’. Unlike most unix commands, it will tell you that it was successful. After doing this, log out and back in. A quick ‘groups’ command in a terminal will verify that mythtv is one of the groups your user is in. At this point, you can launch the mythtv frontend and do the database configuration from its full-screen interface or you can preconfigure it by editing a config file so that you can have the database information open on screen to just copy and paste. I recommend the latter just because it makes things easier. You will need to know the following pieces of information about your database server:

  • The host name (if in your hosts file) or the IP address. Obviously the server needs to use a static IP address.
  • The mysql username –default is ‘mythtv’.
  • The mysql database name –default is ‘mythconverg’.
  • The msql database password. This is typically randomly generated during the setup of the Mythtv backend server.

If you don’t know the username or password, it is easy to look up on the backend server. The information is stored in /etc/mythtv/mysql.txt (which is owned by user mythtv group mythtv, so view it as root). Again, this guide assumes that the backend server is properly configured to allow remote database access. With all the information properly set, you can now launch the mythtv frontend. The first time you launch it, I recommend launching ‘mythfrontend’ from a terminal window in case there are errors.

Step IV: Extra Configuration

Part A: Playing videos from a remote NFS server

To begin, the ‘nfs-common’ package needs to be installed. I believe it is installed by default with Debian Testing (Lenny). As root, edit the file /etc/fstab. At the end of the follow, create a new line like the end of the example below, changing the IP address of the server, the share on the server, and the local mount point as needed.

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sda1       /               reiserfs notail          0       1
/dev/sda4       /home           reiserfs defaults        0       2
/dev/sda3       none            swap    sw              0       0
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0 # Video storage on NFS server
192.168.0.10:/storage	/mnt/myth nfs defaults 		0 0

If you have not already done so, as root create the folder that you will mount the NFS share to. Following the example above, the command would be ‘mkdir /mnt/myth’. With the mount point created, issue the command ‘mount -a’ to mount any unmounted filesystems in your fstab file that are set to auto mount (i.e. any that don’t have ‘noauto’ as options). If your NFS server is configured properly, the command will return with no errors.

With the preconfiguration done, you can now launch the mythtv frontend to complete the process. From the main menu, go to Utilities/Setup, then Setup, then Media Settings, Videos Settings, and finally General Settings. In the “Directory that holds videos” box, input the mount point you used to mount the NFS share (or a subdirectory of it depending on the layout of your NFS share). Again following the above example, the box should read ‘/mnt/myth’. Save the settings, but depending on the other settings set in that section you may need to run the Video Manager (from the main menu it is under Utilities/Setup). It will scan the folder, populating a table in the database with a list of the videos found. Cover art and information about the movies can be input in the Video Manager by inputting the IMDB number for the item.

If this guide helped you get your front end set up or you have any other comments or suggestions, feel free to leave a comment.