The first release of Ubuntu, the Warty Warthog, was made available to the world on October 20, 2004. Less than two years later, Ubuntu is now the number-one most popular Linux version at DistroWatch.com, far ahead of the distribution in second place. Countless articles, reviews, and blog postings have been written about Ubuntu and its sister distros, Kubuntu and Edubuntu. In Macedonia, Ubuntu will be installed in 468 schools and 182 computer labs. In South Africa, HP is going to offer desktops and notebooks with Ubuntu on them. Around the world, hundreds of thousands of people have installed Ubuntu, and, in many cases, it was the first Linux distro they'd ever tried. For many of those new Linux users, Ubuntu has been so good that they've switched to Linux. For a Linux distro that's still an infant, this is remarkable stuff!

Why has Ubuntu been so successful? Technically, it's based on Debian, which is an excellent foundation for a Linux distro, but Ubuntu has added a level of finish and polish that has made it a joy to use for newbies, though it is still a powerhouse for more experienced users. It's incredibly up-to-date; a team of dedicated developers ensures that everything "just works," with regular updates to the various packages that make up the distro and a roughly six-month release schedule between distros.

But the secret behind the phenomenal success and growth of Ubuntu is really one man: South African Mark Shuttleworth. After founding Thawte, a company providing digital certificates, when he was 22, Shuttleworth sold the company four years later to VeriSign for a large amount of money. After fulfilling his dream of going into space, he decided to fulfill another and build the best Linux distro in the world. In that he has succeeded.

But it's also about principles with Shuttleworth. He has plenty of money, and he wants to do things with his fortune that will change the world. Consequently, Ubuntu will always aim for the highest quality, and it will always be free. The name Ubuntu itself is laden with meaning, as it is an African word meaning both "humanity to others" and "I am what I am because of who we all are," while Kubuntu means "towards humanity." Shuttleworth has promulgated the Ubuntu Code of Conduct, which states that members of the community must practice consideration, respect, and collaboration.

This is a book written by passionate Ubuntu and Kubuntu users who are excited to talk about a powerful, cool distro that meets the needs of novice, intermediate, and experienced users in a wide variety of ways. The hacks in this book cover the essential areas of Ubuntu, and they'll help you maximize your use of the distro. Whether you want to play music and movies, or use Ubuntu on your laptop as you travel, or install just about any software package you could ever want, or run other operating systems inside Ubuntu, we've got it all covered.

We know you'll get a lot out of Ubuntu Hacks, but we also want to encourage you to give back to the community and help grow Ubuntu:

Contents

Why Ubuntu Hacks?

The term hacking has a bad reputation in the press. They use it to refer to people who break into systems or wreak havoc with computers as their weapon. Among people who write code, though, the term hack refers to a "quick-and-dirty" solution to a problem, or a clever way to get something done. And the term hacker is taken very much as a compliment, referring to someone as being creative, having the technical chops to get things done. The Hacks series is an attempt to reclaim the word, document the good ways people are hacking, and pass the hacker ethic of creative participation on to the uninitiated. Seeing how others approach systems and problems is often the quickest way to learn about a new technology.

How to Use This Book

You can read this book from cover to cover if you like, but each hack stands on its own, so feel free to browse and jump to the different sections that interest you most. If there's a prerequisite you need to know about, a cross-reference will guide you to the right hack.

How This Book Is Organized

This chapter shows you how to get started with Ubuntu. Whether you want to give it a whirl with a live CD, or you're ready to jump right in and install Ubuntu on your computer, you'll find what you need here. In addition to getting all the information you need to install Ubuntu on your system, you'll also learn how to get started with the Linux command line, set up your printer, file a bug report, and more.

You're going to spend a lot of time in front of a mouse, keyboard, and monitor, working with one of the Linux desktops. This chapter helps you get the most out of the GNOME and KDE desktop environments for Linux, and even helps you find out about a few others that are worth checking out. You'll also learn such things as how to get Java set up, how to work with files on remote computers, and how to get Ubuntu talking to handheld computers.

This chapter gets the music and movies running so you can have some fun in between all the work you get done with Ubuntu. You'll learn how to play nearly any kind of audio and video, and burn files, music, and movies to optical discs.

If you're using Ubuntu on a notebook computer, you're probably going to want to cut a few wires. This chapter helps you get going with various wireless cards. You'll also learn how to get the most out of your laptop, from saving energy to installing add-on cards.

This chapter shows you how to tweak X11, the windowing system that lurks beneath the shiny veneer of KDE and GNOME. You'll learn how to get your mouse and keyboard working just right, and also how to get X11 configured so it takes full advantage of the graphics adapter in your computer.

To some extent, any Linux distribution is a big collection of packages held together by a whole lot of interesting and useful glue. Ubuntu's great advantage is the quality of those packings and all the testing and improvement that goes into them. This chapter shows you how to work with packages, whether you're installing them, finding new ones from beyond the edges of the Ubuntu universe, or creating your own.

This chapter shows you how to tighten up security on your system. You'll learn the basics of how the sudo command keeps you and your fellow users out of trouble, how to protect your network from intruders, and even how to keep your data safe if one of the bad guys does make it in.

Every now and then, you're going to have to take a break from the fun of using Ubuntu and do some administrative tasks. Whether you're adding a new user, tweaking your system's configuration, or doing those backups you should have done long ago, you'll find what you need in this chapter.

This chapter shows you how to run Ubuntu inside of other operating systems, and other operating systems inside of Ubuntu. It's all made possible by a combination of emulation and virtualization, which effectively lets you run a computer inside of a computer.

Ubuntu isn't just a great desktop operating system; it also makes a fantastic basis for a server. In this chapter, you'll learn everything from doing a basic server install to installing network services such as DNS, mail, Apache, and more.

Conventions Used in This Book

The following is a list of the typographical conventions used in this book:

Italic

Used for emphasis and new terms where they are defined, as well as to indicate Unix utilities, URLs, filenames, filename extensions, and directory/folder names. For example, a path in the filesystem will appear as /usr/local.

Constantwidth

Used to show code examples, the contents of files, and console output, as well as the names of variables, commands, and other code excerpts.

Constantwidthbold

Used to highlight portions of code, either for emphasis or to indicate text that should be typed by the user.

Constantwidthitalic

Used in code examples to show sample text to be replaced with your own values.

Gray type

Used to indicate a cross-reference within the text.

⏎

Used in file contents at the end of a line of code to indicate that it carries over to the following line because of space limitations. You should enter these lines as one line in the actual files.

You should pay special attention to notes set apart from the text with the following icons:

Tip

This is a tip, suggestion, or general note. It contains useful supplementary information about the topic at hand.

Warning

This is a warning or note of caution, often indicating that your money or your privacy might be at risk.

The thermometer icons, found next to each hack, indicate the relative complexity of the hack:

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product's documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: "Ubuntu Hacks by Jonathan Oxer, Kyle Rankin, and Bill Childers. Copyright 2006 O'Reilly Media, Inc., 0-596-52720-9."

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com.

Safari Enabled

When you see a Safari® Enabled icon on the cover of your favorite technology book, that means the book is available online through the O'Reilly Network Safari Bookshelf.

Safari offers a solution that's better than e-books. It's a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current information. Try it for free at http://safari.oreilly.com.

How to Contact Us

We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (or even that we have made mistakes!). As a reader of this book, you can help us to improve future editions by sending us your feedback. Please let us know about any errors, inaccuracies, bugs, misleading or confusing statements, and typos that you find anywhere in this book.

Please also let us know what we can do to make this book more useful to you. We take your comments seriously and will try to incorporate reasonable suggestions into future editions. You can write to us at: