Tuesday, April 24, 2007

Installing Package In ubuntu using dpkg

If you are using Redhat Linux, you are most probably using rpm or yum as your package manager. in ubuntu, you can use synaptic package manager as your package manager and thankfully it got GUI. But for those who like to learn command based package management in ubuntu, you can use apt or dpkg command.

If you already have any package with .deb extension in your computer, you can use dpkg to install it. First you have to change directory to the directory where the package is stored. Then run: -> dpkg -i namefile.deb
Remember you need to be superuser to do this.

Example on how to install flashplayer using dpkg from /home/oscc/Desktop/tools folder
(click on the picture to see image clearly)

To get more information about dpkg, type:
-> man dpkg

Tuesday, April 17, 2007

Checking installed package

To check installed packages on you redhat machine, this command can be used:
-> rpm -qa
Using this command, all packages installed will be printed to the screen. To filter the view to print only the package that you desire, use this command:
-> rpm -qa | grep packagename
example: -> rpm -qa | grep -i bind
This command can also be used: -> rpm -qa bind*

Viewing system's running processes

To view running processes, you can use ps command to list out the running processes.
To see every process on the system:
ps -e
ps -ef
ps -eF
ps -ely
To find the process that you want to see:
-> ps -e | grep nameoftheprocess

example: -> ps -e | grep httpd
The above command will print only the httpd process.

Yet another rpm building method

There is also another method of converting tarball to rpm instead of using rpmbuild -bb filename.spec. Using the method mentioned before requires the user to extract the tarball file first before we can use it. If we do not want to extract it first, we can use :

1. type ->rpmbuild -tb filename.tar.bz2
2. after the rpm file has been created; use ->rpm -Uvh filename.rpm to install it

That's all.

Wednesday, April 11, 2007

Knowing your linux release

Knowing what operating system and what is the release number are the basic of using any operating system. This information is usually stored in the /etc/ folder in linux. To view it you can type:

For Ubuntu:
cat /etc/lsb-release

For Redhat:
cat /etc/redhat-release

For SuSE:
cat /etc/SuSE-release

This line will be displayed(for Ubuntu):


If you are not sure which file points to this info, you can go to the /etc file, and type:
ls *release
cat lsb-release

Tuesday, April 10, 2007

Building rpm from source file

This is for the Redhat, SuSE and CentOS user out there. Sometimes when you try to search for rpm packages, the only thing that you find is the source file. You create rpm file using this source file:
1. save the source file(usually in tar.gz or tar.bz2 format)
2. extract the files-> tar -xvzf filename.tar.gz or tar -xvjf filename.tar.bz2
3. open the folder of the extracted file and find .spec file
4. type-> rpmbuild -bb filename.spec
5. see the error and continue according to the error until you finish creating rpm files
6. type-> rpm -Uvh filename.rpm to install

Hope this one can help.