Create Account

Username
Password
Remember me
Email
 
45

Reg guide to Linux

8 comments, 984 views, posted 5:18 pm 21/06/2010 in Linux & Open Source by mynameis
mynameis has 15659 posts, 1267 threads, 186 points
Never sudo whilst drunk

One of the common complaints about Linux is that there are too many different editions (or “distributions”) to choose from, and only a hardcore nerd can tell them apart.
Well, it's true, but you can safely ignore 99 per cent of them. Welcome to The Register's guaranteed impartiality-free guide. Tomorrow, we'll tell you how to get them, burn them and set them up to dual-boot with Windows and on Wednesday there will be a guide to tweaking your new setup and getting it ready for use.
So, in order of popularity according to the DistroWatch chart:

Ubuntu – free

If you can call it a market when it's given away for free, Ubuntu is the market leader. Unlike most of the others, Ubuntu isn't a freebie version of a commercial product or a taster: it's genuinely free, bankrolled by South African dot-com millionaire and sometime space tourist Mark Shuttleworth.
It's good, too. It's simple, quick and clean, and comes on a single CD with everything you need to get up and going, with no choices or awkward questions. Recommended.
One complication with Ubuntu is the profusion of remixes and spin-off sub-distros. Most differ only in offering a different desktop from the default GNOME, such as Kubuntu with the KDE desktop, Xubuntu with Xfce, new player Lubuntu with the lightweight Lxde and so on. If you want the best support, either online from other users or in terms of drivers, third-party software and so on, just ignore them and stick to the real thing.


Fedora – free

This is the freebie version of corporate favourite Red Hat. Since 2003, Red Hat has taken its flagship, Red Hat Enterprise Linux, commercial-only – it starts at about £150 for a workstation, £550 for a server, and is a cautious, stable product, updated only every couple of years. Fedora is the opposite: new releases come out twice a year, it always incorporates the latest and newest technology, and it costs nothing. It has no support apart from through the community, meaning web forums, mailing lists, IRC and so on. It's shiny and pretty, and might be handy if you work with Red Hat in the day job, but it's not the greatest if you want to actually get stuff done with your PC.
If you're going to be using Red Hat at work and want to get some experience, try CentOS, a completely free respin created from the published source code to RHEL. Looks the same, works the same and costs nothing – which means it's stable but always a bit behind the times.


Mint – free

The only Ubuntu remix edition really worth bothering with. It's basically the latest Ubuntu after a minor nip and tuck with bundled multimedia and Web plugins and codecs. Mint's desktop has a slightly less controversial theme and a slightly more Windows-like layout, and it can handle common formats like MP3, Flash and Java out of the box. Well worth a look, but beware third-parties that only support the “real thing”.


OpenSUSE – free download, or £19.95 for a boxed copy with manuals and support

The free version of Novell's corporate-focused product. In the late 1990s, SuSE was the leading European distro with some of the best admin tools, but time has not been kind. It's looking a bit lardy these days, with the full release filling a DVD and including a bewildering variety of components to choose from. Its admin program, YaST, is still the best around, so it's a good choice if you have problems getting hardware working properly.


Mandriva – free or €29 with support and bundled commercial applications

Mandriva started out well but it's a fading star now. At heart it's a more polished, friendlier Red Hat desktop with better admin tools, but it's no longer all that compatible with its ancestor. Try PCLinuxOS instead, a free lighter-weight spinoff – a popular choice, but not as well-supported as Ubuntu.


Debian – free

Debian is the daddy, the basis for Ubuntu, Mepis and others. It's intentionally restricted to only open-source components, so it's a bit more work to get proprietary code such as graphics or wireless network drivers working, or the official versions of Java, Flash and so on. Good for servers if you know what you're doing, but not a great desktop choice unless you're already a guru.


The best of the rest

There are dozens of smaller players out there vying for your attention, but most aren't really worth the time unless you're already an expert or have a specific function in mind.

For instance, if you just need something to get a really old, low-spec PC running for the spare room or ready to give away, Damn Small Linux and Puppy Linux are both good candidates. Both work well on a Pentium II or Pentium III-level machine and might even run on a high-end 486 at a push.

