Tuesday, December 23, 2008

10 Things You Should Do Immediately After Installing Ubuntu 8.10

10 Things You Should Do Immediately After Installing Ubuntu 8.10




Ubuntu

The latest version of the popular Linux distribution Ubuntu, code named as Itrepid Ibex (Ubuntu 8.10), has been released to the public. You can download it here or even get a CD shipped to you absolutely free of cost.

In today’s Linux Gyan, we help you get-things-working once you have installed the Intrepid Ibex. Most people expect certain functions to work out-of-the-box in a modern operating system. Features like MP3 playback, DVD authoring and playback, DivX support, flash player etc to name a few. Unfortunately, due to certain ethical reasons, Ubuntu doesn’t provide such features out of the box.

Though the users are free to add these features themselves, it is always a pain in the neck to figure out all the various procedures involved and then apply it. This post will help you in getting all the required information on a single page (but you’ll still have to do the ‘applying them’ part yourself). Make sure that you book mark this page.
1. Add the Medibuntu Repository

Medibutu stands for Multimedia, Entertainment & Distractions In Ubuntu and is a repository of packages that cannot be included in Ubuntu due to legal reasons. We need to add this repository to enable MP3, DVD playback, install certain codecs etc.

Take a terminal and enter:
sudo wget http://www.medibuntu.org/sources.list.d/intrepid.list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update


Now we’ll enable all repositories (including Universe and Multiverse repositories) that Ubuntu provides. Take a terminal and enter:

sudo sed -i -e "s/# deb/deb/g" /etc/apt/sources.list && sudo apt-get update


2. Enable Playback of Encrypted DVDs in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

sudo apt-get install libdvdcss2

3. Playing MP3, WMA, Real and Apple QuickTime Files in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

For a 32 bit machine:

sudo apt-get install w32codecs

For a 64 bit machine:

sudo apt-get install w64codecs


For a PPC machine:

sudo apt-get install ppc-codecs

4. Install Skype in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

sudo apt-get install skype

5. Install Adobe Acrobat Reader in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

sudo apt-get install acroread


6. Install Google Earth in Ubuntu 8.10

Take a terminal and enter:
wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin && chmod +x GoogleEarthLinux.bin && ./GoogleEarthLinux.bin

7. Install VLC Player in Ubuntu 8.10

VLC is the media player that is said to play all media formats under the sky. Install it by running the following command from a terminal:

sudo apt-get install vlc


8. Installing OpenOffice 3.0 in Ubuntu 8.10

Take a terminal and run:

echo 'deb http://ppa.launchpad.net/openoffice-pkgs/ubuntu intrepid main' >> /etc/apt/sources.list.d/openoffice.sources.list && sudo apt-get update


9. Install Flash Plugin for Firefox in Ubuntu 8.10

The latest flash plugin (Flash player 10) can be installed using this command:

sudo apt-get install flashplugin-nonfree


10. Install Google Picasa in Ubuntu 8.10

F-Spot sucks if compared to Google Picasa. Run this command from a terminal to get Google Picasa:

sudo echo 'deb http://dl.google.com/linux/deb/ stable non-free' >> /etc/apt/sources.list && sudo apt-get update && sudo apt-get install picasa


What else do you do immediately do after installing a new distro? Share with us in the comments.

Monday, December 22, 2008

How do I start chrooted httpd with Centos OR Redhat

Red Hat / CentOS: Chroot Apache 2 Web Server

by Vivek Gite [Last updated: December 22, 2008]

A chroot on Red Hat / CentOS / Fedora Linux operating changes the apparent disk root directory for the Apache process and its children. Once this is done attacker or other php / perl / python scripts cannot access or name files outside that directory. This is called a "chroot jail" for Apache. You should never ever run a web server without jail. There should be privilege separation between web server and rest of the system. In this quick tutorial, you will learn about securing an Apache 2 web server under Red Hat Enterprise Linux / CentOS Linux using mod_chroot.

Requirements

  1. Server: Apache 2 Web server
  2. Jail directory: /httpdjail
  3. User / Group: apache / apache (never ever run chroot using root user)
  4. Virtual domain directory for all domain inside jail: /home/httpd
  5. Instructions are tested under CentOS / RHEL 5.x

More about Jail directory: /httpdjail

