Linux Made Simple 2015
Linux Made Simple 2015
148
pages of advice
from the makers of
TMS09 2015
EDITORIAL TEAM
CONTRIBUTORS
ART EDITORS
EDITOR
Fraser McDermott
Efrain Hernandez-Mendoza
Alex Cox
EDITOR-IN-CHIEF
Graham Barlow
IMAGES
MANAGEMENT
MARKETING
CIRCULATION
MARKETING MANAGER
Nial Ferguson
Richard Stephens
Juliette Winyard
Phone +44(0)7551 150984
Nick Merritt
LICENSING
GROUP EDITOR-IN-CHIEF
PRODUCTION MANAGER
Paul Newman
Mark Constance
PRODUCTION CONTROLLER
Steve Gotobed
Vivienne Turner
Regina Erak
regina.erak@futurenet.com
Phone +44(0)1225 442244
Fax +44 (0)1225 732275
SUBSCRIPTIONS
UK reader order line & enquiries: 0844 848 2852
Overseas reader order line & enquiries: +44 (0)1604 251045
Online enquiries: www.myfavouritemagazines.co.uk
PRINTED IN THE UK BY
William Gibbons on behalf of Future.
Distributed in the UK by Seymour Distribution Ltd,
2 East Poultry Avenue, London EC1A 9PT. Phone: 020 7429 4000
5FM
#BUI
Welcome!
Linux might seem intimidating, but youve come
to the right place if you want to get started.
Every time I come to
write an introduction to
one of these guides, I
seem to relate a story
of how Ive ruined
something by being
unprepared. This guide
is no different. My first
experience with Linux was one of
desperation: I really had to try it, being an
unabashed computer nerd, and when I
finally got my hands on an early copy of
Mandrake Linux in a box, on a real
CD-ROM! I set to installing it without
thinking. I didnt need that software or
those documents, it seems. I also didnt
need a working computer, clearly, as
Linux wasnt particularly friendly when it
came to compatibility at the time.
Things have changed. Modern Linux
distributions tend to work first time with
How are we doing? Email techbookseditor@futurenet.com and let us know if weve lived up to our promises!
Get Started
Hardware
10
What is Linux?
47
Build a Linux PC
21
56
Install on a Chromebook
31
Escape Windows
60
40
Switch from XP
64
Raspberry Pi 2 hands on
Software
In-Depth
Projects
Do something perfectly
practical with your new
Linux knowledge
73
128
84
132
Try a microkernel OS
90
98
110
Archiving
112
114
Terminal tricks
116
User accounts
118
Built-in help
Get Started
What is Linux?
Get into Linux
Escape Windows
Switch from XP
10
21
31
40
.................................................................................................................................
.....................................................................................................................................
......................................................................................................................
.........................................................................................................................
What is
Linux?
Theres... a penguin? And
something called a distro? Dont
worry: weve got the answers.
What is an OS?
What is a distro?
A
The kernel
So much hardware is
supported, with no need
to download drivers
Boot sequence
The mysterious sequence of flashes and beeps at startup.
file it may need, plus other settings such as the root partition,
and whether to hide all this behind a splash screen. If you
want to see what happens from here on, you can disable the
splash screen on most distros by pressing the [E] key to edit
the Grub menu entry, removing any quiet and splash options
and pressing [F10] to continue booting.
Removing the
boot splash
screen shows
the boot process
in its entirety,
including the
status of the
services being
started.
Newer options
Time moves on, and all of these systems are subject to
change. On the latest hardware, the BIOS has been replaced
by UEFI, although once the bootloader is installed you wont
AUDIO TECHNICA
ATH-MSR7
Escape to a world of
high resolution audio
HELPING YOU
MAKE THE MOST
OF LIFE IN TODAYS
CONNECTED WORLD
SAMSUNG JS9000
Relax with the latest
home entertainment
CARL ZEISS VR
Embrace a new era of
virtual reality gaming
SONY XPERIA Z3
Putting you in control
of your life and home
APPLE WATCH
Your health and
tness upgraded
Libraries
Package managers
The great flexibility of Linux distributions means that most
elements can be changed. Default applications, desktops,
even kernels can be swapped around, so its best to think of
a Linux distribution such as Fedora or Ubuntu as merely a
starting point for any customisation that you want to do.
The one thing that cant be changed so easily is the
package manager, so the only way to try a different package
manager is to try a different distro. Try comparing SUSEs
Yast with Debians Synaptic, for example, and youll be
amazed at the difference that such a fundamental tool can
make to your experience of using Linux.
Graphics
How your Linux box stays looking so tickety-boo.
Legacy features
This may seem excessively complex, but it uses local sockets
to communicate between the clients and server, so there is
no significant performance hit. One clear advantage of this
method is that the client and server do not have to be running
on the same computer. You can connect to another computer
by SSH and, providing the configuration gives permission for
this, run a program on the remote computer and have its GUI
displayed on your local screen.
This is different from the likes
of VNC because only the one
applications window is
displayed locally, and it only
appears locally not on the
remote computer. A VNC
connection mirrors the whole desktop on both computers.
Some consider the client/server architecture to be overly
complex, so there are moves to develop more simple
methods of running a graphical display. The most advanced is
Wayland. This takes a different approach; not only is the old
client/server setup gone, but Wayland leaves the rendering of
windows and other display elements to the client
applications, usually using OpenGL and Cairo. This simplifies
Wayland; X contains a lot of legacy rendering code thats
required by the X specification but never used. By giving
control to the clients, Wayland can be lighter, more efficient
and future-proof. It also means your graphical software has
more control over how the GUI is displayed.
Tools such as
KDEs monitor
settings help
with things like
setting up dual
monitors, but for
a single display
you shouldnt
need to configure
X at all.
Daemons
If you ever disable the splash screen most distros
use to cover the boot messages, you will see a
screen full of information about services being
started. What are these services, and are they all
necessary? The services are the programs that
run in the background, making the computer as
useful as it is. Some deal with networking, others
handle hardware detection and configuration,
while more are the traditional software services,
or daemons, that provide functions to other
programs when needed.
The answer to the second part of that question is
most likely to be no. While some of these
services are used by almost all systems, such as
the syslog daemon that handles writing
information to system log files, others may not
be needed. There is no need to start CUPS, the
printing system, if you dont have a printer
available. Similarly, the MySQL database server
may not be needed, nor the SSH daemon if you
Networking
How your computer talks to others.
Storage
Storing data on a hard disk can involve several layers in
itself. All physical storage (as opposed to network
storage) in Linux revolves around block devices, so called
because disks store data in blocks. A block device like
/dev/sda1 does indeed refer to blocks, physical areas on
the disk, and a collection of them as a disk partition. On
top of that we have a filesystem, which is how the data is
stored in a sensible structure of directories and files,
containing both data and metadata.
Whats the difference? Lets say you save a file
containing some text. The data in that file is the text, but
the file has other attributes: there is the owner of the file,
the time they created it, the time they last modified it,
the time it was last read and who has permission to read
or modify it. This is the information you see when you ls -l
a file, or inspect its properties in your file manager, and
this is stored by the filesystem. The standard filesystem
in use nowadays is ext4, but there are alternatives such
as ext3, ReiserFS, XFS, JFS and, of course, FAT and NTFS
from the world of Windows.
Other Linuxes
Everything we have covered relates to Linux
running on desktops, laptops and servers
traditional computer hardware if you like, but
there are other environments where Linux is
used. Many embedded devices, from routers to
PVRs and set-top boxes, run Linux, and in many
ways its similar to the Linux we know and love. If
Desktops
Gnome, KDE Cinnamon, Unity well just call it the user interface.
Software collections
A desktop environment is simply a more or less
integrated collection of utilities to provide the features
needed to run a complete desktop. Running
programs, manipulating their windows, keeping
track of what is going on and enabling programs to
communicate with one another are all features of
desktop environments, but they still have a
window manager at their heart KWin for KDE
and Metacity in Gnome to name but two.
What sets a desktop environment apart from
a window manager is the level of integration. This is
Gnome, KDE,
Unity, Cinnamon,
Mate we
arent exactly
short of choice
when it comes
to desktop
environments,
but how many of
you have tried
more than
a couple?
Sound
A once thorny subject.
PulseAudio performance
PulseAudio is a newer audio framework, but it is not a
replacement for ALSA. Instead, it sits on top of the kernel
audio system, providing a greater amount of control. It works
as a server, accepting input from sources and forwarding it to
sinks (output hardware or capture software). In many cases,
the sink is ALSA, and the source can be an ALSA driver, too,
for applications that dont directly support PulseAudio. Hence
Taking care
of printers with
CUPS is as easy
as following a
few links in a
browser, thanks
to its built-in
web interface.
Printing
CUPS and drivers.
If anyone tries
to tell you that
PulseAudio is
complicated,
its best not
to argue with
them. Not that
the complexity
of this layout
matters too
much if it just
works for you.
www.techradarpro.com
twitter.com/techradarpro
facebook.com/techradar
Linux
Curious about Linux but not sure
how to traverse this unfamiliar
territory? Well help you get
started so you can join the
growing ranks of Linux users and
get a better PC to boot.
heres never been a better
time to get into Linux. Its
slicker than ever, easier to
install than ever and all the
big-name distros like Ubuntu have
just received updates.
One of the biggest impediments to
Ubuntu
The most commonly known Linux
distribution (often abbreviated to distro),
Ubuntu pays special attention to desktop usability.
In the 10 years of its existence, Ubuntu has galvanised
the development of Linux on the desktop and is the
go-to distro for third-party developers and vendors who
want to run their wares on Linux.
Fedora
Red Hats open source offering to the world,
Fedora is known for adapting and offering
new technologies and software to its users. Over the
years, the distro has managed to find a clever balance
between offering new features and stability to its users,
which makes it popular with both new and experienced
Linux campaigners.
Mageia
Although its just had four releases to date,
Mageia has a pedigree in usability that dates
back to the 1990s. Mageia is a community project thats
supported by a non-profit organisation, which is
managed by a board of elected contributors. The distro
is known for its customised user-friendly tools for
managing the installation.
Get into
Linux magazine
OUT
NOW!
Shrink Windows
Unity in diversity
The Ubuntu distribution uses its own home-brewed Unity
desktop. The most prominent component on the desktop is
the vertical Launcher which functions pretty much like a
taskbar. It houses icons for the frequently used apps for quick
access that you can modify as per your requirements. Also,
some icons have specialised right-click context menus that
give you quick access to frequently used features.
Gnome thyself
Gnome is another popular desktop, and the Gnome 3
desktop contains more or less the same elements as
Ubuntus Unity but presents them in a different way. For
starters the desktop is very bare. Click on the Activities button
in the top-left corner to reveal the Overview which is very
similar to Unitys Dash. In this view, you also get a Launcherlike Favourites bar for accessing frequently used apps.
In the centre you get a preview of all open windows. To the
right is the Workspace Switcher, which always shows the
current Workspace and an additional one. If you add windows
Users of
Gnome-based
distros should
use the Gnome
Tweak Tool
to tweak the
behaviour of
their desktop.
31 flavours
In addition to these three chief desktop environments, there
are a lot more that you can put atop your distro. There are
fully fledged environments, such as Cinnamon, as well as
lightweight ones, such as Xfce, LXDE and Mate. In fact, most
mainstream distros, including Ubuntu, Fedora and Mageia are
available in multiple editions with a different desktops.
For example, the Ubuntu distro has a number of officially
supported spins. Theres Kubuntu which dresses Ubuntu with
KDE as well as a Gnome spin, a Xfce spin and another that
uses the Mate desktop. The Fedora distro, which was once
known as the premier Gnome distro, now also has a
wonderful KDE flavour as well. Similarly, you can also use
Mageia with the Gnome desktop as well. In fact, Mageia and
Fedora, also have install-only DVD images that give the user
the option to install multiple desktops.
A backup primer
Your distribution will include a tool to help
you backup your data and you should
take some time out to get familiar with it.
Ubuntu, for instance, ships with the Deja
Dup backup app which is designed for
new users. You can also install it on top of
Fedora and Mageia.
No matter what backup tool you use,
you should take a moment to consider
what you should backup and where.
Backing up the entire home directory
might be convenient but is usually just an
overkill. Instead you should just include
the directories under your home directory
such as Downloads and Documents.
FedEx packages
All major desktop distros include a graphical tool for
managing packages. Ubuntus Software Center is one of the
best tools for the job. You can find software by clicking on the
category reflecting the type of software that youre looking
for. When you select a category, you will be shown a list of
apps. Theres also a search box in the upper-right corner of
the window which will look for software matching any entered
keywords. Once youve found the software you want, click the
Install button to its right. This will fetch the software as well as
any required dependencies and automatically install it.
All newly installed software is added to the Launcher and you
can also find it from under the Dash.
Fedora uses the PackageKit graphical tool thats listed as
Software in the Gnomes Activities menu. It too lists software
categories as well as a keyword-matching search box at the
top to help you find software. Once youve found the software
that youre looking for, click on the Install button and the app
will add it to your installation.
The graphical package management tool for Mageia is
named Drakrpm. The tool isnt as pretty as the software
centres in Ubuntu and Fedora, but is very functional and
intuitive enough to get the job done. You can filter its list of
available apps to show only packages with GUI, security
updates, bug fix updates, and more. Applications groups are
listed in the sidebar and theres also a search box to hunt for
packages based on keywords. When you find a package you
wish to install, simply toggle its corresponding checkbox and
click on Apply.
Most desktop
distros have
an easy to
use graphical
package
manager.
Grabbing Google
All popular Google software, such as Chrome,
Earth, the audio and video plugin for Hangouts
and others can be installed on Linux. But you
wont find them in the official repos of major
distros because of their licensing. However, you
now have all the know-how to install them with
ease if we point you in the right direction.
The downloads page of each supported
Google app contains links to both 32-bit and
64-bit versions of the software in both RPM and
Deb formats. Download the package for your
Mageias
Welcome app
is a wonderful
utility to setup
the distro for all
kinds of users.
You can tweak Linuxs Grub bootloader with the GrubCustomizer tool (ppa:danielrichter2007/grub-customizer).
still install the out-of-date Flash plugin and continue using the
Firefox browser. Or, you can extract the newer Pepper-based
Flash plugin from the Chrome browser and use it on
Chromes open source cousin, the Chromium browser.
Ubuntu users can install Flash for Firefox with the
sudo apt-get install flashplugin-installer
command. If youre using Chromium, you can use the latest
Pepper Flash plugin by installing the pepperflashpluginnonfree package.
Fedora users can download the Firefox plugin from
Adobes website by adding its repo. If you are running a 64-bit
installation, this command:
yum -y install http://linuxdownload.adobe.com/adoberelease/adobe-release-x86_64-1.0-1.noarch.rpm
will download and install the correct repo. You can then
import the key for the repo with:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
before installing the plugin with:
yum -y install flash-plugin
Mageia users can simply enable the nonfree repository
which houses the Flash plugin and then install it from the
Applications tab in the Welcome app.
While distros do
come with open
source games
in their repros,
Steam offers
access to AAA
gaming titles like
Dying Light.
www.gizmodo.co.uk
twitter.com/GizmodoUK
facebook.com/GizmodoUK
Escape Windows
WITH
FREE
DIGITAL
EDITION
Select backup
odern PCs, particularly those with Windows 8 preinstalled, have replaced the traditional BIOS with
a new system called UEFI. Both perform the same
job, detecting and initialising your hardware before
handing it over to your OS, but UEFI represents a quantum
leap forward from the somewhat primitive capabilities of
the traditional BIOS. The UEFI offers a much wider range
of features than that found in the BIOS, all wrapped up in a
much more user-friendly, graphically pleasing interface.
There are, however, potential issues to circumvent. First,
because UEFI is a newer standard, its not compatible with
legacy hardware. This problem is circumvented by a special
Compatibility Support Module (CSM), which enables you to
emulate the BIOS to run older hardware and OSes.
More controversially, UEFIs also ship with a Secure Boot
mode, which, while making PCs less susceptible to malware,
were used to lock them to Windows 8. Again, this feature can
in most cases be disabled, but the good news is that
Ubuntu 14.04 LTS fully supports newer hardware and Secure
Boot, so you wont need to disable either to install it alongside
Check your
UEFI shells
boot settings
to see whether
Legacy, UEFI or
mixed mode
is selected.
Verify and x
The main distinction for former Windows users trying out the Unity desktop
environment for the first time will be the position of the launch bar.
programs. To make the change complete, follow the step-bystep guide above to point your Ubuntu user folders to the
same location. We recommend following the advice given and
leaving the Ubuntu desktop folder alone. Once done, test that
the tweaks work by opening Nautilus and clicking the
Documents shortcut in the left-hand pane, which should
now point to your data partition.
To access your network, open a folder window and youll
see network options on the left of the screen. Click Browse
Network to find other computers theres a handy Windows
Take a backup of your dual-boot system using Redo for extra security.
Repositories
Although you can download programs from websites, its far
easier to use the centralised Software Center. Ubuntu
provides its own software repository, which is a server
containing hundreds of Linux programs specially compiled to
work with Ubuntu. This means any software you find in the
Software Center should work without problems, which makes
it a little like having your very own Linux app store. The Center
also looks out for program updates, alerting you when theyre
available and installing them for you.
Youre not restricted to one app store sorry, repository
either; install a program such as Dropbox from its own
website, for example, and itll add its own repo to the Center,
enabling it to alert you when updates are available.
To manage these repos, open Software Center and select
Edit > Software Sources. A list can be found under the Other
Software tab, where you can manually add your own.
So far weve not dealt with Terminal, which is Linuxs
equivalent of the Windows command prompt. While its
technically possible to avoid this, if you want to make the
Ditch XP and
switch to Linux
Linux can be a bit scary for newbies, so were on hand to demonstrate how to
swap dusty old Windows XP for sparkly Linux Mint.
Distro divas
As weve mentioned, weve based this guide on
whats available on the accompanying cover disc,
but theres no reason you cant substitute these
options with your own choices. In some
circumstances, this could be for compatibility. A
32-bit lightweight option (such as www.
puppylinux.com at 161MB or www.bodhilinux.
com at 613MB) may well be the only real choices
For repartitioning, were going with the allpowerful SystemRescueCD distro, which is on
the cover disc. It might be overkill for a basic
repartitioning job, but its always handy to have
around. You might want to consider the more
direct Gparted Live distro at 175MB from
www.gparted.org, which boots directly into a
graphical desktop with Gparted ready for action.
Gpart it
Boot the system from the cover disc and select SystemRescueCD, or
create and boot your own. Select the default boot the alternatives
will help solve potential problems you might experience. Select the
default keyboard and type startx at the final command prompt. This
will fire up the default Windows environment.
Move it
Grab the right-hand handle and resize that partition, youll want the
free space to read at least 8,096MB ideally this should be a lot more.
Youll see over the page how you can still access your Windows XP
partition, so you dont have to worry about things there. Click Resize/
Move to make the selection, but nothing will happen yet.
Install it
Reboot and switch to Linux Mint. Select Install Mint and youll see
a familiar install system. Itll eventually ask to install Linux Mint
alongside Windows XP. Accept and youre on your way. Just like with
Windows, you will need a username, network PC name and a decent
user password to protect your admin aka root access.
Resize it
You need to start GParted. This is the icon on the bottom-left, or you
can just type gparted into the open terminal. What you see next
depends on the complexity of the host systems partition structure.
It could be a single partition, or it could be several. You need to rightclick on the one that has the most unused space.
Create it
Now youve found some space for your Linux partition, were ready to
go. You wont need to partition or format this space. The installer were
about to follow will identify this as where it should install itself. To apply
these changes, click the Apply All Operations button. Depending on
the amount of stuff, this can be a quick or slow process.
Boot it
It wont take long to install Mint and download the latest updates from
the internet. Once in, you should find Linux Mint to be a pretty similar
experience to the long outdated XP, except it will be far more secure
and most importantly it is still supported as an operating system.
See over the page for all your replacement Linux programs.
Bye-bye, Windows XP
Ditch XP part 2
So youve made the switch from Windows XP to Linux. But how do you make
sure you can open all your documents and carry on using your PC?
Ta-dah! Linux
Mint at your
service and
isnt it nice?
Linux replacement
Microsoft Office
MS Paint
Windows Photo
Gallery
Windows Movie
Maker
Windows Media
Player
iTunes
Brasero (https://wiki.gnome.org/Apps/Brasero#download).
Burning files to a rewritable DVD or CD is made incredibly easy with
this user-friendly disc burning software.
WinZip
Adobe Acrobat
Reader
Hardware | Introduction
Hardware
Build a Linux PC
Install Linux on a Chromebook
Build a Steam machine
Raspberry Pi 2 hands on
47
56
60
64
........................................................................................................................
.......................................................
.......................................................................................
.................................................................................
Hardware | Introduction
BUILD A
LINUX PC
Assembling a PC is
straightforward,
but choosing the
components is less
so. We look at the
options available.
www.lifehacker.co.uk
twitter.com/lifehackeruk
facebook.com/lifehackeruk
Processor
The first decision to be made is which
processor to use, as this affects your choice of
motherboard and then just about everything
else. The choice may seem obvious: get the
fastest you can afford, but things are never
that simple. The fastest processors are also
the most expensive, often by a substantial
Linux compatiblity
Hardware support in Linux is very good nowadays. Most devices are
supported directly in the kernel. There is no need to go trawling
manufacturers websites for drivers. When you are buying components
for your own computer, you need to know whether theres support for the
hardware before you buy a component. The first step is to determine the
exact component in use, which is not as easy as it sounds. The
motherboard makers website may state it has a Gigabit Ethernet port,
but not tell you which chipset, so you will have to do some research.
Typing the full product code and the word Linux into your favourite
search engine will normally give plenty of hits. Its worth restricting your
search to recent posts, there is no point reading complaints about your
choice not being supported a year ago when it is now. Look for posts that
give details, such as chipset codes and module names and avoid the
Motherboard
If the processor is the heart of your computer,
the motherboard is the central nervous
Memory
Memory is one of the simplest ways to boost
the performance of a modern computer.
It enables more tasks and data to be handled
at once and any memory thats left over is
used by the Linux kernel to cache disk data
which, incidentally, is why your computer
shows almost no memory free after it has
been running for a while. There are three
things to consider when buying memory, the
physical layout, the size and the speed. The
current memory standard is DDR3 and DDR4.
Dont try to fit the older DDR or DDR2 sticks
into these slots, they are incompatible. Size is
obvious, and it is worth getting the most your
budget allows. Check your motherboards
manual for the maximum size for each slot
because, although the spec allows for up to
16GB per DIMM, most Intel systems are
limited to 8GB per unit. Motherboards usually
use a dual-channel architecture for memory,
Terminology
You will encounter plenty of abbreviations and
jargon when looking at hardware, here are
some of the common terms used:
DDR 2/3/4 Double Data Rate, a technology
using in memory chips.
DIMM Dual Inline Memory Module, this is
plug-in memory module.
WAF Wife Acceptance Factor, seen on maledominated forums and considered important
for hardware that will be in the home.
Storage drives
It used to be that the only question to ask
about a hard drive was: How big? Now we
have to add: How many? And what type?
The choice of type is mainly between
traditional hard drives with spinning platters
and solid state drives (SSDs). (Although there
are also hybrid drives that use a spinning disk
with an SSD as a cache.) SSDs are much
faster than hard drives but cost a lot more per
gigabyte, a 256GB SSD costs about the same
as a 3TB drive. So an SSD gives much faster
booting and program loading but a hard drive
holds much more. An SSD also uses less
power and is more robust, making it the
obvious choice for a laptop. With a desktop,
you have the luxury of being
able to use more
than one
Graphics card
Most motherboards have reasonable onboard
graphics these days, so you may not need a
separate card. If you want one, the choice is
between Nvidia and AMD, and this is another
topic likely to provoke religious flamewars.
Nvidia graphics cards will work as far as
booting the computer into a graphical display,
but the in-kernel nv drivers are limited.
You have a couple of options. The newer
open source nouveau drivers work well now
we use them ourselves and give reasonable
performance. If you want the best
performance from your graphics card though
you will need to install Nvidias own drivers.
As these are closed source they are often not
enabled by default so you need to enable the
option for restricted or third-party drivers in
your distro. You can also download and
Motherboard layout
Lift the release lever on the CPU socket, insert the CPU aligning the
corner dot on the chip with the mark on the socket. It should drop in
with no pressure, then lock it with the lever. Remove the tape from
the conductive pad on the heatsink and fit it over the CPU, following
the instructions that came with the CPU and motherboard. Connect
the fan cable to the motherboard.
Case
Power supply
One of the most overlooked components is
the power supply (PSU). Avoid the cheap
PSUs that are included with cases (in fact,
avoid cases that are cheap enough to include
a PSU). A PSU must be reliable and good
quality. That may seem an obvious statement
that applies to all components, but when a
PSU fails it can do so in a way that takes out
other components. Having a 100
motherboard or hard drive, or both
components, wrecked by a 15 PSU is not a
good way of saving money.
Other aspects to consider when choosing
a PSU are: that it must supply sufficient power
for your needs, now and in the future, that it is
Memory slots
Specialised systems
So far we have looked mainly at a general
purpose desktop system, but there are some
specialist users to consider, such as a home
server or a high-performance gaming
systems. If you want to build a home server,
your requirements will be very different from a
desktop or gaming system.
As all data is transferred over the network,
a fast SSD is pointless. You could use one for
the operating system, but servers are rarely
rebooted, so you wouldnt even benefit from
the fast boot speed they offer, and they only
run a limited number of programs, so loading
time is not that important either. Servers
generally run headless, so a fancy graphics
Motherboard backplate
Fit the motherboards I/O plate to the opening in the back of the
case and then place the motherboard in the case. There are small
posts that it should stand on, you may need to screw them into the
case before going ahead and fitting the motherboard. Then secure
the motherboard to the posts with the supplied screws do not
overtighten them.
High-performance gaming
Gaming, and we mean the graphically
intense kind and not gambling, places
specific
requirements
on a computer.
Performance is
the obvious factor,
but not
just
the
performance of the CPU.
The GPU on the graphics card
plays a more important role than
the CPU with some games.
Clearly you want a fast CPU and
graphics
card. Many of the higher
performance graphics cards
take up the space of two PCI-e
slots so you need to make sure
both your computers case and
motherboard have room for it
and that your PSU is capable of
Connectors
Fit the power supply and connect the power and CPU cables to the
motherboard. This is a good time to connect all fan cables. Add your
hard drives or SSDs and your optical drive. They may either screw to
the case or in some cases they have screwless fittings. Connect the
SATA cables from the drives to the motherboard. Connect their
power cables for the PSU.
Case LEDs
Connect the cables from the case switches and LEDs to the
motherboard. These are fiddly connectors but make sure you get
them right, the motherboard manual will tell you what goes where.
Some of the cables come with a block connector to make the job
easier. This is also the time to connect the cases USB ports to the
relevant points on the motherboard.
Sealed systems
Assembling a desktop or server computer is a
fairly straightforward task, creating your own
laptop isnt. While its possible to buy laptops
piecemeal, its not the usual way of doing
things. Still, much of what we have covered in
this feature still applies. It is just as important
to choose suitable components for a laptop;
even more so really because you cannot
Graphic card
Fit your graphics card into the PCI-16 slot. Check its documentation
to see if it needs an external power feed or whether it gets all the
power it needs from the PCI slot. Fit any other PCI cards you may be
using at the same time. Many new power supplys (PSU) offer
modular cable systems, else adaptors are available if your PSU is
missing suitable connectors, but ensure its powerful enough.
Keep your cables tidy, even if you dont have a window in the case.
Untidy cables will disrupt airflow and make life harder the next time
you try to add or replace a component. If your case doesnt have
clips to hold cables out of the way, small cable ties do a very good
job of it. You can also often feed cables behind the motherboard tray
or inside the hard drive fixtures.
Careful now
Building a PC isnt difficult, but
some care is needed when
working with electronic
components. Prepare a large
working area, clear of any clutter
and with a non-conductive
surface. Static electricity can kill
electronic components, and it can
build up on your body without you
noticing, until you pick up a
component and zap it. You can
avoid this by earthing yourself to
discharge and static build up. The
simplest way to do this is to touch
Testing, testing
Install
Linux
on your new
Chromebook
For those whove bought a Chromebook and miss a full operating system,
well show you how to get an assortment of Linux distros up and running.
Jargon
buster!
apt-get
The program used
to install software
packages on
Debian, Ubuntu and
other Linux distros.
Shell shocked
LXDE
running on a
Chromebook, but
Chrome OS is
still there.
sh -e ~/Downloads/crouton -r list
sh -e ~/Downloads/crouton -t list 2>&1 | more
The second command needs to be passed to more
because it is several screenfuls; hit [Space] to page through
them all. Once youve decided the release and target you
want, you can run Crouton. To install Ubuntu 13.10 (Saucy
Salamander) with the Unity desktop, for example, run:
sudo sh -e ~/Downloads/crouton -r saucy -t unity
This uses sudo because you need root to install the
software. You can also specify multiple targets, like this
example that installs Debian Wheezy with the LXDE desktop
and the XBMC media centre:
sudo sh -e ~/Downloads/crouton -r \wheezy -t lxde,xmbc
Unity is perfect
for running
everything in
full-screen.
Jargon
buster!
chroot
A directory into
which a program is
locked. It cant see
Starting up
Depending on the target(s) selected and the speed of your
internet connection, this could take a while. When it has
finished, it tells you the command needed to start your
chosen distro in the chroot, such as:
sudo startunity
Run that command and you will be in a standard Ubuntu
desktop. When youve finished, log out in the usual way and
you go back to Chrome OS. You can switch between the two
by holding [Ctrl]+[Alt]+[Shift] and pressing [Forward] or
[Back]. In fact, the Chrome OS navigation keys above the
numeric row are treated as [F] keys by Linux, so these are
really [Ctrl]+[Alt]+[Shift]+[F1] and [Ctrl]+[Alt]+[Shift]+[F2].
The installation you end up with is not the complete distro
as you would get installing it natively, but any extra packages
can be installed in the usual way. If using Unity, the Software
Centre is not installed, so open a terminal in Unity
([Ctrl]+[Alt]+[T]) and run:
sudo apt-get update
sudo apt-get install software-center
Now you can install any other packages you need from the
GUI. You can also install extra target environments with the -u
flag. For example, to add the LXDE environment to the
Ubuntu chroot we created before, we would run:
sudo sh -e ~/Downloads/crouton -r saucy -u -t lxde
Quick
tip
When trying
multiple distros
or targets, clean
out any you have
finished with. At
several GB each,
your storage will
soon disappear.
Install a release
Open a shell
The default targets include only the command line package manager,
apt-get. For most people, the first step is to open a terminal and use it
to install a more friendly option, such as software-center for Ubuntu or
Synaptic for Ubuntu or Debian. Run sudo apt-get update to make
sure you get the current version, then sudo apt-get synaptic.
Running Crouton with -t list will show you all the available targets.
Youll probably want one of the standard desktop environments.
Chromebooks are relatively low-powered, and a lightweight desktop
such as LXDE is a good choice, while Unity is better suited to running
everything full-screen.
Run Synaptic
Once you have Synaptic installed, you have easy access to all the
software in a distros repository. Most of the targets are slimmed down,
to save on downloads and give a faster installation, but you can install
anything you want from here. Either use the Search button or just
browse the categories to see what is available.
Back up to USB
After downloading, the image is written to your USB stick. If you dont
create a recovery disk, its also possible to get this image from another
computer and copy it manually, by following the instructions at http://
google.com/chromeos/recovery, but you have to make sure you get
the right image they are specific to each model.
In case of emergency
Recovery disks
Hardware | Steam
Hardware | Steam
Hardware | Steam
Peripherals
So you've built an amazing, yet compact,
Steam Machine and loaded up SteamOS. Now
what? You'll want to get some great gaming
peripherals for comfy gaming from your sofa.
Valve itself has been working on a dedicated
Steam controller with the lofty ambition that it
will combine the convenience of a game
controller with the precision of a keyboard and
mouse setup. It's certainly a tall order and one
that Valve appears to have struggled with as
the controller has been delayed until late 2015.
While we wait for Valve's official controller,
which will cost $50, a number of other
Dying Light
Borderlands 2
This fun and frantic first
person shooter makes a
post apocalypse world
seem like a lot of fun. Play in
co-op mode with friends.
Amnesia: The
Dark Descent
Broken Age
The Witcher 2:
Assassins of Kings
An epic tale of monsterslaying and alchemy, The
Witcher 3 is coming soon,
but play this first.
Big Picture Mode makes launching games on a TV with a games controller quick and easy.
Hotline Miami 2:
Wrong Number
Supreme League
of Patriots
Chivalry: Medieval
Warfare
The Fall
Dungeons 2
The Binding of
Isaac: Rebirth
This is a randomly
generated action RPG
shooter with Rogue-like
elements. If you dont
understand what we just
said, all you need to know
is that its a lot of fun.
Papers, Please
Goat Simulator
Hardware | Steam
Hardware | Pi 2 Hands On
Raspberry Pi 2
Hands-on with the
Quick
tip
The default web
browser for
Raspbian, Midori
has recently been
replaced with
Epiphany which
has been optimised
for use on the
Raspberry Pi.
The new browser
is available via the
latest Raspbian
update and works
really well on
Raspberry Pi 2 and
older Pis.
Ubuntu on Pi?
The biggest surprise brought about by the new
Raspberry Pi 2 is compatibility with Ubuntu for
ARM 7 CPU. Before the original Raspberry Pi
was released in early 2012, Ubuntu was often
mentioned as a candidate for the Pi, but as
Canonical didnt support the ARM 6 architecture,
which the ARM 11 CPU used in the original Pi,
another distro was needed. Early on we saw
Pidora, a fork of Fedora for the Pi, being used to
demonstrate the power of the Pi. But Pidora
Hardware | Pi 2 Hands On
Hardware | Pi 2 Hands On
Quick
tip
Watching YouTube
videos is now
possible thanks
to Youtube_dl.
Normally YouTube
videos are Flash
based but there are
no Flash packages
for Raspbian. When
watching a YouTube
video in the web
browser, Youtube_dl
substitutes the
Flash element
of the web page
with an HTML5
compliant video.
Compatibility
The performance is reflected in the choice of CPU for the
Raspberry Pi 2. Rather than choose another architecture the
Foundation has stuck with an ARM-based CPU that is
compatible with the ARM11 found in the earlier Raspberry Pi.
The quad-core ARM7 can run software written for the older
Raspberry Pi: Raspbian works out of the box, but requires a
new v7 kernel, which will be included in the downloads from
our website said Eben.
As for hardware compatibility, the Raspberry Pi 2 shares
the same GPIO as the B+, which means that boards made
for the A+ and B+ will also work with the Raspberry Pi 2 and
this even includes HAT boards (Hardware Attached on Top),
which contain an onboard chip that communicates with the
Raspberry Pi to set up the board quickly.
There are some boards, however, that are not compatible
with the B+ and the Raspberry Pi 2 due to their size and
design. Boards such as PiFace [see LXF180] and PiFace
Control and Display that was used to control a camera rig
for the Royal Institution Christmas Lectures cannot be
3D graphics test
Every Raspberry Pi comes with the same VideoCore IV GPU
(Graphical Processing Unit) that enables the Raspberry Pi to
play back high-definition video at 1080p. The new PI also
comes with this GPU, also made by Broadcom just like the
BCM2836 powering the new Pi. Did you know that theres a
test suite for the GPU?
You can find the test suite by opening LXTerminal and
typing the following:
cd /opt/vc/src/hello_pi/
In there you will find a number of directories containing
many different demos. But before we can use them we need
to build the demos from source, and to make this easier the
Foundation have provided an automated build script that will
only need to run once. To run the script, in LXTerminal type
./rebuild.sh
This build script will run the build process for all of the
demos so it may take a few minutes, even on our new
speedy Raspberry Pi.
Once completed there are a number of demos that you
can try out and the first on the list should be hello_teapot.
To run it, in LXTerminal make sure that you are still in the
hello_pi directory and type:
cd hello_teapot
./hello_teapot.bin
You will now see a 3D render of a teapot with video thats
been directly rendered on to its surface. To exit out of the
teapot demo hold Control+C together and you will be
returned to LXTerminal.
Another demo to try is hello_triangle2 and to getto that
Quick
tip
The Raspberry Pi
2 shares the same
dimensions as the
B+ but for those
of you looking to
reuse a B+ case,
such as the Pibow,
its worth noting
that some surface
mount components
have been moved.
These changes
dont affect the
overall size of the
board but as the
Pibow uses layers
to build, a new layer
will be required for
your Pibow.
Updating your Pi
The Raspberry Pi Foundation has released
many new updates to the existing Raspbian
install and keeping your Raspberry Pi up to date
is a really good practice. There are a few handy
Terminal commands to help you, such as
sudo apt-get update
which will update the list of installable software.
Using the following
sudo apt-get upgrade
Hardware | Pi 2 Hands On
Hardware | Pi 2 Hands On
Well use the big red button on the Pibrella.com to set off TNT in
Minecraft. The Pibrella fits over the first 26 GPIO pins. Never attach
while the power is on! Use a blob of blu tack or modelling clay to
prevent the underside shorting out the HDMI. Now connect the
other cables as usual, but insert the power into the micro USB port.
Weve created a GitHub repository that contains the code for this
tutorial, visit https://github.com/lesp/Pibrella-Minecraft-TNT
and download a copy. Next open LXTerminal and type
sudo idle
In position
Setup Pibrella
This installs the software that we need to use Pibrella with Python.
With Minecraft ready and our code open, press TAB to release the
mouse from Minecraft and click on Run > Run Module in idle. The
idle shell will come to life and run the code. Switch back to Minecraft
and go to a nice spot. Press the red Pibrella button to drop the
bomb. Hit the TNT with your sword... and then RUN! Note: You can
run this the original Pi, but it could crash Minecraft.
Software
Pick the right distro
Low resource distros
Top 100 Linux tools
Low resource applications
73
84
90
98
..........................................................................................................
..................................................................................................
........................................................................................................
..........................................................................
Software | Introduction
SERIOUS ABOUT
HARDWARE?
NOW ON
APPLE
NEWSSTAND
&
GOOGLE PLAY
Download the
day they go
on sale in the
UK!
PICK A DISTRO
TECHNOLOGY. TESTED.
www.techradar.com
twitter.com/techradar
facebook.com/techradar
Even the
most popular
distribution for
the Raspberry
Pi called
Raspbian, is
based on the
Debian Project.
Rules of engagement
Another distinguishing aspect of Debian is that the distro is
made entirely of free software. The project uses the Debian
Free Software Guidelines (DFSG) to help
determine whether a piece of software can
be included. The DFSG is part of the Debian
Social Contract which defines the moral
agenda of the project.
The project produces three distros:
Stable, Testing and Unstable. A Stable
release is available every two years and is made by freezing
the Testing release for a few months. Testing is designed to be
the preview distro with newer packages and during the freeze
any bugs are fixed and extremely buggy packages are
removed. All releases are named after characters from the
Toy Story films (the current Stable release is codenamed
Wheezy). All new packages are introduced in the Unstable
release (codenamed Sid). This distro is for developers who
require the latest packages and libraries. Its not intended to
be used on a production machine and those interested must
upgrade Debian Testing to get the latest Unstable.
BEST
OF
BREED
Genus Debian
Genus Ubuntu
Derivatives, theyre coming outta the walls.
buntu is, in many respects, the first distro to make a
serious effort to bring in new users. The distro
brought Linux into the mainstream, played a
significant part in changing the notion and misconceptions
about Linux and was able to successfully pitch itself as a
viable OS alternative to Windows and Mac OS.
Ubuntu was started by Mark Shuttleworth. He formed
Canonical after selling his security-firm, Thawte, to VeriSign.
Shuttleworth was a huge fan of the Debian project. However,
there were many things about Debian that didnt fit in with
Shuttleworths vision of an ideal OS. He therefore invited a
dozen or so Debian developers he knew and respected to his
flat in London in April 2004 and hashed out the groundwork
for the Ubuntu project.
The group decided on a bunch of characteristics for the
distro. For one, Ubuntus packages would be based on those
from Debians unstable branch. However, unlike Debian,
Ubuntu was to have a predictable cycle with frequent
releases. To put the plan into action, it was decided that
Ubuntu would release updated versions every six months and
each release would receive free support for nine months.
The plan was refined in later years and now every fourth
release receives long-term support (LTS) for five years.
The group also decided to give emphasis to localisation
and accessibility in order to appeal to users across the world.
There was also a consensus on concentrating development
A number of
vendors, such
as Dell and
Lenovo, offer
computers
pre-installed
with Ubuntu.
BEST
OF
BREED
Test by fire
But perhaps no other piece of technology has polarised the
Linux community like Ubuntus Unity desktop interface. The
distro first introduced Unity with the Ubuntu Netbook Edition
version 10.10. By the time 11.04 rolled off the press, the
Netbook Edition had merged into the desktop edition and
Unity became the default graphical interface for the Ubuntu
distro. However, Shuttleworth has insisted that the Unity
desktop plays a crucial role in Ubuntus multi-device strategy.
Unity will help standardise the display on smartphones,
tablets, TV and other devices beyond the computer.
Thanks to its malleable nature, the distro has always been
very popular with developers who want to create a custom
distro for their particular niche. Ubuntu has perhaps seeded
more distros than any other, and Ubuntu itself has several
officially-supported spins: Kubuntu, Xubuntu, Ubuntu Gnome,
Edubuntu and Ubuntu Studio. In addition to the main desktop
edition, theres also a server edition that doesnt ship with a
graphical desktop.
Ubuntu has helped give Linux mainstream coverage and
has several celebrity users, including Cory Doctorow and
Stephen Fry. However, pushing the envelope has its
drawbacks and the award-winning distro has had its fair share
of brickbats. Its still reeling under the Amazon controversy
that arose when the distro included search results from the
shopping giant in Unitys Dash whenever users searched for
stuff on their computer.
Trisquel GNU/Linux
Trisquel GNU/Linux goes to great
lengths to do justice to its free
software tag. Not only does the distro
not include any proprietary software,
it also strips out all non-free code from
the components it inherits from
Ubuntu, such as the kernel. Instead of
the stock Ubuntu kernel, Trisquel uses
the Linux-libre kernel that doesnt
include any binary blobs. Thanks to its
BEST
OF
BREED
Red Hat
has served as
the starting
point for
several other
distros, such
as Mandriva
Linux.
CentOS
The CentOS distro has been the
premier community-supported
enterprise distro based on Red Hat
Enterprise Linux (RHEL). The distro is
built using the open source SRPMS
from the RHEL distro. CentOS is one of
the most popular server distros,
suitable for all kinds of use cases, from
web servers to enterprise desktops,
and has been able to pitch itself as an
Genus Fedora
Youve been hit by a smooth distro.
edora has been around, in one form or another, since
the early 1990s. The distro had its first release in
1995 and the early releases were named Red Hat
Commercial Linux. During these early years, the distro was
developed exclusively by Red Hat and the community was
limited to contributing bug reports and contributing
packages included in the distro. This changed in 2003
when the company shuttered Red Hat Linux in support of
the Fedora Project and opened it up to contributions from
the community.
The aim of Fedora is to provide the latest packages while
maintaining a completely free software system. The distro
was initially called Fedora Core and was named after one of
the two main software repositories Core and Extras.
The Fedora Core repo contained all the basic packages
required by the distro as well as other packages distributed
with the installation discs, and was maintained exclusively by
Red Hat developers. The Fedora Extras repo was introduced
with Fedora Core 3. It contained packages maintained by the
community and was not distributed with the installation
discs. This arrangement continued until version 7 in 2007
when the two repos were merged and the distro was renamed
as Fedora.
Fedoras objective is to create a free software distribution
with the help of the community. The development of the
project is overseen and coordinated by the Fedora Project. Its
Fedora was
one of the
first distros
to embrace
the Security
Enhanced
Linux
(SELinux)
kernel module.
BEST
OF
BREED
Korora
The Korora distribution started out as
a way to ease the installation process
of the Gentoo distro, but switched to
using the Fedora distro as the base in
2010. The main aim of the distro is to
make sure it works right out-of-the box
for users.
Korora ships a live DVD, which
includes a huge selection of apps that
make it suitable for a large number of
On life support
Mandrake Linux was first released in July 1998. It was based
on Red Hat Linux 5.1 and featured the inaugural KDE desktop
release. After the positive response, lead developer Gal
Duval, along with a bunch of others, created the company
MandrakeSoft and in 2001 the company decided to go public.
It faced its first major cash issue in late 2002 and asked its
users to bail it out by subscribing to a paid service offering
extra benefits, such as early access to releases and special
editions. That wasnt enough and the company filed for
bankruptcy protection in 2003. However, later that year
MandrakeSoft announced its first quarterly profit and, in
March 2004, a French court approved its plan to emerge from
bankruptcy and return to normal operations.
BEST
OF
BREED
Rosa Linux is
a Mageia fork
that features
some dramatic
user interface
mods such as
this Simple
Welcome app
launcher.
Salix Mageia
Mageia is one of the best-assembled
community distros and does a
wonderful job of carrying forward the
Mandrake legacy. It has an expansive
support infrastructure and very good
documentation. The distro follows a
nine-month release cycle and each is
supported for 18 months. Mageia has
installable live media as well as installonly DVD images.
Genus Mandrake
Genus SUSE
Nuga, nuga, nuga, gnu, nui.*
n 1992 Roland Dyroff, Burchard Steinbild, Hubert
Mantel and Thomas Fehr founded Software und System
Entwicklung (Software and Systems Development).
The company started as a service provider but the
founders decided to have a distro of their own to cater to
the enterprise user. The distro was named SUSE, based on
the acronym of their company. The distro was a stock
Slackware release translated in German and developed in
close collaboration with Slackwares Patrick Volkerding.
For building its very own distribution of Linux, SUSE used
the now defunct Jurix distribution. Jurix was created by
Florian La Roche, who subsequently joined the SUSE team
and began to develop YaST, which is the distros unique
installer and configuration tool. The first SUSE distro that
included YaST was released in May 1996 (Yast was rewritten
in 1999, and was included for the first time in SUSE Linux 6.3
as an installer only).
Over time, SUSE Linux has incorporated many aspects of
Red Hat Linux, such as its well-respected RPM Package
Manager. In 1996, the first distribution under the name SUSE
Linux was published as SUSE Linux 4.2. The confusing jump
forward in version numbers was an intentional reference and
homage to the answer to life, the universe and everything, as
featured in Douglas Adams The Hitchhikers Guide to the
Galaxy. YaSTs first version number, 0.42, was inspired by the
same admiration for the author.
The SUSE
Studio web
service enables
you to easily
put together
a customised
OpenSUSEbased distro.
Enterprising
The initial stable release from the OpenSUSE Project was
SUSE Linux 10.0. It included both open source and
proprietary applications, as well as retail boxed-set editions.
This was also the first release which treated the Gnome
desktop environment on a par with SUSEs default KDE
desktop. As of version 10.2, the SUSE Linux distribution was
officially rechristened as OpenSUSE.
In November 2006, Novell signed an agreement with
Microsoft covering improvement of SUSEs inter-operability
with Windows, cross-promotion and marketing of both
products, and patent cross-licensing. This agreement is
considered controversial by some of the FOSS community.
Novell was later acquired by The Attachmate Group in
2011, which then divided Novell and SUSE into two separate
subsidiary companies. SUSE offers products and services
around SUSE Linux Enterprise a commercial offering that is
based on OpenSUSE Linux.
SUSE develops multiple products for its enterprise
business line. These products target corporate environments
and have a longer lifecycle (seven years, extendable to 10),
a longer development cycle (two to three years), technical
support and certification by independent hardware and
software vendors. SUSE Linux Enterprise products are only
available for sale. Theres also the SUSE Linux Enterprise
Desktop (SLED) which is a desktop-oriented operating
system designed for corporate environments. In contrast,
OpenSUSE does not have separate distributions for servers,
desktops and tablets, instead using various installation
patterns for different types of installation.
*http://bit.ly/ChameleonSong
BEST
OF
BREED
OpenSUSE
OpenSUSE is one of the best RPMbased distros. It comes in several
editions for 32-bit and 64-bit
architectures and also has ports for
ARM v6, ARM v7, and the 64-bit ARM
v8. Once known for its KDE desktop,
OpenSUSE now looks good across all
the major desktops. Besides KDE and
Gnome, the distro also features Mate,
Xfce, Enlightenment, and LXDE. You
BEST
OF
BREED
In addition
to Slackwarestable, the
project also
provides a
testing-current
branch for
more bleedingedge software.
Salix OS
Salix OS is one of the best Slackwarebased distros: its light, nimble and
backwards compatible with Slackware.
One of its salient features is that it
minimises bloat by having only one
application per task. The distro
supports both 32-bit and 64-bit
architectures and is available in five
variants for the KDE, Mate, Xfce,
Openbox, and Ratpoison desktops.
Genus Slackware
Arch Linux
Judd Vinet wanted to create a distro that was inspired by the
simplicity of Crux, Slackware and BSD and thus created Arch
Linux in 2002. Arch aims to provide a lightweight foundation
on which the user can build according to their needs. In
Vinets words: Arch is what you make it. A bit like life really.
Puppy Linux
Tiny Core Linux is an ickle distro at 12MB. Ah, sweet.
SliTaz GNU/Linux
SliTaz stands for Simple Light Incredible Temporary
Autonomous Zone and had its first stable release in 2008.
The distro is built with home-brewed tools known as cookutils
and uses BusyBox for many of its core functions. The distro
includes a mixture of the LXDE and OpenBox window
manager and is designed to perform on hardware with only
192MB of RAM. The distro weighs under 30MB and uses a
mere 80MB of hard disk space.
The distro also has a bunch of custom tools such as the
Tazpkg package manager and SliTazPanel for administering
all aspects of the distro. SliTaz repos include over 3,000
packages for every popular open source app and its a
common option for powering low-powered machines.
PCLinuxOS
PCLinuxOS began life as a repository of RPM packages for the
Mandrake distro in 2000 and became a distro in late 2003 as a
branch of Mandrake Linux 9.2.
Although it retains a similar look and feel to Mandriva Linux,
and its configuration tool and installer give away its Mandriva
lineage, PCLinuxOS has diverged significantly.
The distro has replaced Mandrakes URPMI package
management system, opting instead for APT-RPM. This is
based on Debians APT but uses RPM packages, together
with the Synaptic package manager. PCLinuxOS is a KDE
distro, but also has community spins around the LXDE and
Mate desktops.
Mageia
OpenSUSE
Korora
TOP
DESKTOP
DISTRO
Low-resource distros
Do low-resource Linux desktops for the average
user still exist? We test five less well known
distributions that are fast and not so furious to use.
Our
selection
Absolute Linux
Crunchbang2
Elive
Manjaro
Puppy
How we tested...
We did not consider Lubuntu and other
light Ubuntu spin-offs, simply because
they are the ones that most Linux
novices who need a low-resource distro
are more likely to know already. After a
lot of investigation, we chose one distro
with a truly unique architecture (Puppy)
and four that are lightweight derivatives
of more popular systems, namely
Slackware, Arch Linux and Debian. We
then ran them live on a low-end laptop
and/or installed them in virtual
machines with different RAM sizes, but
never more than 2GB. In all cases, we
tested the systems with ordinary dayto-day desktop activities, from browsing
and using office suites to displaying
photographs. We also tried some of the
usual system administration tasks, from
installing software to adding users and
changing the general system
configuration.
Verdict
Absolute
+++++
Crunchbang
+++++
Elive
+++++
Manjaro
+++++
Puppy
+++++
Elive has the
fullest set of
apps, but others
can pretty much
do it all too.
Installation
Is it easy to get started with these systems?
Absolute Linuxs installer makes you ask what year it is but isnt hard to use.
Verdict
Absolute
+++++
Crunchbang
+++++
Elive
+++++
Manjaro
+++++
Puppy
+++++
Absolutes
installer is basic
but Elives is the
one thatll make
novices happy.
Desktop completeness
User interface
Is it customisable, attractive, but not too resource-hungry?
Absolute +++++
Absolute uses the IceWm window manager to give you a fast and
discreet desktop. A right-click on the root window, which by default
would launch the tool to change wallpaper and screen resolution, can
be set to open the system menu.
The file manager is SpaceFM; not state of the art by any means, but
adequate for all basic tasks. Of all the distros in this roundup, Absolute is
perhaps the one that looks more like a basic Linux of 15 years ago. Just
for this reason, however, it may be perfect for many users, especially
when you consider that its just a first sight impression you do get a
modern browser (Chrome) and office suite (Libre Office), and often
thats all that counts, isnt it?
Crunchbang +++++
The first time you start it, Crunchbang is all business and no frills. All
you see is a visually dull but well configured OpenBox window manager
with two workspaces, a system monitor and the list of shortcut keys.
However, changing the wallpaper if a solid grey screen really bothers
you is a quick and easy job.
One right-click on the root window opens a menu with apps for all
desktop tasks. That menu, plus the Terminator terminal emulator and
the Thunar file manager, let you work with the mouse or keyboard very
efficiently. Crunchbang is also the distro most interested, so to speak, in
working in the cloud with common tools; the system menu includes
entries to start Google Docs and install the Dropbox client.
Documentation
Verdict
Absolute
+++++
Crunchbang
+++++
Elive
+++++
Manjaro
+++++
Puppy
+++++
All have OK
documentation.
In Manjaro and
Absolute its
easier to reach.
Manjaro
+++++
Puppy +++++
Slacko 5.7, the member of the Puppy pack were looking at in this
context, is at the time of writing the recommended first stop for all
newcomers to the Puppy family. Its user interface is the result of a
careful mix of the JVM window manager, the ROX Filer and many big and
small apps, from household names such as Firefox to really obscure
utilities. The System sub-menu even has a floppy disk formatting utility,
together with the GParted partition manager.
We dont understand the rationale behind separate sub-menus for
Document, Business and Personal applications, but there they are.
This said, JVM and ROX work well together, and ROX is one of those
apps that every Linux user should try at least once fast, simple and
cute. Lean and mean doesnt mean ugly or lacking in features.
Choices
What if the version tested here is almost what you want?
Verdict
Absolute
+++++
Crunchbang
+++++
Elive
+++++
Manjaro
+++++
Puppy
+++++
For variants,
go to Manjaro.
To build your
own, try Woof
Puppy Builder.
Elive +++++
Elive is a great showcase for the Enlightenment desktop. In the 90s,
when it appeared, people (including us) would have rolled on the floor
laughing if told that one day Enlightenment would be a low-resource
choice. Today, we can testify that Elive gives the best compromise
between visual effects and performance on limited hardware.
The system monitor, with its gauges for battery charge, CPU
temperature and power policy, is attractive as well as useful, and there
are enough apps, including the Unison file synchronisation tool. If you
have the patience to configure it, everything will look just as you want,
from the font of window titles to sticky notes. Before that, though, turn
off the fading and zooming effects if youre really short of RAM.
System administration
From hardware configuration to file management, how hard is it to manage?
Verdict
Absolute
+++++
Crunchbang
+++++
Elive
+++++
Manjaro
+++++
Puppy
+++++
GUI-based
config tools (but
maybe not ones
you expect) are
available in all.
Puppys .3fs saver, Manjaros Pacman configurator, and Absolute Control Panel.
Verdict
Absolute
+++++
Crunchbang
+++++
Elive
+++++
Manjaro
+++++
Puppy
Elive uses the Synaptic interface, as
on Debian, Ubuntu and other distros.
+++++
Elive offers
the easiest app
management; it
uses standard
Debian tools.
The verdict
T
1st Elive
+++++
3rd Manjaro
+++++
2nd Crunchbang
Elive makes it easy to love and use Linux, even if all you
have is a five-year-old (or even older) computer.
+++++
+++++
+++++
Over to you...
Did we overlook your favourite little low-resources distro? Email your
opinions to lxf.letters@futurenet.com
Also consider...
This roundup isnt just for those who need to
keep old hardware up and running. Even if
youre satisfied with the performance of your
current Linux desktop, why not try alternatives
that may be even faster?
You should try Puppy Linux at least once, to
get a taste of what Linux desktop development
may have been. However, while Puppy is in a
Low-resource distros
TOP 100
LINUX TOOLS
Take a stroll through the open
source garden as we picks
the best apps, tools and utilities
available to all Linux kind.
With
70
Raspberry Pi
top apps!
Gufw
Thunderbird
KeepassX
Wine
Remmina
ith Remmina you can access a
remote computer from the
comforts of your desktop. It supports the
widest range of protocols and will connect
to all kinds of remote desktop servers.
The app is easy to use, and has enough
features that make
it a viable option
for occasional use.
http://remmina.
sourceforge.net
VLC
Distros ship with a
functional video player.
But if you need more
control, theres no beating
VLC. It supports virtually
every video and audio
format out there and
includes handy CLI tools
for advanced users.
www.videolan.org/vlc
BleachBit
VirtualBox
hen Wine doesnt cut it
you can use VirtualBox to
run an entire Windows installation inside a
virtual machine. The software is also
useful for installing experimental apps
that you dont want to deploy on a real
computer, and for testing other OSes
without exposing it to real hardware.
www.virtualbox.org
Clonezilla
OpenSSH
PeaZip
PeaZip is a graphical
archiving tool that can
work with over 130
different types of archive
files and can even create
encrypted ones. It
integrates with popular
desktops and also has a
CLI for advanced users.
http://bit.ly/PeaZipSF
Gparted
Use Gparted to
restructure a disk on your
computer. Its available as a
live CD and can also be
installed inside your distro.
Gparted can create, resize,
move, delete, reformat or
check partitions and
supports many filesystems.
www.gparted.org
ZuluCrypt
Create an
encrypted
disk within a
file or within a non-system
partition or USB disk.
ZuluCrypt has an intuitive
user interface and can be
used to encrypt individual
files with GPG.
http://bit.ly/zuluCrypt
HomeBank
This is a featurerich finance app. It can
import data from other
apps and bank statements
in popular formats. It can
also detect duplicate
transactions and features
dynamic reports and is
easy to use for budgeting.
http://homebank.free.fr
Essential apps
Internet apps
Midori
Firefox
RSSOwl
FileZilla
gFTP
he gFTP client is a feature-rich client
thatll get the job done, if you need to
download files via FTP occasionally. It has
a simple two-pane interface that shows
the content of the local and remote
filesystem. Using gFTP you can also
transfer files between two remote servers.
http://gftp.seul.org
Tox
Games
Jitsi
0 A.D.
This is a real-time
civilisation-building
strategy game that
features impressive
graphics and intense
battle gameplay. Its yet
to have a final release but
has already won accolades
in its current state.
http://play0ad.com
Deluge
Pidgin
Aria2
hat makes Aria2 a unique utility is
that it can download the same file
at the same time using different protocols.
The lightweight CLI app can download via
HTTP, FTP, BitTorrent and Metalink and
can also open multiple connections to
download the file faster.
http://aria2.sourceforge.net
FreeCiv
Another strategy game
that challenges players to
lead their tribe 4,000B.C
to the space age.
www.freeciv.org
Alien Arena
A popular first
person shooter with a scifi theme and the
tournament style
deathmatch of Quake and
Unreal Tournament. The
game has several game
modes and over 60 maps,
and is quite configurable.
http://red.planetarena.org
OpenMW
OpenMW is a new game
engine that recreates the
popular Morrowind RPG.
The aim of the project
isnt to improve game
assets or add additional
features but to provide
gamers a more moddable
edition of the game.
https://openmw.org
FlightGear
For fans of aircraft
simulators theres
FlightGear that aims to
offer flight across real
world terrain. It includes
scenery for more than
20,000 airports, and can
be extended with your
own aircraft and locations.
www.flightgear.org
Zathura
GnuCash
nome users have GnuCash which
is similar to KMyMoney in terms of
features, but also handles and categorises
entries differently. GnuCash is a personal
and small business accounting app thats
based on double-entry for professional
reporting and
besides dealing
with monetary
transactions, it
can track things
such as stocks,
bonds and
mutual funds.
www.gnucash.org
This is a web-based
resource management
tool with a simple
interface for accessing its
CRM, HRM and project
management and
planning tools. You can
also track resources
across multiple projects.
www.achievo.org
KMyMoney
AbiWord
he wide gap between rich
text editors and word
processors is occupied by
AbiWord. Its lightweight but still offers
commonly-used word processing features,
which makes it a popular for lightweight
distros. It also offers cloud-based
collaboration capabilities via its AbiCollab.
net service.
ProjectLibre
Calibre
OpenLDAP
Xournal
Achievo
Gnumeric
Okular
The default PDF
viewer for KDE and
includes a good number of
useful features. Besides
PDF it can also read a
number of other file types,
including Postscript, DjVu,
CHM, XPS, ePub, TIFF,
CBR, and others.
https://okular.kde.org
LaTex
Shutter
ClamAV
LaTex is a document
preparation system and
document markup
language based on TeX. Its
purpose is to simplify TeX
typesetting for documents
containing mathematical
formulae and is widely
used in academia.
www.latex-project.org
Hobbyist
Follow your passion.
RawTherapee
OpenShot
Krita
lthough Krita is part of
the Calligra suite it needs
a special mention of its own. Krita is a
digital painting and illustration app that
offers many expressive brushes, HDR
painting, filters, perspective grids, painting
assistants, and many other features youd
expect from such an app.
www.krita.org
Stellarium
tellarium is a free open source
planetarium for your computer.
It calculates the positions of the Sun and
Moon, planets and stars, and draws the
sky as per the users location and time.
It can also draw the constellations and
simulate astronomical phenomena such
as meteor showers, and eclipses.
www.stellarium.org
Inkscape
Media
comprehensive desktop
publishing program.
Scribus can be used to create professional
press-ready online and print documents
including brochures, booklets, books and
magazines. It has a feature-rich interface
and has features, such as PostScript
colour separations, support for CMYK and
spot colours, ICC profiles, and printer
marks. Scribus also includes a variety of
templates and styles and you also get an
array of settings and tools to precisely
define and position the various layout
elements you require.
www.scribus.net
Comix
FontForge
CairoDock
FontForge is a feature-rich
app for creating and
editing fonts and supports
all common font formats.
It can extract information
from a font file as well as
convert from one format
to another, and can be
used for previews.
http://bit.ly/FontForge
CairoDock is a MacOS X
dock-like app. One of its
main advantages over
other docks is that it
doesnt require a
compositing window
manager to work and can
add bling to older lowpowered machines.
www.glx-dock.org
JOSM
Scribus
Cinelerra
Audacity
If you need to work
with audio, you should use
the powerful Audacity
sound editor. You can trim
audio, combine tracks,
and even stack multiple
tracks, as well as export to
a number of formats and
quality settings.
http://bit.ly/AudacityApp
MPD
The Music Player Daemon
is an audio player with a
server-client architecture,
which means you can
control it remotely from
another computer. It plays
audio files, organises
playlists and can maintain
a music database.
www.musicpd.org
Meld
Geany
Eclipse
heres no beating Eclipse,
the most feature-rich IDE.
Although Java is its speciality, Eclipse
supports a range of languages via plugins.
In fact, its plugin marketplace is an
indispensable resource. Eclipse does code
refactoring and you can use it to extract
the selection as a local variable or method.
Since it can target multi-person installs,
it handles version control very maturely
www.eclipse.org
BlueFish
o you develop for the web? Bluefish
is a multi-language editor thats
designed for web developers. It supports
many programming and markup
languages and focuses on dynamic and
interactive websites. It supports code
block folding, unlimited undo/redo,
automatic tag closing, and syntax
highlighting. Another useful feature is the
snippets bar from where you can add the
most common snippets of code for a
variety of languages. Bluefish also has
support for popular open source web
apps such as MediaWiki and Wordpress.
http://bluefish.openoffice.nl
KompoZer
Gimp
APTonCD
Clementine
Icecast
Amarok
If you use KDE your
distro may already include
this music player, Amarok.
It too integrates with
several online audio
services, and its features
include creating dynamic
playlists, bookmarks,
scripting, context view.
https://amarok.kde.org
LMMS
LMMS is digital audio
workstation that produces
music by synthesising
sounds, arranging
samples, and playing
them on a MIDI keyboard.
It also has a song editor
and plugins to simulate
instruments and effects.
www.lmms.io
Kodi
Until recently Kodi
was known as XBMC. Its
an excellent option for
users who wish to turn
their PCs into media hubs.
It plays most kinds of
media files and works with
TVs, IR and bluetooth
remote controls.
www.kodi.tv
Development
Blender
Utilities
Handbrake
Grub Customizer
DOSBox
digiKam
K3b
Terminal
Ncmpcpp
This is a command-line
MPD client thats easy to
use and customisable.
It provides useful features
such as the ability to sort
playlists, song lyrics, item
filtering, fetching artists
info from last.fm, tag
editor and much more.
http://bit.ly/Ncmpcpp
Avidemux
Samba
Samba is a suite of
programs that enables
Linux users to access and
use files, printers and
other commonly shared
resources on a Windows
PC on a network and does
this by supporting the
SMB protocol which.
www.samba.org
EasyStroke
Vokoscreen
rTorrent
Links2
Midnight
Commander
Before the days of
graphical file managers,
real hackers used
Midnight Commander,
known as mc. Its still your
best option if you regularly
find yourself in the console
environmen a lot.
http://bit.ly/MidnightCdr
Qemu
XAMPP
ts is a feature-rich multi-purpose
processor emulator and virtualiser. You
can use it to create virtual machines and
even emulate various hardware
architectures. If you have the right
hardware on tap (a processor with
hardware virtualisation extensions), you
can use Qemu with KVM in order to run
virtual machines at near-native speed.
www.qemu.org
Turnkey Linux
Mondo Rescue
ondo is a unique backup solution
that creates bootable backup and
restoration disks customised for the
system being used. Mondo has a textdriven interface and works with a wide
range of file systems and can use a variety
of media as backup mediums.
www.mondorescue.org
Dj Dup
Mutt
Profanity
Canto
Zentyal
mpg123
This is an MP3
audio player for the
command-line that
supports gapless
playback. Its so good that
its decoding library,
libmpg123 is used by
other audio players for
MP3 playback
www.mpg123.de
FFmeg
One of the most versatile
media conversion utilities,
FFmeg can manipulate
virtually any type of media
file in various ways, such
as changing bitrate,
extract audio, record
streams, extract stream
and much more.
www.ffmpeg.org
Admin tools
Conky
File managers
Files are important, so a functional file manager
is vital. Our first suggestion, then, is somewhat
controversial dont bother with one. Or, more
Terminal emulators/multiplexers
If youre using a desktop environment, then chances are
youre satisfied with the terminal program provided therein.
But there are alternatives, some of them rather good.
Of particular note is rxvt-unicode, which builds on the
venerable Rxvt with features such as unicode support,
transparency (pseudo and true) and support for Xft fonts.
It supports Perl extensions which can provide clickable
URLs and a tabbed interface, although that relies on GTK+2.
Somewhat uniquely, its built around a client server model,
so once the daemon is loaded, opening terminal windows is
both swift and memory-light.
If you want to be really minimal, then you should use st
(Simple Terminal) from http://suckless.org, but it might
come as a surprise that theres no scrollback buffer, and that
you have to edit a file to make the [Del] key work in Bash.
Next, we have the GTK-based Lilyterm, Sakura and Evilvte.
Lilyterm works best with GTK+2, Sakura only with 3, and
Evilvte can work with either 2 or 3. All three have very few
dependencies besides the venerable Gnome VTE library and
offer tabs, transparency and unicode support.
If you want to be
really minimal, then
you should use st
Web browsers
Depending on what youre doing, surfing from the console
might be entirely reasonable for example, if you simply
Dillo squeezes
tabbed browsing
into its tiny footprint
Email clients
Terminator running shellpic, links and mc. You could have done much more
governating this way, Arnold.
Music players
MPD (Music Player Daemon) is a superb program that will
maintain a database of your music collection and play tracks
in response to commands from a (possibly remote) client
program, of which there are many. It is incredibly lightweight,
which means its possible to use it with a ncurses-based
console client such as ncurses (or the even more confusingly
named ncmpcpp) without your CPU even noticing. MPD isnt
shy of features; it plays anything the FFmpeg library
understands (in other words, anything), Spotify and
SoundCloud playlists are supported, and all manner of plugins are available. If you just want a simple ncurses music
player, then your first stop should be Cmus or Herrie.
There are graphical clients for MPD, too, such as Xfmpc
for XFCE and Gimmix, but development seems to have dried
up on most of the other GTK+ ones. On the Qt front, all we
were able to come up with was Cantata. In terms of
standalone applications, there is the superbly-titled
Deadbeef, which uses GTK+2 or 3 and not much else, yet
supports all manner of formats, tag editing, gapless playback
and has many plug-ins available.
Slightly larger, but far from overweight, is the mighty
Audacious, which you can make look like Winamp/XMMS.
Similarly, for Qt check out Qmmp. Speaking of XMMS,
XMMS2 is a client/server project that aims to continue the
legacy of its hugely popular predecessor. Clients catering to
all tastes are available: https://xmms2.org/wiki/Clientlist.
Media players
VLC, the media player of choice for most multiformat fans, remains as reliable as ever, though its GUI does
rely on Qt4. That said, it has all manner of other interfaces
(ncurses, web, remote-control) and can output to a
framebuffer or as ascii art. Snappy is a medium-weight
GTK+3 player which is built on the GStreamer and Clutter
frameworks, but has few other Gnome dependencies and
looks pretty.
And that concludes our summary of diminutive
applications. Hopefully youve found something lightweight
with which to replace something heavy, and have clawed
back some of your precious resources. Even if you have a
powerful computer, theres much to be gained from learning
the tools weve covered here, or others of similar ilk. They can
inspire a more efficient workflow, show you new ways to get
stuff done, and improve your memory through the learning of
keyboard shortcuts.
SpaceFM compiled for GTK2+ with three tabs and a 15MB memory footprint.
GTK+ and Qt: the Bloods and Cripps of the Linux desktop
In-depth | Introduction
In-depth
Terminal basics
Apt-get in action
Disk managment
Archiving
Core terminal programs
Terminal tricks
User accounts
Built-in help
Sysadmin basics
Super-user control
104
106
108
110
112
114
116
118
120
124
.....................................................................................................................
.................................................................................................................
.............................................................................................................
...................................................................................................................................................
.................................................................................
..........................................................................................................................
...........................................................................................................................
.........................................................................................................................................
...............................................................................................................
.......................................................................................................
In-depth | Introduction
Linux Made Simple | 103
Terminal:
Getting started
Theres no need to be afraid of the command line were here to help you with
your first steps into the world of text commands.
It is fast When you know what you are doing, the shell is
much faster for many tasks.
It is repeatable Running the same task again is almost
instant no need to retrace all your steps.
There is more feedback Error messages from the program
are displayed in the terminal.
Help is available Most commands provide a summary of
their options, while man pages go into more detail.
You cant argue with the plus points, but what about the
cons? Well, apart from not giving us pretty screenshots to
brighten up the pages, the main disadvantage of the terminal
is that you need to have an idea of the command you want to
run, whereas you can browse the menus of a desktop system
to find what youre after.
In this tutorial, we will look at the layout of the filesystem
on Linux, and the various commands that you can use to
manipulate it. On the following pages we will cover several
other aspects of administering and using a Linux system
from the command line.
4
5
2
Moving around
Now that we know where everything is, lets take a look at the
common commands used to navigate the filesystem. Before
going anywhere, it helps to know where we are, which is what
pwd does. Many Unix commands are short, often two to
three characters; in this case, pwd is print working directory
it tells you where you are. Many distros set up the terminal
prompt to display the current directory, so you may not need
this command often. Moving around is done with the cd
(change directory) command. Run it with no arguments to
return to your home directory. Otherwise it takes one
argument, the directory to change to.
Directory paths can be either relative or absolute. An
absolute path starts with / so cd /usr/local goes to the
same place wherever you are starting from. A relative path
starts at the current directory, so cd Documents goes to the
Documents sub-directory of wherever you are, and gives an
error if it is not there. That sounds less than useful if you can
only descend into sub-directories, but there are a couple of
special directory names you can use. To go up a directory use
cd .. a single dot is the current directory. There is also a
shortcut for your home directory: ~. Lets say you have
directories called Photos and Music in your home directory
and you are currently in Photos, either of these commands
will move into Music:
cd ../Music
cd ~/Music
You can tell where you are with pwd, but how do you know
what is in the current directory? With the ls command. Used
on its own, it gives a list of files and directories in the current
directory. Add a path and it lists the contents of that directory.
If you want to know more about the files, use the -l (--long)
option, which tells you the size and date of the file, along with
information about ownership and permissions, which we will
look at later.
Here is the
GUI way of
changing file
permissions. You
would need to
do this for each
file you wanted
to change, and
click a separate
box for each
permission.
user files, although it was in the dim and distant past of Unix
and the name has stuck.
/lib and /usr/lib The home of system libraries.
/var Where system programs store their data. Web servers
keep their pages in /var/www and log files live in /var/log.
/home Where users data is kept. Each user has a home
directory, generally at /home/username.
In-depth | Apt-get
Terminal: AptNew to Linux? Then allow us to guide you through your first steps with
apt-get, the powerful command line tool.
Repositories
A repository is a collection of software packages for a distro.
Each major release of a distro will have its own repositories,
and the packages will have been built for and tested with that
release, but a repository is more than a collection of files.
Each repo (as they are usually called) is indexed, making it
easy to find what you want. It can also be quickly checked for
updates for your package manager without any need to visit
websites to check for updates, or the need for software to
phone home to check.
More importantly, each package in a repo is signed with
the repositorys GPG (encryption) key, which is checked when
installing packages. This means you can trust the software
installed from there to be what it says it is, and not some
infected trojan thats been uploaded maliciously.
A repository also makes dependency handling simple. A
dependency is a program that the program you want to install
needs to run, such as a library. Instead of bundling everything
Package management
We have used the term package manager a few times now
but what is it? Basically, this is a program that enables you to
install, update and remove software, including taking care of
dependencies. It also enables you to search for programs of
interest, as well as performing other functions. All distros will
have command line package management tools. You can
access them either by using your systems search and
looking for terminal or using [Ctrl]+[Alt]+[T] in desktops
such as Unity, Gnome or Xfce, even if they also provide a
fancy graphical front end. The main commands are:
apt-get Installs, upgrades and uninstalls packages.
apt-cache This works with the repository index files, such as
searching for packages.
Package management
Install
Search
Update
Less displays
text from any
source from a
file, the output of
another program
or its built-in help
if you manage to
get stuck.
In-depth | Apt-get
get in action
Terminal: Disk
management
We continue our tutorials about using the terminal by explaining how to
manage your disks, partitions and filesystems.
Types of filesystem
There are several different filesystems supported on Linux. A
native filesystem is one that is designed for use with Linux or
other Unix-like systems. The most commonplace of these is
ext4 (along with its predecessors ext3 and ext2 that are still in
Mounting a filesystem
Making the contents of a filesystem available to the OS and
user is called mounting. In Linux, each filesystem is mounted
at a particular point within the filesystem hierarchy, known as
the mount point. The root filesystem, the one containing the
core OS components, is mounted at /, the root of the
filesystem tree. Many distros use a separate partition and
filesystem for the users home directories; it separates the OS
from the users files so you can update, re-install or switch the
OS without affecting your personal files. Users home
directories reside at /home/username, so a separate home
filesystem would be mounted at /home, the mount point for
the home filesystem. This directory must exist on the root
filesystem but is usually empty as soon as the home
filesystem is mounted, its contents appear at /home.
Anything that was there before is no longer visible, but is still
there and will reappear when home is unmounted.
There are three main ways to mount a filesystem: at boot,
manually or automatically. The system filesystems, such as /
and /home, are mounted automatically at boot, using
information stored in the filesystem table /etc/fstab
remember, /etc is where system settings are stored. Here is a
typical fstab entry for mounting the a partition.
/dev/sda2 /home ext4 defaults 0 2
Each filesystems entry is on a single line, with six fields:
1. Device name Linux disks are named sda, sdb and so on,
with the partitions number added to the disks device, so
/dev/sda2 is the second partition on the first disk.
In-depth | Archiving
Tar: Archiving
your files
Archiving contains many mysteries, such as zips and tarballs, but we are on
hand to expand your knowledge of their uses.
Most environments can view the archive contents. Shown above is the result
of double-clicking a tarball in LXDE (the preferred desktop for Raspberry Pi).
Future proofing
We mentioned that Tar can handle any new compression
format that comes along because it passes compression to
another program. There are command line options to do this
automatically for gzip, bzip2 and xz, but what if someone
comes up with a new compressor? Say something like sdc
super-duper compressor? You could create an uncompressed
tarball and then use sdc to compress it, but thats wasteful
and slow, so instead use a pipe:
tar c foo | sdc >foo.tar.sdc
unsdc foo.tar.sdc | tar xv
Here, we use only the --create option with Tar. The lack of
destination causes Tar to send the archive data to standard
output, which is then piped to the sdc compressor program.
The second command reverses the process, decompressing
the archive and sending it to Tar for extraction.
In-depth | Archiving
Compression types
Terminal:
Core programs
Out of the hundreds of different terminal commands available, heres a handy
summary of some of the more useful ones.
Text handling
Text files are all around us, from emails to configuration files,
and there are plenty of commands that deal with them. If you
want to edit a text file, for example, there are a number of
choices, with the two big ones being Emacs and Vi. Both are
overkill if you just want to tweak a configuration file; in this
instance, try nano instead:
nano -w somefile.txt
The -w option turns off word wrapping, which you
certainly dont want when editing configuration files. The
status bar at the bottom shows the main commands for
example, press [Ctrl]+[X] to save your file and exit.
This assumes you know which file you want, but what if
you know what youre looking for but not the name of the file?
In that case, use grep. This searches text files for a string or
regular expression.
grep sometext *.txt
will search all .txt files in the current directory and show any
lines containing the matching text from each file, along with
the name of the file. You can even search an entire directory
hierarchy with -r (or --recursive):
Getting help
The command line may appear a little
unfriendly, but theres plenty of help if you know
where to look. Most commands have a --help
option that tells you what the options are. The
man and info pages are the main sources of
information about anything. To learn all the
options for a program and what they do, run:
man progname
The man pages are divided into numbered
sections. The ones that are most applicable to
using the system are:
1 User commands
Networking
Terminal:
Time-savers
The terminal has a host of handy tricks that will save you time and make your
life easier. Lets introduce a few of the most useful techniques.
Aliases save you typing and enable you to use more memorable command
abbreviations. You choose these yourself, so you have no excuse for forgetting!
Profiles
You can customise your terminal experience with aliases and
custom prompts, but to make them even more convenient,
you need a way of applying these automatically when you
open a terminal. That can be done through your profile, which
is a file containing commands that are read and run whenever
you open a shell session.
There are several locations that are read, the first of which
is /etc/profile, which contains global profile settings. This in
turn runs any files in /etc/profile.d, which makes it easy to
add global settings without touching the default profile. Then
the users profile is read from one of ~/.bash_profile,
~/.bash_login and ~/.profile. Only the first of these files that
exists is run, and any settings in here override those in the
global profile if the same thing is set in both.
The profile is simply a set of shell commands, one per line,
that are run when the shell starts up. These can set up aliases
or environment variables, or set the command prompt. A
typical use of environment variables would be to change the
default text editor to nano:
EDITOR=/usr/bin/nano
Word completion
If you arent a particularly confident touch typist, youll soon
get fed up with typing out command and file names in full,
then dealing with the error messages resulting from
misspellings. Fortunately, the shell provides a way to both
save typing and avoid mistakes, called tab completion. The
name is fairly self-explanatory it uses the [Tab] key to
complete the word you are typing. If this is the first word on a
line, it will be a command, so it looks in the command path for
matches for example, typing chm and hitting [Tab] will
complete to chmod. Used after the command, hitting [Tab]
completes file names, so instead of typing:
cat /pathto/somelongdirectory/someevenlongerfilename.txt
you can use:
cat /pa[Tab]som[Tab]som[Tab]
Isnt that easier? When more than one file matches, the
[Tab] key will complete up to the point where it becomes
ambiguous; pressing [Tab] again at this point shows a list of
options, which you can cycle through with [Tab], or add
As the name suggests, tab completion lets you use the [Tab] key to
complete the word youre typing, helping save time and avoid mistakes.
last few commands you ran, but most shells keep a history of
the last 500 or so commands that you an access again.
Terminal:
User accounts
Whether you want to have one user or a hundred on your computer, its time
to explain the basics of user accounts on Linux.
Create a user
Every user has a home directory. This is usually /home/
username but it can actually be anywhere the user created
Add a password
We have created a user but he cannot log in yet because we
havent given him a password.
sudo passwd john
will ask you for the password twice. The passwd command
Different filesystems
validity when you save it, before replacing the existing file. The
format of /etc/passwd is explained fully with:
man 5 passwd
Transfer ownership
If you want to change the owner of a file, you need chown:
chown john somefile
chown john:users someotherfile
chown john: someotherfile
chown -R john: somedir
The first makes john the owner of a single file. The second
command also changes the group. If you do not give a group
after the colon, as in the third example, the group is changed
to the users default group. When applied to a directory, the
-R option also changes all files and sub-directories in that
directory. You can change just the group with chgrp. These
commands must be run as root. Changing file permissions is
done with chmod.
Most desktops
provide graphical
alternatives
for user
management
this is KDEs
Kuser but
they still need
root privileges.
Becoming root
Man pages:
Accessing help
Need more advice? Then you need to browse the ultimate collection of useful
self-help books that resides inside the Linux operating system.
This is the man page for ls, and it helpfully lists the
various options that you can use in alphabetical order.
Desktop viewing
Man and info are intended to be
readable in a terminal, because you may
need to use them on a system without a
desktop. There are GUI viewers for them,
though, the most convenient being in
KDE, where you can press [Alt]+[F2] and
type man:/command or info:/
command and get an HTML formatted
version of the document displayed in
Konqueror. There are also the tkInfo and
Quick help
There is more to man than a bunch of formatted text pages
and a program to display them in a pager. Man maintains a
searchable database of pages, which is automatically
updated by Cron, and has some other programs for working
with it. Each man page has a NAME section, which includes a
short description of the pages topic. The whatis command
gives the description it tells you what the program (or file)
is, without going into details of options. Here is the classic
geeky, recursive example:
whatis whatis
whatis
(1) - search the whatis database for
complete words
This is a faster way to see what commands do, especially if
you want to check more than one:
whatis grep sed symlink
The whatis command searches only the name, and only
matches on whole words, so it assumes you know the name
of the command and just want to know what it does. For a
more wide-ranging search, use apropos, which does a similar
job but searches the descriptions as well and returns all
matches compare these two commands:
whatis png
apropos png
There is another form of documentation thats favoured
by the GNU project: info pages. While a man page is basically
one very long text file with a bit of formatting markup, an info
document contains a tree of linked pages in a single file. Its
more like HTML than plain text, but is designed for reading in
a text console and all the pages are contained in a single file.
The ls info
page goes into
more detail and
groups options
according to
their function.
Info pages
generally provide
more detail than
man pages.
Printing manuals
There may be times you want a hard
copy. As man pages are stored in a
markup format and converted for
display by the man program, you can
use -t to convert them to a printable
format, Postscript by default, like this:
Sysadmin:
Back to basics
You need some basic admin skills under your belt if you want to be able to use
Linux effectively. Read on and refresh your memory...
Managing users is one of the most basic Linux admin skills
you should possess, even if you are the only person using the
computer. Thats because knowledge about users and groups
is imperative in order to secure and control access to data.
Although you can manage users from the command line,
almost all modern Linux distros include a graphical tool to
help you add, control and remove user accounts. However,
there are a few things you should keep in mind when
managing users and groups.
It may sound obvious, but a user is anyone who uses a
computer. Some system services also run using restricted or
privileged accounts. The superuser, root, has complete
access to the operating system and its configuration.
Unprivileged users can use the su and sudo commands for
controlled privilege escalation.
Behind the scenes, a username has a unique string of
numbers known as a user ID (UID). Similarly, groups have
group IDs (GID). The root user is UID 0. Numbers from 1
through to 499 and number 65,534 are the system users,
sometimes called logical or pseudo-users. Regular users have
UIDs beginning with 1,000. When creating a user, the system
admin can add other users to an existing group, in which case
theyll all bear the same GID. Alternatively, they can create a
new group, in which case the GID will probably be the same
as the unique UID for each user. Remember that a group
cannot be a member of another group in Linux.
Quick
tip
By using various
combinations of
permission settings,
you can quickly set
up a more secure
environment.
Tools such as Dj Dup help take the sting out of complex and involved tasks
such as backups.
Compile software
Compiling software is another skill you need in your arsenal.
Although most popular software is available as pre-compiled
binaries via the distros package manager, sooner or later
youll run into some that youll have to compile yourself. It
could be a bleeding edge version that is critical to your
workflow but hasnt been packaged by your distro yet.
Compiling software from source isnt difficult and only
slightly more involved than installing binary packages. But
make sure you have all the tools required to compile
packages. If you are using a Debian-based distro, such as
Ubuntu, you can install the build-essential package with this:
sudo at-get install build-essential
Users of RPM-based systems, such as Fedora, will need to
grab the individual components with this command:
Quick
tip
If the compile
happens to fail,
check the error
messages and then
run the make clean
command before
you start again.
Run make uninstall
as the root user
to remove any
software that you
have installed from
source.
Quick
tip
Ensure that you
always make
a backup of a
configuration file
before you start to
edit it by using the
cp command,
such as cp
configfile
configfile.original.
the CPU:
cat /proc/cpuinfo
Then theres the /usr directory, which contains apps,
libraries and other types of shared data for use by anyone on
the system. The /var directory contains directories used by
various system services for spooling and logging. Some of
these, such as print spooler queues under /var/spool, only
exist temporarily. Others, such as the logs under /var/log,
are renamed and rotated regularly.
Talking of log files, checking on them is an essential admin
task. The Linux kernel, critical network services and other
important apps all record critical activity inside log files that
are filed under the location /var/log. In particular, two
important log files you should regularly look at are auth.log,
which logs all authentication attempts made on the system,
and boot.log, which records messages generated while the
system boots and starts services.
Then theres that /home partition that you are already
familiar with. It is very good practice to keep /home on a
separate partition from the rest of the filesystem. This
ensures that the data inside will survive any damage to other
parts of the distribution.
KDEs system
monitor can
visualise all kinds
of resources
inside the
computer.
Schedule tasks
There are some admin tasks creating backups
and large downloads, for example that are far
more effective when you execute them as per a
schedule.
The at command helps you schedule tasks
that you need to run at a specific time and date.
For example, if you need to download a large file,
its best to schedule it late in the night or very
early in the morning. The command at 1am
tomorrow will change the prompt to at> and
everything you type at this prompt will be run at
the specified time. To download a file, point to its
location with the wget command. Press the
[Enter] key to specify another command for
example, if you want to move the file to a specific
folder. When you are done, press [Ctrl]+[D ]to
save the job. At the designated time, the at
command will perform the actions specified.
The at command allows fairly complex time
In-depth | Sudo
Sudo: Control
root access
If youve come this far its time to revel in the god-like powers of the
superuser, using sudo to grant the wishes of lesser beings.
need to work as root, how do you do it and how can you allow
other users to perform root tasks without giving them carte
blanche with your system?
The traditional way to give root access is with the su
command. This command, which stands for switch user, not
superuser, enables you to become another user for as long as
it is running. When run in a shell with no arguments, it lets you
into the root account (provided you know the root password).
It is not exactly the same as logging in as root, you still retain
some elements of your current environment. To provide as
close as is possible to a login environment, add the -l option.
We said the su stands for switch user as it defaults to
switching to root, but you can give a username to the
command, eg:
$ su -l fred
Once you have run su , you will stay as that user until you
type exit, or press Ctrl+D. This is not necessarily a good thing,
leaving a shell open as root is not good security practice,
so you can pass it a single command to run with the -c
option:
$ su -c ifconfig eth0 up
This doesnt open a shell session, instead, after asking for
the root password, it runs the command given.
The various
desktops have UI
versions of
sudo , which
are used when
running root
commands from
the desktop.
visudo not vi
You can grant sudo privileges to other users by editing /etc/
sudoers, but you should never do this manually. If you were
to edit this file and introduce a syntax error, you could
potentially stop sudo working. As you need it to edit this file,
you need to be root to even read the file for security reasons,
you would not be able to undo your mistake. The answer is
the visudo command, which creates a temporary copy of
/etc/sudoers and loads it into your editor. After you have
edited the file, visudo checks that its correct before
overwriting the real /etc/sudoers file. The name may imply
that this uses vi to do the editing, but fear not, thats only
the fallback option. In fact, visudo uses your default editor,
which may be defined in the EDITOR environment variable,
or the system-wide setting in the alternatives system on
Ubuntu and other Debian-based distros.
To change the system default editor, run:
$ sudo update-alternatives --config editor
You can set the EDITOR environment variable in your
profile or choose it on the command line, like this
$ EDITOR="gedit sudo -E visudo
The -E is needed to make sure the environment variable
is passed through to the root user, more on environment
variables later. Now we know how to edit the sudoers file, lets
see what we can do with it. The file contains two main types
of entries: aliases, which are basically variable definitions, and
user specifications. The latter entry sets who can do what, eg
the default file contains a line like:
%wheel ALL=(ALL) ALL
The basic format of this line is who where = (as_whom)
what. The % at the start of the name means this is a group
and applies to all members of it. The where is the hostname
of the computer and the next item states which users the
commands may be run as. The last item is a list of
commands that can be run. ALL is the sudo wildcard,
so this line means that members of the wheel group can run
anything anywhere, a standard entry for the admin user.
If you want to give the same privileges to another user,
the simplest option is to add them to the wheel (or admin,
depending on your distro) group:
$ sudo gpasswd -a george wheel
Logging in as root
Although the root account is disabled in
some distros, you can work around this
by running one of the following:
$ sudo bash
$ sudo --login
If you want to prevent this, you can
use ! to negate commands that cannot
be run by the user to, eg:
Environment variables
Linux uses a number of environment variables to keep track,
such as $HOME and $DISPLAY . The default behaviour of
sudo is to clear most of these for the execution of the
command. Which may not always be what you want. A brute
force way around this is to run sudo with the -E option to
keep them all. A more structured solution is to specify the
ones you want to keep in sudoers, eg you may need this to be
able to run GUI programs with sudo :
Defaults env_keep += DISPLAY HOME
There are various other settings you can add to /etc/
sudoers, all of which are thoroughly documented, but this
should be more than enough to get you started.
The default configuration includes throwing mild insults at you if you give an
incorrect password. You can turn this off for a more professional appearance.
In-depth | Sudo
Projects | Introduction
Projects
Build your own router
Try a microkernel OS
Repair broken systems
Analyse network traffic
128
132
136
140
...........................................................................................
.............................................................................................
...................................................................................
.................................................................................
Projects | Introduction
Linux Made Simple | 127
Projects | Gateway
Router: set up
a gateway
Think you can do better than your own router? Lets throw down some
iptables rules and make our own hotspot.
Quick
tip
Simple traffic
routing doesnt
require a powerful
CPU, but if you're
anticipating a lot of
traffic you'll want to
make sure you've a
Gigabit adaptor in
the gateway and a
gigabit switch.
Setting up IP addresses
The first thing we need to do is get the machines talking to
each other, which requires getting their IP addresses set up
nicely. We won't deal with IPv6 in this tutorial (but soon my
pretties), since most home routers still work with IPv4 and it's
simpler to keep our protocols homogenous. Your distro may
have progressed to kernel-generated persistent names for
your network devices, in which case your wired and wireless
devices will, have names such as enp0s327 and wlp999,
respectively. Or you may still have the old-style, humanreadable names, such as eth0 and wlan0. We'll just refer to
Ext0
Thanks to
the miracle of
NAT, packets
can traverse
the murky
marshes of our
internal network,
negotiate all
kinds of perils in
the 192 plains and
soar amongst the
cloud birds of the
wider internet.
Router/xDSL modem
Wired/wireless link
Int0
Switch
internet
10.0.1.128
10.0.1.129
10.0.1.130
Quick
tip
Basic forwarding,
routing and
masquerading can
now be carried
out via systemd's
networking
daemon, networkd.
Is nothing sacred?
We're taking bets
on what its next
trick will be. Our
money's on Sirystemd: "Siry, can I
have my init scripts
back, please?"
No! ED.
max_num_sta=5
rsn_pairwise=CCMP
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
The driver option might require some trial
and error most hardware will work with the
nl80211 driver, but you might need something
else here. Test your hostapd configuration using
the following:
$ sudo hostapd -d /etc/hostapd/hostapd.conf
If you don't see any errors, then try and
connect to your hotspot with your phone.
It probably won't get anywhere since theres no
DHCP service at this stage, but you should at
least be able to authenticate. We'll get DHCP for
free once we set up our network bridge.
Projects | Gateway
10.0.1.254
192.168.1.127
Projects | Gateway
Packet forwarding
In order to get traffic flowing we need to set up packet
forwarding and NAT (Network Address Translation). The first
thing to do is to enable packet forwarding in the kernel.
You can do this through the /proc interface like so:
$ echo 1 > /proc/sys/net/ipv4/ip_forward
To make this persist across reboots depends on your
distro some still use the /etc/sysctl.conf file, so add:
net.ipv4.ip_forward=1
Some (Arch and derivatives) have deprecated this file in
favour of individual fils in /etc/sysctl.d/. If this is you create a
file, say /etc/sysctl.d/40-ip-forward.conf, and add the
above line to it. That tells the kernel that forwarding is allowed,
but we still have to stipulate the whences and wheretos. We'll
use some good old fashioned iptables rules to do this. It's
certainly possible with the newer nftables framework, but
with every distro running a different version, and it still being
quite new code, we won't do that. Since we're assuming our
gateway machine is behind another gateway (that connects
to your ISP), we needn't worry too much about security. So
we can tell iptables to forward packets from the outside to
our internal network:
$ sudo iptables -A FORWARD -i int0 -o ext0 -j ACCEPT
If you haven't previously added any iptables rules of your
own then its very likely you won't need the previous line
Cutting cords
This is what a successful WPA2 handshake should look like, but our hotspot
fails to make it warm in here [see Hotspots With Hostapd, p129].
192.168.1.127
br0
wlan0
Wired link
192.168.1.100
192.168.1.101
Building bridges
So let's reverse our previous setup we'll have an internetfacing wired connection to the gateway machine and we want
to set up a local wireless network which provides access to
this. In the previous section we used NAT to direct traffic
between the internal and external networks, for this part we'll
show you the alternative: network bridging. In many ways this
is easier to understand than NAT, since it effectively unifies
the two (or more) networks providing a transparent bridge
over which traffic flows unimpeded. However, the NAT
approach is a little more flexible and provides more granular
control, so you may prefer to use it again.
Whatever your preference, the first task is to install and
configure the hostapd package (see the Hotspots With
Hostapd box, p129).
Anonymising gateway
A nice thing about this setup is that any routing
beyond the gateway machine propagates trivially
to our internal network. So if you have your
gateway machine's traffic routed through a VPN
or Tor, then so can all our internal network traffic.
Installing Tor is straightforward, the default config
sets up a SOCKS proxy which you must connect
your applications to. You can make this proxy
available to the internal network by adding a line,
such as SOCKSPort 10.1.0.254:9050 and
TransPort 10.1.0.254:9040 to /etc/tor/torrc.
Projects | Gateway
Router/xDLS modem
eth0
Projects | Minix
Minix 3: Test a
microkernel OS
Minix 3 has gone way beyond its educational origins with ARM compatibility,
but microkernel reliability is still at its heart.
the latter. Click the big New button at the top left of the
VirtualBox window, and name your VM. We used MINIX3.
Choose Other in both dropdown menus for OS type and
version; on the next screen give it as much RAM as you can
spare. We'd suggest that 256MB is adequate for Minix 3,
but naturally more is better while you're exploring a new
environment and pushing to see what it can do. We kept the
default 2GB disk size on one VM install, and expanded to 8GB
for another. Be inclined towards the latter if you're going to
install everything Minix 3 has to offer, but bear in mind 3.3.0's
lack of some software from previous releases.
Click Create and you'll see a MINIX3 VM listed in the left
pane. Before starting, go to Settings, and tick the Hardware
clock in UTC time checkbox, and check that Storage points to
your downloaded ISO file. You can now start up the VM from
the GUI. On a Core 2 Duo machine, without VT-x/AMD-V/
nested paging, we had to start VirtualBox with:
VBoxSDL --startvm MINIX3 --norawr0 --norawr3
Now follow the instructions in the walkthrough overleaf.
Once the installation is complete, use poweroff instead of
shutdown to halt the machine. Go back to Settings > Storage
in VirtualBox, get rid of the ISO, and point at the newly created
virtual disk image instead. Now boot with VirtualBox's Start
button (or use the workaround on PCs without VT-x and
AMD-V virtualisation extensions).
Running on a BeagleBoard
With 3.3.0, the ARM port of Minix is finally integrated in the
master code branch, along with the official x86 port. Targeted
at the BeagleBoard, with its Cortex-A8-based system on a
chip (SoC), it runs with varying degrees of success on the
Quick
tip
So often *nix
problems come
down to either
permissions or
DNS. If you can't
get pkgin to work
after you install on
VirtualBox with NAT,
put our old friend
8.8.8.8 in /etc/
resolv.conf, instead
of 127.0.0.1.
Projects | Minix
Projects | Minix
Building the SD card image for a BeagleBoard uses the NetBSD build.sh script
and downloads most of the build tools needed on the fly.
A minimalist codebase
A few years ago, Linux passed 15 million lines of
code (LoC). Minix 3 has 6,000 (6 KLoC) in the
kernel, and about the same again for the drivers
(that's traditional kernel code running in User
Mode). With a thousand times more code in
Linux, we could assume that it has a thousand
times more bugs. But it's worse than that.
All code has bugs, typically five to ten bugs
per KLoC, although FreeBSD comes out
somewhat better with three per KLoC.
At FOSDEM, Tanenbaum cited a Stanford study
Booting
Boot the ISO image from the default menu choice: Regular MINIX 3.
Ignore the warning over cd9660 (this is a known problem and the
buggy isofs driver has been disabled), the other modules will load just
fine (for a VM on older processors, see the workaround in the main
text), followed by the usual disk-mounting, and starting of services
and daemons, and the familiar login prompt.
Not Ukrainian?
Network cards
Inline documentation
Log in as root (you wont need to supply a password yet). You're now
in the live disc's environment, and can start exploring all that Minix
has to offer from here but if you've got VirtualBox running a full
installation theres a better sandbox in which to discover Minix 3.
Type setup to start the install program. Read the four notes that are
output, and then hit Enter.
Disk partitioning
Even if you choose the automatic partitioning process, you still get to
make many choices, provided the correct disk region is chosen
(which isnt a problem on VirtualBox installations). Just hit Enter,
and again at the disk size prompts for partitions and block sizes.
Minix gives most of the disk to the /usr partition, as this is where
most files will live.
Up and running
After power cycling and booting, log in and use passwd to set a root
password. In /usr/pkg/etc/pkgin/repositories.conf, change:
http:///www.minix3.org/pub/pkgsrc/packages/$osrelease/$arch/All
Projects | Minix
Projects | Rescatux
Rescatux:
System repairs
All those commands feeling a bit complex? Repair common system
problems without resorting to the command line.
engine from a live CD to try and find the correct Grub
incantation for your situation. I consider myself reasonably
knowledgeable about bootloaders, but I still dont break
them so often that I feel comfortable fixing them from the
command line without at least a cursory RTFM to check
my options.
inux live CDs are a wonderful invention, they let you try
new distros, show Linux off to your unenlightened
friends, and fix broken systems. There are live distros
aimed specifically at repairing damaged systems, but they
have a common drawback. They all require a certain
amount of expertise and most of us dont break our systems
often enough to gain that sort of experience. When your
computer sits there showing you nothing but a glum
message from the bootloader, your main priority is fixing it
as quickly as possible, not spending time using a search
computer with
sudo shutdown -n
This kills processes without using the usual init system,
which reduces the number of disk writes. Now you can boot
Rescatux. If you partitioned a drive, you can use testdisk to
search for the old partition boundaries and restore them.
Repartitioning a drive only writes to the partition table, the
actual data on the rest of the disk isnt touched until you
format the new partitions. So if you can find the old partition
boundaries and write them back into the partition table,
everything should be back as it was. This is what testdisk
does. After accepting the option to create a log file, that may
be useful later, pick the disk to scan. The partition type
should be Intel for the old-style MBR partition tables or EFI
If a filesystem needs repair, select it and Rescapp will do the rest. Cannotmount may mean damage, but here it indicates swap and extended partitions.
Projects | Rescatux
Projects | Rescatux
GPT for the newer GPT variant, the other choices are rather
specialist. Removable drives occasionally use the None
option, but usually have a single partition with an MBR
partition table. Select Analyse to scan the disks partition
table and then Deeper Scan to search for lost partitions. If you
find what you are looking for, Write will hopefully restore your
lost settings. Although it is not mentioned in all the menus,
pressing Q usually takes you back to the previous menu.
Testdisk is a very low-level tool, and its effects may not be
reversible, where possible use dd to make a backup of your
disk before proceeding.
If you deleted files rather than partitions, the tool you
want is PhotoRec. Photorec scans the disk for evidence of
files and then attempts to reconstruct them you will
need another disk attached for saving these files to.
Photorec can only find the contents of files, metadata
such as ownerships, permissions and even the file name
is not available to it.
So you end up with a lot of files with numeric names,
although PhotoRec does give them a suitable extension
based on the contents of the file. If the files are digital camera
photos (PhotoRec was originally written to recover files from
an erased memory card) or music files, you should find that
any EXIF or ID3 tagging is preserved, making identification of
the files relatively simple. Otherwise, you may have to spend
some time trawling through the files to identify them, but that
is better than losing your data altogether.
Forget your
password?
Rescapp lets
you reset the
password of
any Linux or
Windows users,
including root,
with a couple of
mouse clicks.
#5 Its complicated
So far, we have looked at solutions to standard problems that
can be deal with by a couple of mouse clicks. If things get
more complicated, Rescatux contains much of the other
software found on rescue discs, and you can just open a
terminal and use it, but it will come as no surprise that you
can also use more advanced tools from the Expert Tools
section of Rescapp. These tools include:
Gparted for (re)partitioning your hard disk.
Testdisk to find partitions and filesystem on disks with a
damaged partition table.
PhotoRec to recover deleted or otherwise lost files from
a disk, and not only photos.
OS Uninstaller for removing extra distros from a multiboot system
It is worth noting that the Expert Tools buttons still open a
help page first, but this is generic help for Rescatux, not help
for the individual programs.
Apart from those single-use programs, there is also Boot
Repair which opens a window containing many options for
altering the boot process.
This covers a number of operations, especially if you
enable the Advanced options. It allows you to back up your
partition tables and log files to a USB device, a wise step
before you start changing things. Most of the other options
in here let you tweak how the bootloader works. You can
reinstall, as with the separate button covered elsewhere,
initrd (loop)/live/initrd2.img
}
}
Now run update-grub or grub-mkconfig,
or use the Update Grub Menus option in
Rescapp, to update your menu. Then, when
you reboot your system, you will have an option
to boot into Rescatux.
sudo grub-mkconfig -o /boot/grub/grub.cfg
If trying to boot from it gives an error that the
ISO file could not be found, add this below the
submenu line
set root=(hd0,1)
where hd0,1 refers to the first partition on the
first disk (for some reason Grub counts disks
from zero and partitions from one. Adjust to suit
your system.
Tweak your Grub options as well as performing other Grub backup and repair
operation from the Expert tools section.
Fixing Grub
Restore Grub
Select Restore Grub from the main Rescapp window and read the
help text to make sure you understand what is going on. Rescapp
does most of the work, but you still need to know which distro and
which disk you want to use for Grub. Press Run! when you are ready.
Grub selection
Now choose the disk to which you want to install Grub, usually sda. It
doesnt have to be the one containing the distro you chose, but that is
normally the case. If you boot from a USB stick, that may be
recognised as sda with your hard disk on sdb.
Select a distro
Rescapp will scan your disk partitions for installed distros, trying to
recognise them by name when possible. Pick the one you want to use
as your main distro. This is the one that you are unlikely to want to
remove, as that would involve repeating this process.
Auto-x
Press OK, and Rescapp will perform the necessary steps, mounting
and unmounting filesystems as needed and running grub-install with
the correct --boot-directory, --root-directory and device arguments.
Now you can reboot! Its as simple as that.
Projects | Rescatux
Projects | Wireshark
Wireshark:
Analyse traffic
Well explain the necessary things that you need to know to start using
Wireshark, and analyse three kinds of network traffic.
Display filters
While capture filters are applied during network data capture
and make Wireshark discard network traffic that doesn't
match the filter, display filters are applied after capture and
'hide' network traffic without deleting it. You can always
disable a Display filter and get your hidden data back.
Generally, display filters are considered more useful and
versatile than capture filters because it's unlikely you'll know
in advance what you'll capture or want to examine.
Nevertheless, applying filters at capture time can save you
time and disk space and that's the main reason you might
want to use them.
Wireshark will highlight when a display filter is syntactically
correct with a light green background. When the syntax is
erroneous, the background becomes pink.
Display filters support comparison and logical operators.
The http.response.code == 404 && ip.addr == 192.168.1.1
display filter shows the traffic that either comes from the
192.168.1.1 IP address or goes to the 192.168.1.1 IP address
that also has the 404 (Not Found) HTTP response code in it.
The !bootp && !ip && !arp filter excludes BOOTP, IP and
ARP traffic from the output. The eth.addr ==
01:23:45:67:89:ab && tcp.port == 25 filter displays the
traffic from or to network device with the 01:23:45:67:89:ab
MAC address that uses TCP port number 25 in its incoming
or outgoing connections.
Keep in mind that display filters don't magically solve
problems. They are extremely useful tools when used
correctly but you still have to interpret the results, find the
problem and think about the possible solutions yourself.
When defining rules please remember that the (ip.addr !=
192.168.1.5) expression doesn't mean that none of the ip.
addr fields can contain the 192.168.1.5 IP address. It actually
means that one of the ip.addr fields should not contain the
192.168.1.5 IP address. Therefore, the other ip.addr field value
can be equal to 192.168.1.5. You can think of it as 'there exists
one ip.addr field that is not 192.168.1.5'. The correct way of
expressing it is by typing !(ip.addr == 192.168.1.5). This is a
common misconception.
Also remember that MAC addresses are truly useful when
you want to track a given machine on your LAN because the
IP of a machine can change if it uses DHCP but its MAC
address is more difficult to change.
It is advisable that you visit the display filters reference site
for TCP related traffic at http://bit.ly/WireSharkTCP. For
the list of all the available field names related to UDP traffic,
it's advisable to look at http://bit.ly/WireSharkUDP.
The three
packets (SYN,
SYN+ACK and
ACK) of a TCP
3-way handshake.
Quick
tip
The fact that the
FTP protocol
usually uses
port number 21
doesnt mean
its not allowed
to use a different
port number. In
other words, don't
blindly rely on the
port number to
characterise TCP/
IP traffic.
Projects | Wireshark
Projects | Wireshark
Quick
tip
When you put
your network card
in promiscuous
mode, you allow
the network device
to catch and read
every network
packet that arrives
to it even if the
receiver is another
device on the
network. Network
packets still go
to their original
destination.
in the SYN packet. The server sends back a TCP (SYN, ACK)
packet which includes the sequence number of the opposite
direction and an acknowledgement of the previous sequence
number. Finally, in order to truly establish the TCP connection,
the client sends a TCP ACK packet to acknowledge the
sequence number of the server. After the TCP three-way
handshake, the connection is established and is ready to
send and receive data.
The traffic for this case was produced by running the
following command:
$ wget http://www.linuxformat.com/
After some necessary DNS, ARP and ICMP network traffic,
the TCP three-way handshake begins (pictured top, p71).
The client IP address is 10.0.2.15 and the destination IP
address is 80.244.178.150. A pretty simple display filter (tcp
&& !http) makes Wireshark display 63 out of 82 packets. The
three packet numbers used in the handshake are sequential
because the host wasnt performing any other network
activity at the time of capturing, but this is rarely the case.
Ping scans
This part will examine the network traffic that's produced by
Nmap when it performs a ping scan.
LAN ping scans are executed using the ARP protocol.
Hosts outside a LAN are scanned using the ICMP protocol, so
if you execute a Nmap ping scan outside of a LAN, the traffic
will be different from one presented. In the example below,
the Nmap command scans 255 IP addresses, from 10.67.93.1
to 10.67.93.255. The results show that at execution time only
10 hosts were up or, to be precise, only ten hosts answered
the Nmap scan:
$ sudo nmap -sP 10.67.93.1-255
Starting Nmap 6.47 ( http://nmap.org ) at 2014-09-05 11:51
EEST
Nmap scan report for xxxxx.yyyyy.zzzzz.gr (10.67.93.1)
Host is up (0.0030s latency).
MAC Address: 64:70:02:AD:E9:44 (Tp-link Technologies
CO.)
Nmap scan report for srv-gym-ag-anarg.att.sch.gr
(10.67.93.10)
Host is up (0.0051s latency).
MAC Address: 00:0C:F1:E8:1D:6E (Intel)
Nmap scan report for 10.67.93.20
Host is up (0.0066s latency).
MAC Address: D0:27:88:1D:15:20 (Hon Hai Precision Ind.
Co.Ltd)
Nmap scan report for 10.67.93.21
Host is up (0.0053s latency).
MAC Address: D0:27:88:1D:D6:FB (Hon Hai Precision Ind.
Co.Ltd)
Nmap scan report for 10.67.93.22
Host is up (0.0080s latency).
MAC Address: 00:1A:92:44:D7:67 (Asustek Computer)
Nmap scan report for 10.67.93.29
Host is up (0.057s latency).
MAC Address: 00:78:E2:47:49:E5 (Unknown)
Nmap scan report for 10.67.93.78
Host is up (0.0023s latency).
MAC Address: 00:80:48:24:6A:CC (Compex Incorporated)
Nmap scan report for 10.67.93.147
Host is up (0.028s latency).
MAC Address: 00:14:38:64:5D:35 (Hewlett-Packard)
Nmap scan report for 10.67.93.172
Host is up (0.016s latency).
Quick
tip
There is also a
console version of
Wireshark called
tshark. The two
main advantages
of tshark are that
it can be used in
scripts and that
it can be used
through an SSH
connection. Its
main disadvantage
is that it does not
have a GUI. Tshark
can also entirely
replace tcpdump.
Here is how Wireshark shows the traffic of a DNS query after applying a
Display filter. Notice the green colour around DNS that shows the validity of it.
The IP protocol
IP stands for Internet Protocol. The main
characteristic of IP is that it's not a reliable
protocol by design. Unreliable means that
packets may not reach its destination for various
reasons, including transmission errors, network
hardware failures and network congestion.
Networks may also deliver packets out of order,
deliver them after a substantial delay or deliver
duplicates. Nevertheless, a programmer can
program reliable applications that use IP by
implementing their own error-checking code but
this is a non-trivial task.
Projects | Wireshark
Subscribe to
Choose your
Print 31.50
For 6 months
Every issue
comes with
a 4GB DVD
packed full
of the hottest
distros, apps,
games and a
lot more.
package
Digital 22.50
For 6 months
The cheapest
way to get Linux
Format. Instant
access on your
iPad, iPhone
and Android
device.
&
On iOroSid!
And
Bundle 38.50
For 6 months
SAVE
48%
Supscriptions
9000
9001
148
pages of advice
from the makers of