Knoppix is a live CD – in other words, a complete Linux OS designed to boot and run from CD without being installed. Ubuntu and several other distros ship as live CDs these days, but the environments are limited and only really intended to check that everything works on your PC and then to get it installed. Knoppix is intended to be used this way and is a great tool for recovering data off crashed or virus-infested PCs, diagnosing problems, checking internet connections and so on.

MEPIS is a custom respin of Debian with good multimedia support. It's got some devoted fans but there isn't much to set it apart from the far more mainstream Ubuntu or Mint.

Gentoo is the software equivalent of a liquid-cooled overclocker's PC: to install it, every component is recompiled for your PC with your preferred optimisations. In other words, it takes ages, you need to know exactly what you're doing and at the end it's only a few per cent faster but looks unlike anything else. It's not really worth the bother.

Sabayon is a more polished liveCD version if you really want a look.
Similarly, Arch Linux is a tweaker's dream, aimed at expert Linux users, as is Slackware, the oldest surviving distro, with very conservative – ie old-fashioned – installation, packaging and admin tools.

The highest-rated non-Linux open source OS is FreeBSD, parts of which form the underpinnings of Mac OS X. Don't expect Apple-like sophistication, though – FreeBSD is adamantly old-school, aimed at skilled Unix users. If you want to play with an easy-to-install version, try PC-BSD, which has nearly Linux-like levels of polish.


Rounding up

To be honest, unless you have some other reason, such as wanting to get into working with enterprise distributions such as RHEL or Novell's SUSE, for a first-timer or if you're giving Linux the first go in years there's no good reason to look beyond Ubuntu. Don't bother with any of the special “editions” or remixes – Ubuntu itself is the most professional offering around and it's possible to go from a blank machine to a working system with all applications and everything in well under an hour - considerably faster than it would be with Windows.
Tomorrow, we'll look at preparing your machine to dual-boot between Windows and Linux.

Comments

0
2:55 pm 23/06/2010

mynameis

On Monday, we suggested Ubuntu as a good starting point for experimenting with desktop Linux. If you have the option, dedicate a machine to it – by 2010 standards, even a modest-spec PC will run it fine. You'll be very pleasantly surprised by the transformation from a lumbering old XP box burdened with years of cruft to one with a fresh install of an OS that doesn't need multiple layers of security software.
If you don't have that option, though, you'll have to run the two systems side-by-side. There are three main ways:

  1. The traditional dual-boot arrangement, using multiple disk partitions.

  2. Wubi, which means installing Ubuntu inside a file in the Windows filesystem.

  3. Virtualisation.

Option 3 is for weenies. You don't learn anything about the performance or feel of the OS on native hardware running it in a VM, and you might lose the joyous experience of hunting for drivers – although there's a pretty good chance these days that you won't need any. The second option, Wubi, works fine, but it's a bit slower and less flexible than a native install, and if you decided to “go native” and switch to Ubuntu full-time, you can't get rid of Windows later – you're lumbered with the virtual-hard-disk-in-a-file arrangement.
We recommend the old-fashioned way: shrink your Windows partition to free up some space, create some new partitions and put Linux in there.
Before you do this, though, it pays to do some preparation and do a little housekeeping on your Windows system. The following assumes you're on XP – some of these steps are significantly harder work on Vista or Windows 7.

Housekeeping

