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 maindeb http://ftp.us.debian.org/debian/ lenny main contrib non-free deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-freedeb 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.







5 comments
Comments feed for this article
3 February, 2008 at 18:02.48
Como instalar o MythTV no Debian Lenny | Conversas do Bruno
[...] Como nunca se sabe quando será preciso – e porque eu (ainda) não adivinho o futuro -, aqui fica a dica para futura memória: Como instalar o MythTV no Debian Lenny. [...]
3 February, 2008 at 22:32.16
Mika
Here is couple of hints which make things even easier than what you say.
1: Setting up Repositories
There is no need to edit /etc/apt/sources.list directly using text-editor and you don’t need to use commandline.
- Select from Gnome’s menu: Desktop->Administration->Synaptic Package Manager
- Enter the root password when/if it’s asked.
- Select from Synaptic’s menu: Settings->Repositories
- Software preferences window will now open
- Click Add-button in the Software preferences window
- Add channel-window will now open
- Click Custom-button in the Add channel-window
- Enter APT-line to Window which is opened eg. this line
deb http://mirror.csclub.uwaterloo.ca/debian-multimedia/ test
or
deb http://www.debian-multimedia.org lenny main
- Click Add Channel-button.
- Now you can close those Software preferences windows.
- Synaptic will say that repository information has changed. Close that requester.
- Click Reload-button in the Synaptic.
- Synaptic will complain about repository key. Ignore it for now.
- Select from Synaptic’s menu: Edit->Search
- Enter debian-multimedia-keyring and click Search-button.
- Install debian-multimedia-keyring -package which was found.
- You can now use Synaptic and install mythtv.
2. Adding user to mythtv group
When you have installed Mythtv you can add user to mythtv-group this way. You don’t need to use commandline.
- Logout from the desktop and re-login
- Select from gnome’s menu: Desktop->Administration->Users and groups
- Enter the root password when/if it’s asked.
- Users and groups -window will now open
- Go to Groups-tab
- Select mythtv from the group-list
- Click Properties-button
- Group settings -window will now open
- Select your username from the All users -list
- Click Add-button
- Click Ok-button
- Clckk Ok-button
- Logout from the desktop again and re-login
- You are now member of the mythtv-group
3. Opening root-terminal
You can open root-terminal directly from the Gnome-menu. you don’t need to open terminal for the norml user first and then give su-command.
- Select from Gnome’s menu: Application->Accessories->Root Terminal
- Enter the root password when/if it’s asked
3 February, 2008 at 22:44.36
Mika
I use Debian Etch, but those instructions should apply for the Debian Lenny too.
4 February, 2008 at 14:42.56
Chris Lauretano
Thanks for the suggestions Mika
I just figured adding one line to a text file in the console was way less work than clicking 30 buttons to get to a menu in synaptic that is doing the same thing. Plus the commands can just be copied and pasted from my little write-up.
Same goes for adding to the mythtv group. one command (if you have sudo set up) or two (if you don’t have sudo set up) and it’s done, vs a whole lot of menus and clicking.
I guess I wrote the guide to be pretty easy to just copy and paste and be on your way, but it definitely isn’t enough for someone who is afraid of the command line.
I’ll take that into account and give two different guides next time.
5 February, 2008 at 07:18.03
Mika
Well you were talking about differences between Ubuntu and Debian for newbies. You said that Debian is more difficult to use because of supposed lack of point’n'click configuration tools.
I was just showing you that eg. those things which you were doing from commandline in your tutorial don’t require use of commandline, even if commandline IS more powerful in many cases. Lot’s of Ubuntu users seem to think that everything must be done from commandline onm Debian, which is not true.