Book + Content Update Program
Ubuntu Unleashed 2017 Edition is filled with unique and advanced information for everyone who wants to make the most of the Ubuntu Linux operating system. This new edition has been thoroughly updated by a long-time Ubuntu community leader to reflect the exciting new Ubuntu 16.04 LTS release with forthcoming online updates for 16.10, 17.04, and 17.10 when they are released.
Former Ubuntu Forum administrator Matthew Helmke covers all you need to know about Ubuntu 16.04 installation, configuration, productivity, multimedia, development, system administration, server operations, networking, virtualization, security, DevOps, and more—including intermediate-to-advanced techniques you won’t find in any other book.
Helmke presents up-to-the-minute introductions to Ubuntu’s key productivity and Web development tools, programming languages, hardware support, and more. You’ll find new or improved coverage of navigation via Unity Dash, wireless networking, VPNs, software repositories, new NoSQL database options, virtualization and cloud services, new programming languages and development tools, monitoring, troubleshooting, and more.
- Configure and customize the Unity desktop
- Get started with multimedia and productivity applications, including LibreOffice
- Manage Linux services, users, and software packages
- Administer and run Ubuntu from the command line
- Automate tasks and use shell scripting
- Provide secure remote access and configure a secure VPN
- Manage kernels and modules
- Administer file, print, email, proxy, LDAP, DNS, and HTTP servers (Apache, Nginx, or alternatives)
- Learn about new options for managing large numbers of servers
- Work with databases (both SQL and the newest NoSQL alternatives)
- Get started with virtualization
- Build a private cloud with Juju and Charms
- Learn the basics about popular programming languages including Python, PHP, Perl, and new alternatives such as Go and Rust
- Learn about Ubuntu’s work toward usability on touchscreen and phone devices
In addition, this book is part of InformIT’s exciting Content Update Program, which provides content updates for major technology improvements! As significant updates are made to Docker and Azure, sections of this book will be updated or new sections will be added to match the updates to the technologies. As updates become available, they will be delivered to you via a free Web Edition of this book, which can be accessed with any Internet connection. To learn more, visit informit.com/cup.
How to access the Web Edition: Follow the instructions inside to learn how to register your book to access the FREE Web Edition.
Introduction xxxiiiLicensing xxxiv
Who This Book Is For xxxv
Those Wanting to Become Intermediate or Advanced Users xxxv
Sysadmins, Programmers, and DevOps xxxvi
What This Book Contains xxxvii
Conventions Used in This Book xxxviii
PART I: GETTING STARTED
Chapter 1 Installing Ubuntu and Post-Installation Configuration 1Before You Begin the Installation 1
Researching Your Hardware Specifications 2
Installation Options 2
32-Bit vs 64-Bit Ubuntu 4
Planning Partition Strategies 5
The Boot Loader 5
Installing from DVD or USB Drive 6
Step-by-Step Installation 6
Installing 7
First Update 13
Shutting Down 13
Finding Programs and Files 14
Software Updater 15
The sudo Command 18
Configuring Software Repositories 19
System Settings 21
Detecting and Configuring a Printer 22
Configuring Power Management in Ubuntu 22
Setting the Time and Date 23
Configuring Wireless Networks 24
Troubleshooting Post-Installation Configuration Problems 26
References 27
Chapter 2 Background Information and Resources 29What Is Linux? 29
Why Use Linux? 31
What Is Ubuntu? 33
Ubuntu for Business 33
Ubuntu in Your Home 35
Getting the Most from Ubuntu and Linux Documentation 35
Ubuntu Developers and Documentation 36
Websites and Search Engines 37
Web Search Tips 37
Google Is Your Friend 37
Ubuntu Package Listings 38
Commercial Support 38
Documentation 39
Linux Guides 39
Ubuntu 40
Mailing Lists 40
Ubuntu Project Mailing Lists 41
Internet Relay Chat 42
PART II: DESKTOP UBUNTU
Chapter 3 Working with Unity 43Foundations and the X Server 43
Basic X Concepts 44
Using X 45
Elements of the xorg.conf File 46
Starting X 51
Using a Display Manager 51
Changing Window Managers 52
Using Unity, a Primer 52
The Desktop 53
Customizing and Configuring Unity 58
Power Shortcuts 60
References 61
Chapter 4 On the Internet 63Getting Started with Firefox 63
Checking Out Google Chrome and Chromium65
Choosing an Email Client 66
Mozilla Thunderbird 66
Evolution 67
Other Mail Clients 68
RSS Readers 69
Firefox 69
Liferea 69
Internet Relay Chat 70
Usenet Newsgroups 72
References 74
Chapter 5 Productivity Applications 75Introducing LibreOffice 76
Other Office Suites for Ubuntu 78
Working with GNOME Office 78
Working with KOffice 80
Other Useful Productivity Software 80
Working with PDF 80
Working with XML and DocBook 81
Working with LaTeX 82
Productivity Applications Written for Microsoft Windows 83
References 83
Chapter 6 Multimedia Applications 85Sound and Music 85
Sound Cards 86
Adjusting Volume 87
Sound Formats 88
Listening to Music 89
Graphics Manipulation 92
The GNU Image Manipulation Program 93
Using Scanners in Ubuntu 94
Working with Graphics Formats 95
Capturing Screen Images 97
Other Graphics Manipulation Options 97
Using Digital Cameras with Ubuntu 98
Handheld Digital Cameras 98
Using Shotwell Photo Manager 98
Burning CDs and DVDs in Ubuntu 99
Creating CDs and DVDs with Brasero 99
Creating CDs from the Command Line 100
Creating DVDs from the Command Line 102
Viewing Video 104
TV and Video Hardware 104
Video Formats 105
Viewing Video in Linux 106
Personal Video Recorders 107
Video Editing 107
References 109
Chapter 7 Other Ubuntu Interfaces 111Desktop Environment 112
KDE and Kubuntu 113
Xfce and Xubuntu 114
LXDE and Lubuntu 115
GNOME3 and Ubuntu GNOME 116
MATE and Ubuntu MATE 117
Ubuntu Kylin 118
References 118
Chapter 8 Games 121Ubuntu Gaming 121
Installing Proprietary Video Drivers 122
Steam 123
Installing Games in Ubuntu 123
Warsow 124
Scorched 3D 124
Frozen Bubble 125
SuperTux 126
Battle for Wesnoth 126
Frets on Fire 127
FlightGear 128
Speed Dreams 129
Games for Kids 129
Commercial Games 129
Playing Windows Games 130
References 130
PART III: SYSTEM ADMINISTRATION
Chapter 9 Managing Software 133Ubuntu Software 133
Using Synaptic for Software Management 134
Staying Up-to-Date 137
Working on the Command Line 138
Day-to-Day Usage 138
Finding Software 141
Using apt Instead of apt-get 142
Compiling Software from Source 143
Compiling from a Tarball 143
Compiling from Source from the Ubuntu Repositories 144
Configuration Management 145
dotdee 145
Snappy Ubuntu Core 146
Using Snaps 146
References 147
Chapter 10 Command-Line Beginner’s Class 149What Is the Command Line? 150
Accessing the Command Line 151
Text-Based Console Login 152
Logging Out 153
Logging In and Out from a Remote Computer 153
User Accounts 154
Reading Documentation 155
Using Man Pages 156
Using apropros 156
Using whereis 157
Understanding the Linux File System Hierarchy 157
Essential Commands in /bin and /sbin 158
Configuration Files in /etc 159
User Directories: /home 159
Using the Contents of the /proc Directory to Interact with the Kernel 160
Working with Shared Data in the /usr Directory 161
Temporary File Storage in the /tmp Directory 162
Accessing Variable Data Files in the /var Directory 162
Navigating the Linux File System 162
Listing the Contents of a Directory with ls 162
Changing Directories with cd 164
Finding Your Current Directory with pwd 165
Working with Permissions 165
Assigning Permissions 166
Directory Permissions 167
Altering File Permissions with chmod 168
File Permissions with umask 169
File Permissions with chgrp 170
Changing File Permissions with chown 170
Understanding Set User ID, Set Group ID, and Sticky Bit Permissions 170
Setting Permissions with Access Control Lists 171
Working with Files 173
Creating a File with touch 173
Creating a Directory with mkdir 173
Deleting a Directory with rmdir 174
Deleting a File or Directory with rm 175
Moving or Renaming a File with mv 175
Copying a File with cp 176
Displaying the Contents of a File with cat 177
Displaying the Contents of a File with less 177
Using Wildcards and Regular Expressions 177
Working as Root 178
Understanding and Fixing sudo 178
Creating Users 181
Deleting Users 182
Shutting Down the System 182
Rebooting the System 183
Commonly Used Commands and Programs 183
References 184
Chapter 11 Command-Line Master Class Part 1 185Why Use the Command Line? 186
Using Basic Commands 187
Printing the Contents of a File with cat 188
Changing Directories with cd 189
Changing File Access Permissions with chmod 191
Copying Files with cp 191
Printing Disk Usage with du 192
Using echo 193
Finding Files by Searching with find 193
Searches for a String in Input with grep 196
Paging Through Output with less 197
Creating Links Between Files with ln 199
Finding Files from an Index with locate 200
Listing Files in the Current Directory with ls 200
Listing System Information with lsblk, lshw, lsmod, and lspci 202
Reading Manual Pages with man 203
Making Directories with mkdir 204
Moving Files with mv 204
Renaming Files with rename 204
Deleting Files and Directories with rm 205
Sorting the Contents of a File with sort 205
Printing the Last Lines of a File with tail 207
Printing the Location of a Command with which 207
Download Files with wget 207
References 208
Chapter 12 Command-Line Master Class Part 2 209Redirecting Output and Input 209
stdin, stdout, stderr, and Redirection 211
Comparing Files 212
Finding Differences in Files with diff 212
Finding Similarities in Files with comm212
Limiting Resource Use and Job Control 213
Listing Processes with ps 213
Listing Jobs with jobs 214
Running One or More Tasks in the Background 215
Moving Jobs to the Background or Foreground with bg and fg 215
Printing Resource Usage with top 216
Setting Processes Priority with nice 218
Combining Commands 219
Pipes 219
Combining Commands with Boolean Operators 221
Running Separate Commands in Sequence 222
Process Substitution 222
Using Environment Variables 222
Using Common Text Editors 226
Working with nano 227
Working with vi 227
Working with emacs 229
Working with sed and awk 230
Working with Compressed Files 232
Using Multiple Terminals with byobu 233
Polite System Reset Using REISUB 234
Fixing an Ubuntu System That Will Not Boot 235
Checking BIOS 235
Checking GRUB 235
Reinstalling GRUB 235
Using Recovery Mode 236
Reinstalling Ubuntu 236
Tips and Tricks 236
Running the Previous Command 236
Running Any Previous Command 237
Running a Previous Command that Started with Specific Letters 237
Running the Same Thing You Just Ran with a Different First Word 237
Viewing Your History and More 237
Doing Two or More Things 237
Using Shortcuts 238
Confining a Script to a Directory 238
Using Coreutils 239
Reading the Contents of the Kernel Ring Buffer with dmesg 239
References 240
Chapter 13 Managing Users 241User Accounts 241
The Super User/Root User 242
User IDs and Group IDs 244
File Permissions 244
Managing Groups 245
Group Listing 245
Group Management Tools 246
Managing Users 248
User Management Tools 248
Adding New Users 250
Monitoring User Activity on the System 251
Managing Passwords 252
System Password Policy 252
The Password File 253
Shadow Passwords 254
Managing Password Security for Users 256
Changing Passwords in a Batch 256
Granting System Administrator Privileges to Regular Users 257
Temporarily Changing User Identity with the su Command 257
Granting Root Privileges on Occasion: The sudo Command 259
Disk Quotas 262
Implementing Quotas 262
Manually Configuring Quotas 263
Related Ubuntu Commands 264
References 264
Chapter 14 Automating Tasks and Shell Scripting 265Scheduling Tasks 265
Using at and batch to Schedule Tasks for Later 265
Using cron to Run Jobs Repeatedly 268
Using rtcwake to Wake Your Computer from Sleep Automatically 270
Basic Shell Control 272
The Shell Command Line 273
Shell Pattern-Matching Support 274
Redirecting Input and Output 275
Piping Data 276
Background Processing 277
Writing and Executing a Shell Script 277
Running the New Shell Program 279
Storing Shell Scripts for System-Wide Access 279
Interpreting Shell Scripts Through Specific Shells 280
Using Variables in Shell Scripts 281
Assigning a Value to a Variable 282
Accessing Variable Values 282
Positional Parameters 282
A Simple Example of a Positional Parameter 283
Using Positional Parameters to Access and Retrieve
Variables from the Command Line 284
Using a Simple Script to Automate Tasks 284
Built-In Variables 286
Special Characters 287
Using Double Quotes to Resolve Variables in Strings with Embedded Spaces 288
Using Single Quotes to Maintain Unexpanded Variables 288
Using the Backslash as an Escape Character 289
Using the Backtick to Replace a String with Output 289
Comparison of Expressions in pdksh and bash 290
Comparing Expressions with tcsh 295
The for Statement 299
The while Statement 300
The until Statement 302
The repeat Statement (tcsh) 303
The select Statement (pdksh) 303
The shift Statement 304
The if Statement 304
The case Statement 305
The break and exit Statements 307
Using Functions in Shell Scripts 307
References 308
Chapter 15 The Boot Process 311Running Services at Boot 311
Beginning the Boot Loading Process 312
Loading the Linux Kernel 314
System Services and Runlevels 315
Runlevel Definitions 315
Booting into the Default Runlevel 316
Understanding init Scripts and the Final Stage of Initialization 316
Controlling Services at Boot with Administrative Tools 317
Changing Runlevels 318
Troubleshooting Runlevel Problems319
Starting and Stopping Services Manually 319
Using Upstart 319
systemd 320
Boot Repair 322
References 322
Chapter 16 System-Monitoring Tools 323Console-Based Monitoring 323
Using the kill Command to Control Processes 325
Using Priority Scheduling and Control 326
Displaying Free and Used Memory with free 327
Disk Space 328
Disk Quotas 329
Checking Log Files 329
Rotating Log Files 331
Graphical Process and System Management Tools 333
System Monitor