[HOW TO] Fedora Core Linux tips (In progress)

Had your computer crash on you, or a website shows wrong, or your printer went dead on you? Come on in...

Moderator: Crew

User avatar
Maz
Admin emeritus
Posts: 1938
Joined: Thu Mar 16, 2006 21:11
Location: In the deepest ShadowS

[HOW TO] Fedora Core Linux tips (In progress)

Post by Maz »

If you're new to Linux, try it. You'll love it. You'll loose your heart to it. I promise. :p

Preface

What's Linux, in a nutshell

Linux is a (the) operating system. Just like Windows, dos or...
Or... Well.. Comparing linux to dos/windows feels a bit like comparing a horse to a pony..

When people start to talk about Linux, you'll heard words like Fedora Core, Redhat, Debian, Ubuntu, Gentoo, Slackware, SuSe... These are called as 'Linux distributions'. Now, Linux consist of kernel, which is the actual 'linux', which really connects the hardware to other software. Distributions contain the kernel + varying amount of other software. All Distributions have basically the same kernel (of course there's differences and different versions of kernels, since Linux is all the time being developed onwards by various seemingly independent groups, and especially Redhat distribution based kernels tend to be somewhat modified).

Perhaps the most beautifull thing in Linux is, that most of the distributions and additional 'third party software' is free. The phrase Linux and the free world is not just something people tend to say. And what's even better is that lots of the programs included in distributions (or distros) is better than the non free windows based competitors. When we add the incredible stability of Linux and the ability to fix & modify things to all this, it's no wonder I have lost my heart to Linux.

Of course there's downsides. Many hardware manufacturers do not develop software for linux, and some are not even willing to give decent documentation about their equipments to Linux developers. That means that some of the hardware is not yet supported by Linux. I said yet, since:

1. I believe manufacturers cannot overlook linux much longer, and many have already noticed it.
2. I bet there's LOT more people developing Linux ALL AROUND THE WORLD, than let's say windows -> problems are usually eventually solved by someone, and since linux software is usually open source, other developers will get the sources to their hands, and soon other distributions have the software available too :)

Another consequence of multible developers are some incompatibilities. It might require some work to get something working. But usually youre not onlyone struggling with the problem, and Google, our dear friend, can often point out the solution to you :)

What's Fedora COre 5 (FC_5)?