You can do a lot of this from the command line, but if you're using Vista or 7, it won't let you. Save yourself some time and make an Admin-mode command prompt shortcut – create a shortcut to CMD.EXE, then right-click it, choose Properties and set it to run in administrative mode.
First, clean out your TEMP folders, both the global one, C:\WINDOWS\TEMP, and the user one. If you're on XP, that's in C:\Documents and Settings\%USERNAME%\Local Settings\Temp, where %USERNAME% is the short form of your sign-in name. (If you're on Vista or Windows 7, it's in C:\Users\%USERNAME%\AppData\Local\Temp.) "DEL *.* /s/q" is your friend here. If you have several user accounts on the PC, don't forget to clean out everyone's Temp folder. It's safe to delete everything in there, but to remove stubborn hangers-on, you might need to reboot, or better still, start the PC in Safe Mode. For a really thorough clean-up, you can search the disk for files matching "~*.*" and remove them – they're temporary files which MS Office tends to litter all over your drive.
Next, look in C:\WINDOWS. You'll probably see loads of uninstall folders for Windows updates - usually, these are called things like $NtUninstallKB898461$: anything with a name starting and ending with a dollar sign and called "NtUninstall" followed by a number or name. Only delete these ones - leave everything else, including the folder $hf_mig$ if you have it.
Reboot to make sure everything still works. If all seems fine, empty the Recycle Bin. Next, open a command prompt and do a CHKDSK /F on all of your drives.
If you've got a single hard disk drive with multiple partitions and you want to dual-boot, for simplicity's sake, it's easiest to consolidate all your files onto drive C:, or at least cut things down to just two partitions, one for software and one for data. Similarly, if you've got multiple hard disks, for an easy life, shuffle your stuff around so as to give Linux a whole drive to itself.
After you've rebooted and done the disk checks, defrag any Windows partitions you're going to resize. This isn't essential, but it can speed things up a bit. Don't waste your time on third-party tools - the built-in free defragger is good enough. For a slightly faster and more thorough job, do it in Safe Mode.


Getting a copy

Decide what you're going to run. Vanilla Ubuntu 10.04 is easiest. If you can't stand the thought of window buttons on the left or you would like your media codecs pre-installed, try Mint 9 instead – it's the same underlying OS.

If you have a 64-bit PC and 4GB or more of RAM, by all means try the 64-bit edition. It's a little faster, but some drivers and plugins, notably Flash, can be problematic. If you're not sure whether your CPU is 64-bit capable – for instance if it's a late-model Pentium 4 – an easy way to find out is to try to boot 64-bit Linux. It won't work but it will print a nice little message telling you why.

