After Hours

How do I connect an Apple iPod to an Ubuntu Linux PC?

It is indeed possible to connect an Apple iPod MP3 player to a personal computer running Ubuntu Linux. Jack Wallen shows you what open source software application you need and how to set it up.

I just want to be able to put songs on my Apple iPod from my Ubuntu Linux machine. Fortunately, for all of us end-users, the open source community started taking seriously the call to make multimedia a priority for application development. Getting an iPod recognized and connected to a Linux machine is only slightly more difficult than it is with iTunes.

Our environment

What we are working with is the following:

  • PC: 64-bit machine running 32-bit Ubuntu 8.04 Hardy Heron
  • iPod: 5-gen 30 gig video iPod formatted in Windows format
  • Software: gtkpod-aac

Getting and installing gtkpod

You can get and install gtkpod two ways: via the command line or via the Synaptic tool. Now there are two versions of gtkpod available -- one with AAC support and one without. I have installed the version with AAC support because about forty percent of my music was imported from my now-dead iBook. So I have a few M4A files to play with.

Take note that the only way you will be able to access your iPod for writing is if your iPod is formatted in the Windows format. The Apple formatted iPods can be recognized but writing to them is very difficult (and has, in my case, resulted in complete loss of data on the iPod.) So if you have an Apple-formatted iPod, save all your music, reformat your iPod in Windows format, and load all your music back on to it.

This blog post is available in the PDF format in a TechRepublic Download.

Since many people fear the command line, we're going to use the Synaptic tool to do the installation for us. You can fire up Synaptic from your menu. The desktop you use will determine from where Synaptic is launched (I use Enlightenment so I launch it from Applications | System Tools | Add/Remove.) Of course you can always issue the command (from a terminal window or from the Run Command dialog): sudo synaptic to fire up the Add/Remove tool.

Once Synaptic is running do a search for gtkpod. Once the results appear (Figure A) click the box next to the version of gtkpod you want to install.

Figure A

You can either click the box or right click the entry you want to install and select Mark For Installation.

Once you have marked the package, click the Apply button and the installation will continue. You will also notice that there will be some dependencies to be met for the installation. One dependency should be libgpod, which is the library that allows your system to access your iPod. Without libgpod you will have no luck mounting your device.

All installed, now what?

The first thing you need to do is plug in your iPod to the USB port on your machine. Once you have done that, fire up a terminal and issue the command dmesg. As you can see (Figure B) the device is seen and registered as sdc. The sdc name is what we are going to use to mount the device for the first time.

Figure B

As you can see we have sdc, sdc1, and sdc2.

Now we know (or should know) that sdc is the special device name and sdc1 is the boot partition, so sdc2 is more than likely where we want to be. So we will mount /dev/sdc2 to access our iPod. But first we must create a directory for this purpose. Run the following command:

sudo mkdir /media/IPOD

Now you are ready to mount the iPod. Run the command:

sudo mount /dev/sdc2 /media/IPOD

If you run the command ls /media/IPOD you should see the contents of your iPod.

Now, unmount the iPod with the command:

sudo umount /media/IPOD

What we need to do now is create an entry in /etc/fstab so that users can mount the iPod with the simple command mount /media/IPOD. To do this issue the command:

sudo nano /etc/fstab

And enter a line like so:

/dev/sdc2       /media/IPOD     auto    defaults,user,rw        0 0

Save the fstab file and give the mount command a try: Issue mount /media/IPOD and check to see if your iPod shows up. If it did, you're good to go.

Firing up gtkpod

You should find gtkpod in the Multimedia or Sound & Video submenu of your main menu. Fire that bad boy up, and let's get ready to connect it to your iPod. Once it is running you will need to set up a Repository for gtkpod. This isn't the same as a repo for apt (I'm not quite sure why the developers chose this confusing nomenclature, but that's what we have to deal with.) Go to Edit | Preferences and click the Set Mountpoint Or Edit Repository Options button. (Figure C)

Figure C

Without setting the mountpoint, gtkpod will not see your iPod.
Once the new window opens (Figure D) you can set the information for your iPod. The first thing you will do is click the Add New Repository/iPod button.

Figure D

As you can see my iPod is already configured.
When you click the dd New Repository/iPod button you will be greeted with a smaller window asking for some simple information. (Figure E)

Figure E

Name your repository the same as your iPod (if you named your iPod when you formatted it.)

Make sure you enter the information exactly. The mount point will be /media/IPOD (unlike that in the screenshot.) You will also need to select your iPod model from the drop-down list. Once you have entered the necessary information, click OK. Now from the Repository Options Window you should see the iPod you just created from the iPod drop down. Select that and the correct information should appear. Click OK to close the Preferences window.