Fedora Core is redhat based distribution. In fact, it is sponsored by Redhat, and often things invented when developing FC, are later ported to redhat. (Redhat is one of the rare linux distros that are not free.) FC_5 is the latest version of Fedora, released at this spring, and if word linux makes you to think of old difficult & textbased system, it's time to check it out. Fedora Core 5 is modern OS, with top notch software! It is one of the largest distributions, and there's LOT's of software made for it. It is also one of the easiest distributions to use for beginners, since it has windows like graphical userinterface (X-windowing system & Gnome and/or KDE desktops) Of course it also has (as all linuxes I've ever met) the textbased interface too. So if you really want to have maximum performance for example for a server system, you can leave the X-windowing system out of your installation. Of course the Gnome & KDE desktops have the 'terminal' program too (a bit like Window's command prompt), which can be used just as the text based Linux. (And which is incredibly usefull).

So in a nutshell:
+Easy to use
+Lot's of packages available
-RedHat based -> modified kernel -> some rare drivers may not work without modifications
Last edited by Maz on Wed May 17, 2006 23:32, edited 1 time in total.
User avatar
Maz
Admin emeritus
Posts: 1938
Joined: Thu Mar 16, 2006 21:11
Location: In the deepest ShadowS

Post by Maz »

INSTALLATION

There's plenty of ways you can nstall FC 5. You can use installation CD's. Yes, CDs. FC 5 is shipped in 5 cds. "What 5?" you scream in agony! Yes, 5. Remember that Linux distributions do not only include the OS, but also LOTS of applications. Or you can install it from a single DVD. Or, you can just use rescue CD (~75MB) to start the installation procedure, and install the rest of the packages from network.

starting the network installation
Download the rescue CD from nearest mirrorsite. (Select the nearest from this list.) Write up the link you selected for later use!
Burn it on CD with your favourite burning program. (Notice that you must not just burn the .iso imagefile on CD, you need to make the CD out of the iso imagefile. AT least Nero on windows can do that automatically).

Make sure you have free partition(s)/HDD(s) on the coputer in which you wish to install Fedora.

Boot the machine using the rescue CD.

After loading the vmlinuz image from CD (kernel image), it gives you a view where you have a few options and a command line on what to write.
Type on the line

Code: Select all

linux lang=en_US keymap=fi method=server_you_selected_earlier_from_the_list/5/architecture/os
Now, let's stop for a while and look the command abowe. Command linux just launches the installation. argument lang=en_US specifies US english to be the language of the system. keymap=fi tells that the keyboard to use has finnish keyset. (Change these to those suiting to you :) ) And method= tells what's the installation medium to use. (replace /architecture/ with /i386/ or /ix86_64/ depending on your machine) So, I did my last installation with command:

Code: Select all

linux lang=fi_FI keymap=fi method=ftp://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/linux/core/5/i386/os
I'll later add more detailed installation instructions. (again, if I have time, and if someone else do not wish to continue :D ) more detailed = rest of installation process :D (meanwhile, if you're too anxious, you can get this information from http://fedora.redhat.com/docs/fedora-in ... de-en/fc5/
Last edited by Maz on Thu May 18, 2006 1:20, edited 1 time in total.
User avatar
Maz
Admin emeritus
Posts: 1938
Joined: Thu Mar 16, 2006 21:11
Location: In the deepest ShadowS

Post by Maz »

Getting help with commands (man pages)

As I already mentioned terminal is EFFECTIVE way to use your linux. But of course since there's no commands visible, it requires some memorizing... But but but... What a great feature has been invented! I'm talking about man pages. 99% of linux commands/applications have documentation called man pages. And what's even better, not only linux commands & programs, but also C functions, bash commands, tcl commands... It's incredibly usefull feature, no need to browse dozens of web pages just to find out how to display filesize in human readable format when listing files... Just type 'man ls', and read the switches and their purposes. Soon you spot switch -l, which means detailed list and -h, which means human readable. So press 'q' to quit browsing manpages type 'ls -lh', and voila.

There's one minus side for beginner though... Using manpages requires that you have some idea about the command which to use. After that you can type 'man commandname' to see the explanation. Generally manpages may be a bit hard to understand when using some feature at first time, but after you have once done something, you can just check how it was when you next time need it... (This feature is a must for C programmer... What were the arguments of function strtod()... mmm.. 'man strtod' and voila.. ;) )



Package management (Installing new programs)

Fedora comes with powerfull package management program, yum. You can update, install, search and remove programs with it. It has a beautifull idea. Fedora and some "third party packagers" provide packages (programs) for Fedora over internet. These mirrors are called as repositories. Now, when you wish to install some program, let's say gnuplot for example, you simply open terminal, switch to root user, and type in command 'yum install gnuplot'. (Root user is explained in coming section(s))

Yum then connects to repositories there has been specified either in file /etc/yum.conf or in yum conf directory (which I do not remember just now, and I'm currently using Wirudows). As a default there's 3 fedora's own repository included. Yum searches for package, and checks if it is installed, and if it isn't, it automatically installs it + all other packages it might need to work (if they're available). (Do you now begin to understand why I do like linux?)

Similairly searching for packages is done with command 'yum search packagename', updating 'yum update packagename', and removing 'yum remove packagename'.

use command 'man yum' to get more information.

Warning about yum repositories!!

There's some incompatible repositories. I suggest you to avoid at least mixing 'livna' and 'RPMForge' repositories with each others, since theyr'e rold to be incompatible. (RPMForge is an union of 4 old repositories, DAG, DRIES, freshrpms, newrpms). There's also a warning about using AtRpms (here)

I personally use just fedora's own repositories with RPMForge's repository. When you decide to add additional repositories, look their webpages with google, and there's usually instructions how to include these repos in your yum configuration :) (for example RPMForge provides rpmforge-release-0.2-2.2.fc5.rf.i386.rpm rpm package, which automatically does required changes to your yum configurations It can be obtained for example from http://ftp.belnet.be/packages/dries.uly ... f.i386.rpm :) ) Notice that the acrhitecture in package name should match your FC 5 installation!

Final note about yum... If you're really uncomfortable with text based yum, then you can always write 'yum install yumex', which is graphical user interface for yum :)

It's good for you to know that there's also packagemanager called apt (or apt-get), and many people think it is better than yum. (Oh, and of course there's punch of others too, but I wont include them. If someone wish to add something about them, feel free :) )

RPM packages.

Fedora Core is so called rpm-based distribution where as for example Gentoo is source based distribution. It means that there's already compiled rpm packages available for Fedora Core, whereas for Gentoo you must compile the sourcecodes yourself. Compiling sources makes your computer a bit faster & better, since you can set the optimizations yourself. BUT configuring the sources usually requires SIGNIFICANT amount of knowledge, especially if you want to get some advantage compared to already compiled rpms. It is also much slover than installing binaries.

So RPM package is an installation package. It has .rpm extension, and there's own rpms for different rpm based distributions. There's a rpm program included in your Fedora distribution, which you will use to install rpm packages. I do not really remember the installation options for rpms, but that's why I have the manpages ;) 'man rpm' tells you more. (Ok, I do remember the one I use most, it's 'rpm -Uvh packages' and it can be used to install multible rpms which may depend on each others ;) )
Last edited by Maz on Thu May 18, 2006 1:25, edited 1 time in total.
User avatar
Maz
Admin emeritus
Posts: 1938
Joined: Thu Mar 16, 2006 21:11
Location: In the deepest ShadowS

Post by Maz »

Few words about users & privilegies

Now. One thing that does Linux so secure & excellent system is the privilegies system it uses. Now, there's 3 types of privilegies one can set for files / folders. Those are read, write and execute. As names says, those controll who can write/read/execute a file. Then, there can be multible users for one computer specified. All users should have home folder, which is owned by them, and for which they do have all privilegies. When user creates a file or a folder, it will automatically be owned by him. Owner of a file can set it's privilegies by using chmod command ('man chmod' ;) ).

So summary.
file is owned by some user, and that user can set rights for it.
Rights concern other users according to following chapter, but have a break, and ignore it for a few minutes, since privilegies are really important feature, and REALLY often when something does not work as expected, it is caused by wrong rights.

Now, just so things wouldn't be too complicated, there's also groups where users belong. In Fedora, when new user is created (with useradd command, see 'man useradd'), will a group with same name as the username be created, and the user automatically belongs to it. Many other distributions do create group users, not group username, and put all new users in that group as a default. You can also create other groups, and add users into these too.

Why am I babbling about usergroups now? Simply because it is TIGHTLY linked to rights of files/folders. Files/folders are also owned by a group. In FC 5, if your username is foo, and you create file bar, will bar be owned by user foo, and group foo as default.

So files are owned by user and by group. (user's 'main' (initial is the official term) group). Owner of file (user who owns a file) can now set the rights of the file (read/wite/execute). Different rights can be set for owner, group and others. group in here means all users who belong in the group that owns a file. So, in FC 5, default initial group for user is group 'username'. And since there can be only one user with certain username, it means that if groups are not modified, only one user belongs in the default group of a new file. That's the creator. IE. only creator has group and owner rights as default.

Let's play with thought of users,groups and privileges a bit. Let's assume you have a webserver running on linux/unix. You have websites in there, and a group of developers for that site. Now. How to solve the rights dilemma, so that everyone in developer group can edit the files, but no peoples outside of that group (security reasons!!! Always give minimum rights required for files!).

Answer is simple. Let's do group 'webadmin', and add all developers in that group. Then change all files related to websites so, that their owner is creator, and group is webadmin. Now, only the creator can change the privileges (rights), but when he changes rights so that owner and group has all rights (read/write/execute), and others have only read rights, things work out like a charm. It is also possible to do so, that all new files in certain folder will be owned by certain user and group. Notice that all files you wish to be visible in web, must have read rights given for 'other'! (And folders must have execute rights so apache can get into a folder) (how could they othervice read the files?) (Well, actually the question is that how could webserver ((apache)) othervice read the filecontents...)

root user can override/change all privilegies regardless who owns the file/folder.
root user MUST NOT be used in vain. That's wery wery wery easy way to cause hazards!

Summary:
There can be multible users, root user is 'superuser'
Theres read/write/execute rights for files/folders
There's groups. One initial group/user but and one user can belong into many additional groups.
Always use minimum privilegies required, that way for example viruses cannot execute your scripts, unless you install them as root.
Never use root user if not absolutely necessary.

Finally some commands (I'll add more if I remember when I'll boot on linux)

Creating user
useradd <username>
(must be run as root)
Creating/changing the password for user
passw username
if username is not specified, your password is changed. If you run the command as root, and specify some other username, passwrod for that user is changed/created
Changing file/folder modes (rights etc)
chmod <specify rights/modes> filename
Examples:
chmod a+rwx filename -> sets +rwx (read/write/execute enabled for all users)
chmod u-rx -> (read/execute disabled from u (user = file owner) ) do not mix o and u. o=other, not owner, u=owner
chmod o+r (read enabled for other)
chmod g+w (write enabled for group)

If you wish to change rights for all files in a folder&subfolders, you can use switch R like
chmod -R a-rwx foldername (all rights away from all users for all files in that folder & subfolders)

You can also use * and ? as wildcards in filenames. * is familiar, and ? means that character in that spot can be any character.

View rights
ls -l (lists folder contents, and appends corresponding rights after filename in format
rwxrwxrwx or --------- where first 3 letters are owner's rights, middle 3 groups and last 3 for other)
Change owner
chown user:group <filename>
(must be run as root)
User avatar
Maz
Admin emeritus
Posts: 1938
Joined: Thu Mar 16, 2006 21:11
Location: In the deepest ShadowS

Post by Maz »

mp3s, dvds, multimedia generally

Fedora does not support mp3s and various other multimedia related things as default, due to the legal and ethical issues. You can read more about those from fedora's sites.

Anyways, there's those third party repositories, you can use to get needed software for playing almost all dataformats. (okay, I admitt. That's the weak spot of linux, and mostly due to the fact that many of the codecs creators
a) have a strict licence policy.
b) keeps their codecs details as secrets and still do not develop linux versions themself . :evil:

Well, I will not write complete howto myself, since here's one and google can tell you more. You might need to use livna or atrpms to install the multimedia things (I used Atrpms), but I strongly suggest you to disable these repositories afterwards (either edit /etc/yum.conf file ((comment out lines belonging to livna / atrpms repositories)) or if they're enabled by adding them in configfiles in /etc/yum.conf.d/, just change the fileextension of those configfiles.

I think the guide which I linked in this post is decent (I did not read thru it completely), but I suggest you to install mplayer ( after adding repository that provides it do 'yum install mplayer' ) for mpgs etc. You probably also want to install codecs for movies.. Do some searching since I do not remember codecs (except for w32codecs pack, which allows to watch wmv packed movies :D )

here's ( FedoraNEWS.org)
also a rpm package, which installs mplayer plugin so that you can use mplayer to play movies embedded in webpages :) (use rpm -Uvh packagename) after download. Of course this plugin is just plugin, and requires mplayer to be installed before it works :D