If you just want the least hassle, or if you have 3GB or less RAM and don't plan to upgrade, go with the 32-bit edition. In any case, the 32-bit version can access more than three-and-a-bit gig of RAM with a workaround called PAE and you'll probably never notice the slight slowdown.
If you're feeling adventurous, you can multi-boot several distros on the same PC, including 64-bit and 32-bit side-by-side. It's safe to share the same home and swap partitions between them, but to avoid getting settings muddled, use differently-named user accounts on each one.
The easiest way is to download an ISO file from the server nearest to you and burn it to a blank CDR. (Don't burn a CD image on a DVDR – this can confuse some BIOSes. If you only have DVDRs to hand, there's a special DVD image under "Alternative downloads". It's the same OS - they just put a few more packages on the disk.) You can either download a file in the usual way – the DownThemAll extension makes it a bit quicker for Firefox users – or grab a torrent and help other users by leaving it running for a while.
If you're on XP and you don't have additional CD-burning software, don't try to use XP's built-in burning functionality to write the CD: you'll just end up with a disc with one honking great file on it, which is no use. ImgBurn is free, easy and does the job.
If you haven't got a burner or have restricted bandwidth and can't readily download 700MB of data, Canonical will even post you media free of charge. To install on a PC with no optical drive, UNetbootin will let you create a bootable USB key.

Partitioning

Soon enough PCs will shift to EFI firmware, like the Intel Macs, and the BIOS will shuffle into history, but for now, we have to live with the limitations of the PC BIOS from the heady days of 1981. This means no more than four primary partitions per drive and the PC looks for the boot sector on the first physical drive. The recommended config is a single primary partition on the first drive, with all other partitions as logical drives in a single extended partition. If you have multiple drives, use only logical drives on all the others. You don't have to do this but it makes life easier. Also note that you might have a hidden recovery partition that counts for another of your four primaries.
For Linux, the minimal recommended config is three partitions: one for the root filesystem (FS) ("/" in Unix shorthand), which holds the OS and apps; one for the home filesystem ("/home"), which stores your home directory; and a third, right at the end of the disk, for swap – Linux' virtual memory system. You don't need a huge amount of space – 8GB will do for the root partition, 16GB is plenty and 32 or more is almost overkill. The advantage of keeping the home directories in a separate partition is that it makes it much easier to re-install or even change to a different distro.
For the swap partition, the traditional sizing recommendation is twice physical memory. Today, there's not much point going above 2GB of swap. If you have more than 2GB of RAM, 2GB of swap will probably be plenty, but if you have disk space to burn and 12GB of RAM, feel free to assign 24GB of swap that you will never use. Once you've worked out how much space to take from Windows and how much to give to the root FS and swap, give the rest to your home FS.


An old guideline when building a multi-boot PC is to manipulate partitions under their native OS where possible. The snag here is that XP doesn't have the functionality to shrink its own partitions. Vista and Windows 7 do, although sometimes not by as much as you might expect.
If you can, use Windows to shrink its own partitions. If not, boot the PC from your new live CD and use the partitioning tools on there. The setup program will walk you through partitioning, but it's arguably preferable to do it in your own time with the "Gparted" tool – a Linux equivalent of PartitionMagic. You'll find it under the System menu in Administration.

After you've shrunk the Windows volumes, check that Windows still boots OK. If not, you can use an XP, Vista or 7 install CD or the Windows 7 Recovery CD to repair it. Even if it comes back up fine, it's a good idea to run a CHKDSK again, just in case.

To avoid problems, don't try to put Linux first on the disk, followed by Windows. Linux expects to share; Windows doesn't. The same goes for putting Linux on your first hard disk and Windows on the second - just don't. The ideal simplest setup is Windows in a single primary partition, followed by an extended partition containing all the Linux partitions, or Windows alone on the first physical drive and Linux alone on the second.
If you've got multiple drives, it is possible to disable one in the BIOS, install on the other, then use the BIOS to switch between them – but if you get it wrong, this can be risky, it makes it harder to share data between OSs and in any case the Linux boot menu is painless and far easier. Linux will happily access and both read and write FAT, FAT32 and NTFS volumes, so you can get at your Windows files and documents while you're in Linux. Your Linux volumes will be invisible from within Windows, though, without additional software.
When creating the partitions, make sure that you create them in their on-disk order. If necessary, use a calculator – there is one on the live CD under Applications | Accessories – to work out the sizes, rather than creating the root partition first, then the swap partition on the end of the disk, then finally filling the remaining space with the home partition. Linux is perfectly happy with out-of-order disk partitions, but they can cause problems with Windows.
Some other gotchas to watch out for include RAID setups. There are basically three kinds of RAID – software, firmware and hardware. Unfortunately, the most common on Windows desktops is firmware RAID, where the disks are attached to motherboard controllers and the array is created in the BIOS and managed by a special driver under Windows. You can't partition such an array and share it with Linux. Proper hardware RAID, with the disks on a dedicated controller card, can be shared, but it's complex and not worth the effort. Don't bother; split the array up into standalone drives and dedicate some disks to Windows and some to Linux. True software RAID is only found in Server editions of Windows, which you probably wouldn't want to dual-boot anyway. Linux has its own excellent software RAID system, but it's not interoperable with others OS's implementations. In any event, RAID is primarily a server thing and dual-booting a desktop one; don't mix them.

Summary

So the preparatory steps are:

  1. Clean up your Windows drives.

  2. If you've got multiple partitions or drives, consolidate your stuff down onto as few as reasonably possible.

  3. Download an ISO of your choice of distro and burn it to an optical disc.

  4. Check the PC boots from it OK.

  5. If you're using Vista or Windows 7, use it to shrink your partitions down to make room for Linux. Otherwise, use the live CD to do it.

  6. Check Windows still boots OK.

  7. Create your new Linux partitions.

Once all this is done, you're ready to actually install the new OS and set it up – which we'll cover in tomorrow's article.

0
5:30 pm 24/06/2010

mynameis

Linux has changed almost beyond recognition since version 1.0 in 1994 and Ubuntu is about as polished and professional as it gets. It's approaching the level of polish of Mac OS X, is faster and easier to install than Windows, includes a whole suite of apps and offers tens of thousands more, runs on cheap commodity hardware and costs nothing.
Nobody knows quite how many Ubuntu users there are - it's not sold or licensed, there's no registration process and it doesn't "phone home" and identify itself, so it's hard to tell. Its creators reckon around 12 million, but then, the number-two distro on Distrowatch, Fedora, claims about twice as many.

So with over a billion PCs in the world, why are only about 0.01 per cent using the best-known Linux desktop?

Two related pitfalls mean that most people who try it may well find that certain things don't work. Firstly, because Ubuntu is entirely built around free, open source software that is legal to use anywhere in the world, when first installed, it doesn't include some more or less indispensable but proprietary tools, such as Adobe's Flash player; nor is there support for ubiquitous formats such as MP3, Windows Media, Quicktime and so on.
Secondly, when people try to fix this, they attempt to use the methods they know from Windows or the Mac – go to a web page, download a program, run it to start the installer – and it doesn't work. Result: they give up and never come back.


How to avoid pitfall Number 1

Let go of your expectations and existing know-how. The Windows way to do things is often not the Linux way. Whenever you need to do a bit of admin or housekeeping, such as installing, removing or updating a program or device driver - don't try the way you know from Windows. Google it first. Usually you'll find simple instructions online and in a lot of cases it's quicker and easier on Ubuntu than the familiar Windows way.
The biggie is installing software.
Windows is just an OS, developed by one big team. The apps come separately, from third parties, so you have to go to them to get the software and future updates.
Linux is different: you get the OS, apps, drivers, media codecs and so on all from your distributor, who has assembled them all into a single, more-or-less integrated whole. So to add more software, and to get updates, you go to the distro-maintainer, not to the original source.
Because everything comes from one place, there's a single central package-management tool which you use for just about everything: installing, removing and upgrading the whole system. The main reason we're recommending Ubuntu is because its tool, APT, is the best, and stomps all over the rival RPM system used by Red Hat, Fedora, Mandriva, openSUSE and their relatives. It makes Control Panel | Add and Remove Programs look like a sharpened rock tied to a stick.
What you don't do is get program executables from unknown sources (such as downloading them from the web) and run them, like on Windows. Unix isn't trusting like that. So if you download a file off a website – even a special Linux program – you can't run it by double-clicking it, nor even from the command line. This is intentional, to keep you safe. From the Unix perspective of Ubuntu's creators, this is not a problem or a bug or a drawback, it's how it should be, so it's not going to go away or change.
Most of the time, you'll never see APT itself - it has various friendly graphical front ends, such as Synaptic (under System | Administration) and the dead-easy Ubuntu Software Centre. Either way, whenever you want to install or upgrade a program, APT fetches it for you, over the internet, from a local mirror of one of Ubuntu's continually-updated repositories, which contain the latest versions of well over 10,000 programs, including pretty much all the most popular open source applications. It's rare to have to download and install anything manually and it's best avoided until you're familiar with the system.


How to install

All right, enough preaching, so how do you do it, then?
Even if you never see it again and only use the graphical tools, for getting your shiny new Ubuntu box ready to actually use, you can't beat doing it the original way, from the command line.
But first, a word about installation. It's very straightforward – it's pretty much a case of putting in the CD, booting up, and clicking the "Install" button. Before you begin, connect your PC to the internet, using a cable, not wireless. Wireless LANs are one of the worst remaining driver problems for Linux, but sorting this out is vastly easier if you're already online. In fact, a lot of initial driver niggles will go away if you just update and reboot. If you've already created your partitions as described in part two, choose a manual installation and tell it which ones to use for "root" (the system disk), "/home" (your data) and swap. Just use the default disk format, ext4.
Once it's done, reboot, remove the CD and watch Ubuntu come to life.
So long as it can reach the internet, a couple of minutes after you boot an Ubuntu PC for the first time, it will go online and check for updates on its own. It may also prompt you that drivers are available for some of your hardware, but do the updates and reboot first.
If you can't wait, you can update it manually from the command line. To get to a command prompt, go to the Programs menu at top left and move down to Accessories, then click Terminal.


Getting down to it: Flash, Java, MP3 and so on

First, you need to tell APT to refresh its memory – to fetch the latest list of packages from the repositories. Type:
sudo apt-get update

The "sudo" command means to do this command as the SuperUser – that is, as the administrator. It'll ask you for a password; just enter your own. You'll see rows of text go past as it gets the latest info. Next, type:
sudo apt-get dist-upgrade
This will upgrade all installed software – operating system, apps, the lot – in one go. It's like Microsoft Update on steroids, only it does all your third-party apps as well. If it finds everything is already current, it will say: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
That's a good sign. Otherwise, it will ask you for permission to continue – just say yes to everything. If you're really keen, you can manually do this yourself every day, but there's no real need – Ubuntu's update manager will check daily for you and pop up and tell you if updates are available. (This, incidentally, is one of the areas that Ubuntu and its relatives score over rivals such as Mepis and PC-LinuxOS.)
Now onto the real stuff: installing those nasty proprietary (or semi-proprietary) bits and bobs that power the fun bits of the web and so on.
sudo apt-get install ubuntu-restricted-extras icedtea6-plugin
This installs two packages, but APT automatically sucks in dozens of other requirements: the installer for the latest Adobe Flash player, Java, support for MP3, MP4 and more.
You have to admit, it's a lot easier than going to Adobe.com, downloading the Flash installer, running it, then going looking for MP3 codecs, downloading them, installing them, then video codecs – and all that.
That's it. Your copy of Ubuntu can now play MP3 or rip CDs to MP3, display web pages with Flash and Java, handle most common video formats and more.
Finally, there are a few things that are good to have, but aren't legal in some parts of the world – for instance the USA, due to the DMCA. This means have to look outside the Ubuntu standard repositories. We probably ought to insert a disclaimer here: check if you're allowed to do naughty things like watch DVDs on your own Linux computer in your country before continuing.
The easiest way to get this code – and several other useful extras – is by adding a new repository from a project called Medibuntu. The Medibuntu instructions are on the site, but in brief, copy this and paste it into your command prompt:
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
After this, you can just install the last few bits:
sudo apt-get install app-install-data-medibuntu apport-hooks-medibuntu libdvdcss2 w32codecs
This adds entries for the new toys in the GUI, but more importantly, DVD support and the Windows media codecs. (If you're running 64-bit Ubuntu, use "w64codecs" instead.) Ideally, read the instructions on the Medibuntu site.
That's about it. By typing – or copying-and-pasting – just five lines, you've installed all the media codecs and components for Ubuntu to be a fully-fledged citizen of the 2010 Interweb and got past the problems that put most people off it. You should find that even locked-down stuff like Quicktime movies will play seamlessly in Firefox.


Final reminder

Apart from this stuff, remember, when it comes to doing stuff that you know how to do on Windows, don't try the same method on Ubuntu until you've had a quick look at Google to see whether it's the appropriate method.
It doesn't take long to adjust. Give Ubuntu a go for a few weeks and you may well find you don't want to go back to Windows.

0
5:36 pm 24/06/2010

griffin

I'll have to check and see if I have a few spare partitions, I wouldn't mind giving mint a shot.

0
6:49 pm 24/06/2010

Foxblood

Quote by griffin:
I'll have to check and see if I have a few spare partitions, I wouldn't mind giving mint a shot.


Here's my Mint desktop:

0
7:19 pm 24/06/2010

mynameis

Nice buntu logo.

0
7:27 pm 24/06/2010

Flee

so is the linux crowd bowing to peoples Windows desires?

that taskbar looks very familiar

2
11:08 pm 25/06/2010

Foxblood

I spent about two hours installing Mint, Firefox extensions, speeding up Open Office, you know, the usual. I've also spent at least twenty times as long dicking around with Conky.

0
11:42 pm 25/06/2010

mynameis

Quote by Foxblood:
dicking around with Conky.

That sounds familiar.

Add Comment

via teoti, or register to add a comment!