Now, from the main gtkpod window, click the Load iPods button and your iPod will load. Since this is the first load it will take a while. I have 3,508 songs on my iPod so it takes a while to load. Once it has loaded, you are ready to play around.

Once you have added/removed/edited songs/playlists, you will need to make sure you hit the Save Changes button. Once all the changes are saved (and songs imported or deleted) you can then close out gtkpod.

WARNING!!!! Before you unplug your iPod you have to unmount it first. To do this go back to the command line and issue the command:
umount /media/IPOD

Once you are returned to your command line, you can unplug your iPod.

Final thoughts

Of course we didn't dig too deeply into the usage of gtkpod. The reason being is that it's very straightforward to use. What is not so straightforward is the connecting of the iPod. Hopefully, now, you have a better understanding of how to use your iPod with Linux. It's not as hard as you think. Just make sure you follow the instructions carefully and DO NOT unplug your iPod without unmounting it first.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

24 comments
arfamuj
arfamuj

I know it's still in some sort of beta state, but it promisses to be a nice replacement for iTunes, plus some other nice features. Based on Mozilla's XUL runner, it runs on Windows, Linux and Mac.

rAllcorn
rAllcorn

Has anyone tried to install the iTunes for the MacOSx, which is really UNIX. If it works in UNIX, it "should", in theory, work in Linux. Curious.

DHanrahan
DHanrahan

I run Ubuntu 7.10 & Amarok 1.4, & do not recall having to do anything on the command line to use my iPod Nano. Simply installed gtkpod & all its dependencies via Synaptic, plugged in the Nano & finally did some quick setup in Amarok. I now have full functionality w/ my Nano in Amarok.

Mark W. Kaelin
Mark W. Kaelin

While Jack may consider this process to be "not that difficult" it certainly has more hurdles to overcome than using an iPod with Windows or Mac OS X. Will you be connecting your iPod to your Linux PC?

Neon Samurai
Neon Samurai

If I understand osX correctly, the BSD platform sits under the Apple makeup which is where most of Apple's programs interact. I think you'd need to find a build of Caoca (spelling?) for your prefered *nix similar too how one requires QT libraries behind KDE apps or GTK behind Gnome apps. I remember asking why Adobe can't simply recompile the osX code for Linux/BSD and getting an answer along those lines.

RipVan
RipVan