Create a jail directory as follows:
# J=/httpdjail
# mkdir $J

  1. Do not create /dev directory
  2. Do not create special device files inside jail.
  3. Do not copy shell or any other executable files inside jail.
  4. if possible mount $J using a separate partition with nosuid, nodev and noexec options. This will improve security as user will not able to run suid enabled programs and device files inside a jail.

Install Apache, PHP and MySQL

Install required packages, enter:
# yum install mysql mysql-server httpd php-mysql php-par php-xml php-mysql php-cli php-imap php-gd php-pdo php-dv php-mbstring php-common php-ldap php httpd-devel

Now, create required directory inside a jail:
# mkdir -p $J/var/run
# chown -R root.root $J/var/run
# mkdir -p $J/home/httpd
# mkdir -p $J/var/www/html

Install mod_chroot

mod_chroot makes running Apache in a secure chroot environment easy. You don't need to create a special directory hierarchy containing /dev, /lib, /etc. mod_chroot allows you to run Apache in a chroot jail with no additional files. The chroot() system call is performed at the end of startup procedure - when all libraries are loaded and log files open. Download mod_chroot using wget command:
# cd /opt/
# wget http://core.segfault.pl/~hobbit/mod_chroot/dist/mod_chroot-0.5.tar.gz

Untar it:
# tar -zxvf mod_chroot-0.5.tar.gz
Compile and install mod_chroot for using apxs, enter:
# cd mod_chroot-0.5
# apxs -cia mod_chroot.c

Configure Apache mod_chroot

Open /etc/httpd/conf/httpd.conf file, type:
# C=/etc/httpd/conf/httpd.conf
# vi $C

Set PidFile path in which the server should record its process identification number when it starts. Find line that reads as follows:

PidFile run/httpd.pid

Replace with:

PidFile /var/run/httpd.pidM

Next add ChrootDir directive, enter:

ChrootDir /httpdjail

Find line that read as follows:

ServerRoot "/etc/httpd"

Append following lines:

LockFile /var/run/httpd.lock
CoreDumpDirectory /var/run
ScoreBoardFile /var/run/httpd.scoreboard

Make sure mod_chroot.so line exists. For example, 64 bit Linux should have line as follows:

LoadModule chroot_module      /usr/lib64/httpd/modules/mod_chroot.so

32 bit Linux config line:

LoadModule chroot_module      /usr/lib/httpd/modules/mod_chroot.so

Save and close the file.

Disable SELinux for Apache

You need to disable SELinux for apache, enter:
# setsebool httpd_disable_trans 1
See article "disable SELinux for only Apache / httpd in Linux" for further details.

Patch up /etc/init.d/httpd.conf

Open /etc/init.d/httpd.conf file, enter:
# vi /etc/init.d/httpd.conf
Find out line that read as follows:

# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}

Add following line (set ROOT to $J):

ROOT=/httpdjail

Find stop() that read as follows:

stop() {
echo -n $"Stopping $prog: "
killproc -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

Replace it as follows (you need to link /var/run/httpd.pid to $J/var/run/httpd.pid; so that stop operation works):

stop() {
/bin/ln -s $ROOT/var/run/httpd.pid /var/run/httpd.pid
echo -n $"Stopping $prog: "
killproc -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

Save and close the file. Set immutable permission on /etc/init.d/httpd so that file cannot be modified, updated by yum, deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute:
# chatter +i /etc/init.d/httpd.conf

How do I start chrooted httpd?

Type the following command:
# /etc/init.d/httpd start
You should not see any error in /var/log/httpd/error_log file:

[Sun Dec 21 18:43:09 2008] [notice] core dump file size limit raised to 18446744073709551615 bytes
[Sun Dec 21 18:43:09 2008] [notice] SELinux policy enabled; httpd running as context root:system_r:initrc_t
[Sun Dec 21 18:43:09 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Dec 21 18:43:09 2008] [notice] Digest: generating secret for digest authentication ...
[Sun Dec 21 18:43:09 2008] [notice] Digest: done
[Sun Dec 21 18:43:10 2008] [notice] mod_chroot: changed root to /httpdjail.
[Sun Dec 21 18:43:10 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations

How do I stop chrooted httpd?

# /etc/init.d/httpd stop

How do I restart chrooted httpd?

# /etc/init.d/httpd restart

Thursday, December 18, 2008

How to configure Citycell Zoom USB Modem for Linux (EC325)

Today I have configured the CDMA USB modem (HUWAEI EC325) provided by citycell with their zoom connection to use in my linux distro (Mandriva Spring 2007) - Heres how to-

Attach the modem with your pc/laptop

1. check if the USB device is detected properly
cat /proc/bus/usb/devices

you will get some output like this

…..
…..
T: Bus=02 Lev=01 Prnt=01 Port=05 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=12d1 ProdID=1001 Rev= 0.00
S: Manufacturer=Huawei Technologies
S: Product=Huawei Mobile
S: SerialNumber=HUAWEI EC3X1
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=pl2303
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
E: Ad=8a(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=0b(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=pl2303
E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
…..
…..

2. Now probe for this USB device
modprobe usbserial vendor=0×12d1 product=0×1001

3. Now check with dmesg if it has been successfully probed
dmesg

you will get some output like this

[ 2315.412106] usbcore: registered new interface driver usbserial
[ 2315.412508] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 2315.461938] usbcore: registered new interface driver usbserial_generic
[ 2315.461945] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[ 2315.480382] drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
[ 2315.480414] pl2303 2-6:1.0: pl2303 converter detected
[ 2315.480608] usb 2-6: pl2303 converter now attached to ttyUSB0
[ 2315.480620] pl2303 2-6:1.1: pl2303 converter detected
[ 2315.480691] usb 2-6: pl2303 converter now attached to ttyUSB1

4. Now configure your wvdial.conf as shown here.
vi /etc/wvdial.conf

[Modem0]
Modem = /dev/ttyUSB0
Baud = 230400
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
[Dialer cdma]
Username = waps
Password = waps
Phone = #777
Stupid Mode = 1
Inherits = Modem0

Now save this file

You are done!!

Now you can connect to internet by applying the following command in shell

wvdial cdma

Thats it!



Collect from http://hasin.wordpress.com/

Monday, December 15, 2008

How to Install Software using Gentoo Emerge

Installing software using Gentoo Emerge
http://learn.clemsonlinux.org/wiki/Gentoo:emerge

Installing Binary Files and Scripts (.BIN/.SH)

Binary files (.BIN) and shell scripts (.SH) are another popular format for distributing applications, particularly in the commercial, closed-source world. A good example of this are the Quake 3 and Doom 3 games from id Software. Basically all these files are is a list of commands that are run inside a terminal to copy, move, and create files in your file system. You can run these files like so:

For BIN files:
1. Make sure the file is set to "executable" by running this command:
Code:
chmod +x NameOfYourFile.bin
2. Run the file like this:
Code:
./NameOfYourFile.bin
NOTE: If the installer requires access to directories outside of your /home/ directory, you may need to log in as root before you can execute these commands successfully. That can be accomplished with the su command, followed by your root (Administrator) password. Ubuntu users will use sudo and their regular user password instead.

For .SH files:
1. Make sure the file is executable by following Step 1 above.
2. Run the file either with the same command as the previous Step 2, or like this:
Code:
sh NameOfYourFile.sh
_________
Further reading

Copyright, Re-Printing, and comments

This document is copyright Jason Lambert, 2004.

The mandrake section is contributed by jeremy1701 and is copyright jeremy1701 2004.

The Debian apt-get section was originally written by Jason Lambert and revised by antidrugue in 2006.

The .BIN/.SH section was contributed by techieMoe.

You may not re-produce or reprint this document in part or in full without my prior written permission..

If you would like to request permission to re-print any part of this document, please send me a private message on the forums.

The mandrake section may not be reprinted without written permission of jeremy1701

All trademarks remain the property of their owners etc.

If you have a comment about this howto, please Email Me. Please do NOT email me or send me a private message asking for technical assistance. If you need help please post on the forums!


-- EOF --

Note: This message was broken into smaller, more manageable chunks and reposted by techieMoe.

Installing slackware packages

Installing slackware packages
Slackware packages are usually .tgz files containing pre-built binaries. To install software in slackware you will need to find and download the .tgz package manually beforehand. If you are looking for a slackware package for a piece of software and have not found it yet, search Linux Packages for it.

Ok, once we have our package, lets install it. To install slackware packages, ensure you are the root user using the command:
Code:
su
Now run the following command to install the package:
Code:
installpkg 
Uninstalling a package is also quite simple:
Code:
removepkg 
Also worth noting about slackware packages, is a utility called pkgtool which will allow you to install, remove and list packages on your system. To use pkgtool, run:
Code:
pkgtool
and follow onscreen prompts.

Anyone who likes the debian apt-get system but is currently using Slackware may be interested to hear about a utility called slapt-get, the Slackware answer to apt-get. Slapt-get is avaible from Here. There is also a nifty Gnome/GTK front end for slapt-get in development, you can preview it at the same url.

Lastly, if you are having trouble locating a slackware package, but have been able to find a equivilent RPM, you can "convert" that RPM to a slackware package which you can use with the installpkg and removepkg commands. To convert your RPM to .tgz, use the command:
Code:
rpm2tgz .rpm
__________________
Registered Linux user #270181

Installing with fedora / yum

Installing with fedora / yum
Most of the same commands used with Debian's apt-get are used with yum, such as

yum install
yum remove
yum update


For a more detailed set of instructions, look here:

http://www.fedorafaq.org/#installsoftware
__________________

Installing software on Mandrake with urpm

Installing software on Mandrake with urpm
urpm is a nifty was to install software on any 7.x or greater Mandrake system. Some of the advantages of Mandrake's urpm utilities are:

* It automatically solves package dependencies issues by installing or uninstalling dependent packages.
* It installs packages and dependencies directly from the internet.
* It allows globbing of package names
* It will automatically update your system.
* It will install all those "not allowed to distribute" programs that you really want to have (DVD support, MP3 enoders, etc...)

How do I install urpm?
urpm should be installed by default on any modern Mandrake distobution. If it's not, you can install it using the Mandrake Control Center (MCC).
urpm Commands
urpmi

The most commonly used command is urpmi. This command allows you to install packages from your configured sources (see below). urpmi will try to install all package dependencies. It will also take partitial names and give you a list of available packages. For exmaple, if you wanted to install one of the kdemoreartwork styles, but didn't know the exact name, you simple type

Code:
[root@cayanne ~/]#urpmi kdemoreartwork
and it should return a list of packages not already installed on your system. This also means it will install the most up to date package for your system, you don't have to know which version you're looking for. As an exmaple, you may wish to add DVD Play back support to your computer. This can be done by installing any video player, such as Xine or MPlayer, along with the package libdvdcss. Rather then having to type in urpmi libdvdcss-1.2.1-1.i386.rpm, you can simply type in

Code:
[root@cayanne ~/]#urpmi libdvdcss

urpme
The urpme command deletes, or erases, currently installed packages and all packages depandant on that it.

urpmq
The urpmq command searches for, or queries, for packages that you list.

urpmf
The urpmf command does an advanced search for a filename in all known packages. For example if we are trying to compile a program and the configure script is complaining about not finding ncurses.h, we can do a urpmf ncurses.h to find that it is part of the libncurses5-develpackage.

Code:
[root@cayanne ~/]#urpmf ncurses.h
libncurses5-devel:/usr/include/ncurses.h
libncurses5-devel:/usr/include/ncurses/ncurses.h
php-devel:/usr/src/php-devel/extensions/ncurses/php_ncurses.h

urpmi.addmedia
urpmi.addmedia does exactly that, makes an rpm reposatory available for urpm to utalize. Typically, you have your installation cd's available as a default media, these are called main. In addition, you also have three other media - updates,contrib and PLF. Updates is the updates, and contrib is user contributed rpm's and PLF is all those not available for distribution for so-called legel reasons rpm's. The sysntax for urpmi.addmedia is

urpmi.addmedia [media-name] [ftp-address with] ../base/hdlist.cz
Note that the hdlist.cz is required. For example, to add medium 'contrib', we use the following command

Code:
[root@cayanne ~/]#urpmi.addmedia contrib ftp://ftp.sunet.se/pub/Linux/distributions/mandrake/updates/8.2/RPMS with ../base/hdlist.cz
added medium contrib
retrieving description file of "contrib"...
...retrieving done
retrieving source hdlist (or synthesis) of "contrib"...
...retrieving done
examining whole urpmi database

urpmi.removemedia
This command removes specified media. Need I say more?

urpmi.update
The urpmi.update command goes through all of your media sources and updates your installed packages if necessary.

How do I set up urpm?
urpm can be set up using MCC, but I've personally found the instructions at the web-site http://easyurpmi.zarb.org to be a little easier. Either way, you can use the site along with MCC or the console to add media. Simple follow the step-by-step instructions, and enter the command it prints out in the grey box into any terminal window, as root of course. You can even copy and paste the command, there's no need to type it all in.

Now that you're up and running with urpmi, try to install a few packages! Have fun!

Where can I get more info?
Here's couple of places to get more info (these are the places where I got my references):

Mandrake FAQ
Mini How-To

Some site in Texas

Installing software with Apt-get

Installing software with Apt-get

APT (Advance Packaging Tool) is a wonderful package management system. It consists of different tools, which names usually begins with "apt-" : apt-get, apt-cache, apt-cdrom, etc. Unlike RPM, which equivalent in a Debian system would probably be DPKG, apt-get handles dependencies resolution and takes care of downloading the software for you (much like YUM in a Red Hat system).

Though apt-get is generally used to install binary packages, it also can build and install source packages (like Gentoo's emerge). One can further more ease the process of installing software by using Synaptic (Graphical Interface), which is considered more featured APT frontend.

aptitude
is a terminal-based apt frontend with a number of useful features, including: a mutt-like syntax for matching packages in a flexible manner, dselect-like persistence of user actions, the ability to retrieve and display the Debian changelog of most packages, and a command-line mode similar to that of apt-get. One should use aptitude to install meta-packages because aptitude keeps log of all packages that are part of meta-package. Its easy to remove/un-install meta-package in one go with aptitude.

One must have root privileges to execute apt-get or aptitude commands. Execute 'su' in Debian and prefix 'sudo' in Ubuntu to gain root privileges.

apt-get depends on Debian packages repositories (where are stored both sources and binary packages) that can be configured in the file /etc/apt/sources.list. A typical Debian stable sources.list would look something like this :
Code:
#Local Mirror
deb ftp://ftp.us.debian.org/debian/ stable main contrib non-free
deb-src ftp://ftp.us.debian.org/debian/ stable main contrib non-free

#Security Updates
deb ftp://ftp.us.debian.org/debian-security/ stable/updates main contrib non-free
deb-src ftp://ftp.us.debian.org/debian-security/ stable/updates main contrib non-free
APT includes a tool called apt-setup, which can be summoned from the command line, to help you configure a proper /etc/apt/sources.list file, optimized for your needs and geographic location.

One can also configure APT to follow the testing or the unstable distribution of Debian.

Once the user has a sources.list adapted to his/her needs, the local list of packages needs to be updated :
Code:
apt-get update
Only then can the repositories be browsed with apt-cache.

To search a package from its text description :
Code:
apt-cache search 
Replace with an application name or word. For example,
Code:
apt-cache search irc client
will display a list of several irc clients.

To know more about a package and its description (dependencies, functionnalities, maintainer's identity, etc.) :
Code:
apt-cache show 
In this case you have to replace with the exact package name.


Installating a binary package is done in one single step :
Code:
apt-get install 
Another neat feature of apt-get : it allows to build and install a source package. Minimally, two steps are needed in order to do that. First install the package dependencies :
Code:
apt-get build-dep 
Secondly tell apt-get to build and install the package itself :
Code:
apt-get source -b 
For example, installing the email client "pine" can be done like that :

Code:
apt-get build-dep pine
apt-get source -b pine
Uninstalling a package is done like this :
Code:
apt-get remove 
Or if you wish to remove the package along with all of its configuration files (essentially doing a clean uninstall):
Code:
apt-get remove --purge 
A word of caution : apt-get handles dependencies in a very strict manner. If you try to uninstall a piece of software that other pieces of software depends on, apt-get will also want to uninstall them (not before warning you about the situation).

Further reading : Debian Reference, Chapter 6 - Debian package management
For the impatient : Debian Quick Reference, Chapter 3 - Debian package management

Installing RPM's using the Redhat Package Manager

Installing RPM's using the Redhat Package Manager
Redhat RPM's offer a flexable and easy method to install new software. Software installed from an RPM package differs from compiling from source in a few ways, but the most important one of all is the software is already compiled for you. Essentially all you are doing is extracting the pre-built binaries and copying them to their pre-selected destination. RPM's are files that have a ".rpm" extenstion. The good point about RPM's is installation of new software, and maintaining the software currently installed is much easier than doing so for individual packages compiled from source. The downside to RPM's is that you dont have as much choice about where software is installed on your system, how it is compiled, and how it is configured.

Using the RPM system is fairly straight forward. To install a package, you can use the following command:
Code:
rpm -i 
When using rpm, you must be logged in as the root user. The "-i" flag in the above command means "install".

Un installing a package is just as easy:
Code:
rpm -e 
The "-e" switch used here means "erase" (un install).
Note that is different from used when installing.


For example, if you are installing an application called "mysoftware", you may use a command like "rpm -i mysoftware-1.0.2-i386.rpm" to install "mysoftware", when removing we dont follow the filename for installation, but rather the name of the software itself.

For further uses of RPM, please use "rpm --help" and "man rpm". Also see this page, which has some fairly useful information.


If you need to find & download the RPM file for a piece of software, I recommend using
RPM Find and RPM Pbone Search Note that not all applications are available as RPM's, in these cases you will need to compile the software from source. (see above).

Compiling and Installing software from source

Compiling and Installing software from source
Some software is distributed in "Source form". This means you download a file containing all the source code for the application you want to install, unpack it, and compile it on your system. Compiling is the process of turning the source code into an executable binary. The common myth and newbie assumption is that this is very hard todo, or it is only for programmers. Wrong. It is a fairly straight forward process, and you will find that a lot of software you install will need to be built from source.

Typically applications you must compile from source will come as a ".tar.gz", ".tar.bz2", or ".zip" file.

You'll probably want to operate from inside your home directory. If your user is (for example) username, your home directory will be /home/username/. For the rest of this section we will assume you have downloaded your zip file to /home/username/src. If you do not have a src directory, you can create it with the following "mkdir" (make directory) command:

Code:
mkdir /home/username/src/
So, we have our source package in /home/username/src/.

Change to the /home/username/src/ directory with the "cd" (change directory) command like so:

Code:
cd /home/username/src/
Use the "ls" (list directory contents) command, to see the file is present:

Code:
ls

We now need to unzip the zipped file, this is done differently depending on the file extension.

for files ending in .tar.gz, use:
Code:
tar -zxvf 
(replacing with the name of the file).

for files ending in .tar.bz2, use:
Code:
tar -jxvf 
for files ending in .zip, use:
Code:
unzip 
You should now have a new directory, containing all of the source files. To confirm it exists, and to get its name, use the "ls" command again.
Code:
ls
we now need to go into the new directory, so use the cd command:
Code:
cd 



This is where things will differ. Some packages will have an INSTALL or README file which will contain installation instructions. use "ls" to see if the software has an install or readme file. If it does have one, you can use the "more" command to read it, like so:
Code:
more INSTALL
Generally, the final 3 stages are as follows:
- Configure the installation
- Compile the software
- Install the binaries

The pre-installation configuration is done by executing ./configure:
Code:
./configure
This will perform some requirements testing on your system, and create a "Makefile" which will explain to the "make" utility how the software should be compiled. If you receive any error messages during this stage, you may wish to search the forums to see if they have been found and resolved by someone else already, if not, feel free to post a question on the forums - Please include all of the output including any error messages, and some details about your system - what distro you are using, what are you trying to install etc etc


The next stage is to compile the software, this is done using "make". When you run "make" it will read the instructions in the Makefile and build the application binaries.
Code:
make

The final stage is to install these binaries, ie, copy them to a more permanent location. Typically only the "root" user can do this, so you will need to swich to the root user with the "su" command:
Code:
su
Once you are root, install the binaries using the "make" command, followed by "install", like so:
Code:
make install
That is it! Check the user documentation of the software you installed for details of how to run the application.

Remember that if you have any problems, please post in the most relevant section of the forums. - When posting, remember to include as much info as possible, including all output and error messages.
__________________
Registered Linux user #270181
TechieMoe's Tech Rants

Sunday, December 14, 2008

How to copy Specific file from a Dir recursively?

How to copy Specific file from a Dir recursively?

You can also use rsync to grab those files, for example, to get all the text files (ending in ".txt"):

Code:

#rsync -r -f "+ */" -f "+ *.txt" -f "- *" tmp/ temp/

Where "tmp" is the source directory, and "temp" is the destination (it will copy from the source dir, not the source dir itself)

How to copy Specific file from a Dir recursively?

How to copy Specific file from a Dir recursively?

You can also use rsync to grab those files, for example, to get all the text files (ending in ".txt"):

Code:

#rsync -r -f "+ */" -f "+ *.txt" -f "- *" tmp/ temp/

Where "tmp" is the source directory, and "temp" is the destination (it will copy from the source dir, not the source dir itself)