For the person who asked why someone with Linux would try to connect a proprietary device, well, I told my kids to kiss Winders goodbye. However, I knew that the iPod connectivity and use was going to be an issue with my 16 year old daughter. I had her use Amorok very briefly and then loaded Banshee. She told me that she had been adding music but couldn't see it. Then one day when we were playing with her iPod in the new car stereo, she saw all the newer songs in the library and it seemed that the new songs were added as mp3's instead of in iPods proprietary format. So she could see part of the music depending on what she was hooked up to. But at least all the stuff was there. But when gtkpod came out, I had her try that and she liked it better and said that it is working fine for her (slower to upload CD's to it than from Winders). But I don't know about all the command line stuff. She asked a few questions to get started, but we never had to go to the command line for anything. She has been happier since she started using it than she was with Banshee (and before that Amarok). (I have them on PCLinuxOS, btw.) I noticed that there was software out for the iPod called Floola. I just loaded it within this last week, but forgot to tell her to play around with that and see if she likes it. Thanks for the reminder! I will remind myself to tell her to try that when I get home...

blissb
blissb

Yikes -- What I did: Installed Amarok. Installed gtk-pod. Launched Amarok. Plugged in iPod. Selected "Apple iPod" from the drop-down in the Amarok dialog that automagically appeared. Started transferring music to the device. If I'd had to follow the directions in this article, I'd have given up.

martian
martian

I've always been a strong believer that if I needed proprietary software just to transfer files from a device, be it an mp3 player or a digital camera, it is not worth my money for the inconvenience. No matter the OS, it should just mount as a drive in your file manager of choice. Also, isn't everyone just tired to death with everything seemingly needing an "i" in front of it? Find a fakking new letter to pick on...

bart001fr
bart001fr

Why anyone who has gone through the process of getting (any flavour) Linux to run well, would go to the trouble of getting an (overpriced) closed-source iPod with its attendant DRM nightmares is beyond me, when there are so many straight mp3 players out there into which you simply drop the songs you want from whatever source you want and even create your playlists with the built-in firmware. An iPod for me? I would immediately sell it and go get myself some CDs with the money.

Neon Samurai
Neon Samurai

For a sync process developed complete independent of the vendor's blessings; it's not so bad at all. If you want something more official, you'd have to ask Apple when they expect the iPod sync software for nonWindows/nonOSX platforms will be ready for release. I don't see them doing this any time soon or even the minimal step of releasing API interface specs so proper support can be built. As for connecting my iPod to my Ubuntu; it won't be happening soon. An iPod would be limiting what I do with a device that size. I will keep the PDF handy though for future reference. This is written for Ubuntu Linux but should be similar setup for any other Linux based distribution. My puzzles are on the back end; how do I get my wife's iPod/Macbook reading music out of the house library. I'm a minimal Mandriva or Deb install samba and support for iTunes network access. I just don't want the home library writtable by that kludgy iTunes especially should it decide to add DRM to existing music.

Jaqui
Jaqui

I don't have an ipod, nor do I have any interest in getting one.

Neon Samurai
Neon Samurai

Remember eEverything to indicate that it was cool and hip and may somehow relate to computers. At least iEverything remains more closely bound to Apple products. The one that really grinds on me is prefacing everyting and it's dog with "cyber".. Ever second news anouncement was about a cyberSomething because that meant it was hip and cool and somehow related to computers. This is the one that really gets me due to my considering a cyberSomething an electronic replication and inhancement of a human function; cybernetics being the evolution of bionics which just replicate. Cybereye, sure. Cyberlimb, yup. Cybercrime, nope.. it's just crime, we don't need the hip preface or differentiation.

blissb
blissb

... I'm confused by one thing -- the "attendant DRM nightmares" of which you speak. I don't understand. I make MP3 from my CD, or buy from Amazon (DRM free), I transfer to iPod, I listen. What nightmare?

jlwallen
jlwallen

you could install xmms on your wife's macbook and have it stream music from the house library (i'm assuming said library is on the mandriva box?). and you can always import music onto your wife's ipod through the mandriva box - that way you're avoiding iTunes (bleargh) all together. oh, just make sure if you install xmms that you get the version that will support the file type you use. here's a link for an xmms darwin port: http://xmms.darwinports.com/

jlwallen
jlwallen

linux can work with many media players. well, maybe not the zune. but who wants a zune anyway... >^.^

CharlieSpencer
CharlieSpencer

I don't have an Ubuntu box for you to not connect to.

martian
martian

I use the slimmer 64 bit Xubuntu flavour, because of that I was initially unable to get a package for xmms. But a quick online search provided the answer and now am back to using my favourite "won't choke on my real big all in one folder playlist" player... YMMV

Neon Samurai
Neon Samurai

If I read correctly, I should be able to open a port on the Mandriva server and have iTunes tap it like any osX shared library. My wife should be able to listen to it all on her macbook or load up her iPod through the normal process. The only difference should be that the files are physically hosted on the central machine with the rest of my data. She's my ultimate test subject with a love of technology bordering on distain. Average User Test? - Make it work easily for my wife or she won't touch it. Now, if it was a house of geeks and everybody was Linux comfy they there would be no challenge; NSF, Amarok, gtkpod and it's done. XMMS I used to use back when the Windows world was al over Winamp. I keep it on my PDA though I don't find reason to use it soo much these days. I will keep that idea in mind though should I need to stream media; I'd not thought of it for that use. So far, VLC has been the lifesaver for osX and my media needs. The macbook as an out to TV adapter so we pull any video down to the local machine and run it too the TV through VLC. Streaming from the storage server may be an alternate option though.

jlwallen
jlwallen

if you have local radio stations worth listening too. the only station around here worth listening to is a high school station that is run by high school kids 24/7. granted it is the oldest surviving high school radio station in the country...and it does play a good mix of music, but it's just not nearly as good as hand picking your own music.

Jaqui
Jaqui

no portable "mp3" players. I'll listen to local radio station, that way I can also keep up on local news, traffic, weather while on the go.

jasonhiner
jasonhiner

There are serious audio-heads who swear that high-quality vinyl is still the best consumer audio format available. To the iPod issue ... I just like to be able to quickly create my own playlists. And I like to be able to purchase a song and add it to one of my playlists within about 30 seconds. That's the real value of the iPod for me.

Jaqui
Jaqui

vinyl is a better sound, but I just buy the cds and stick them into the drive to listen to them. or, turn on the FM radio station.

jlwallen
jlwallen

if you have the right hardware, vinyl is as smooth as it gets. but then a high end turntable will set you back far more than an ipod.

Editor's Picks