Browsing all articles in How-To's
Jan
3

Howto: Install yum On RHEL 4

There are more than a couple of ways of updating Red Hat Enterprise Linux (RHEL) packages on your machine. One is by using up2date, the default package updater of RHEL systems. Unlike Fedora and CentOS which uses yum, up2date requires you to be registered to Red Hat Network (RHN) to be able to download or update your packages from the RHN repository.

Now, what if you need to install a certain package that is not available in your current repository by up2date? Or what if the package in the repository wreaks havoc in your system? Maybe you should try using yum to install or update rpm packages.

But… but… but how can I install yum in my RHEL machine?, you may ask. It’s actually very simple.

I got this tip from Babar Haq’s Blog with a little modification since I am using RHEL 4.

1. Download yum by using wget

# wget http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.8-1.noarch.rpm

2. Install the rpm

# rpm -ivh yum-2.0.8-1.noarch.rpm

3. Configure /etc/yum.conf to use compatible repository

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-$releasever – Base
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1

[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1

4. Download and install the CentOS GPG Key

# wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4

# rpm –import RPM-GPG-KEY-CentOS-4

5. Test yum to see if it works (I tested by running full update on my machine)

# yum update

*Note: This will update ALL installed packages in your machine. If you do not want to do this, cancel the process or skip this step.

If you reach step 5 without encountering any errors, it means that yum is successfully updating your machine with the latest versions available in the repo. :-h

This worked perfectly fine for me. If you experienced any errors, post a message and I will try to help you out ;)

Dec
23

Setting Up Remote Connection Using FreeNX

Want to remote access your Linux desktop? Or access your workstation similar the way Remote Desktop does it?

While Linux offers a wide array of ways to connect to a remote computer, some people still prefer to connect the traditional way by using ssh. Not only it is secure, it is sure is a fast way of connecting a remote terminal. However, if you want to remotely access your Linux desktop, freeNX can do the job along with NoMachine client.

What is freeNX?

From the official website:

NX is an exciting new technology for remote display. It provides near local speed application responsiveness over high latency, low bandwidth links. The core libraries for NX are provided by NoMachine under the GPL. FreeNX is a GPL implementation of the NX Server.

Linux is to freeNX as Windows is to Remote Desktop. I decided to use freeNX to access my Linux desktop in office if ever I need to.

Setting up freeNx:

freeNX is available for download in source tarballs and distribution packages.I personally use the distribution package for Fedora/Redhat which is available via yum. I am using Fedora 7 so in this case, I will use the steps of setting up freeNX for my distro.

# Make sure you are up-to-date
yum update

# Install FreeNX and all dependencies
yum install freenx

#SERVER SETUP IS DONE! The RPM takes care of the required setup.

That’s it! However, if you are using Fedora versions older than Fedora 5, there is a special how-to for freeNX setup that you might want to check.

Install NoMachine client:

Remote connection also needs a client which is the program you use that connects to your remote server, in this case the freeNX server. In this tutorial, we will be using NoMachine as the client. You can download the NoMachine client here. In my example, I will be using Windows XP for my workstation client so I have to download and install the NoMachine client for Windows. Install the client and run the NX Client for Windows. This will open up a dialog box for your client configuration. Here are the steps you need to setup your client:

  •  When the dialog box opens, enter the Session and Host name for your connection. Session name is the name of your connection and your settings will be saved under this name. Host name is the ip address or hostname and port of the remote machine. The default port is 22 (SSH). Click Next.
  • In the next dialog box, select Unix and choose which type of window manager you want to use and the resolution. In this case I user KDE and Available Area for my resolution. Check the box for Enable SSL encryption. Click Next.
  • If you want to put a shortcut to this connection on your desktop, put a tick on the Create shortcut on desktop checkbox and click Finish.

If you want to open the session, double click the shortcut on your Desktop and type in your username and password for this session. You will be connecting now to your freeNX server and you will see your Available sessions box. Select New to create a new session to begin connecting to your remote desktop. Wait for the desktop to load and voila! You are now connected to your remote desktop.

Aug
4

Partitioning Disks with fdisk

Author Rai    Category How-To's, Linux     Tags

Every computer owner will come across the street road called Partitioning. Partitioning simply means dividing your physical hard drive into 2 or more logical (or virtual) drives. In Linux there are different kinds of applications that can help you do this, and one is fdisk.

For this example, I will demonstrate how to use fdisk.

The basic command goes like fdisk <device-name> like:

# fdisk /dev/hda

The number of cylinders for this disk is set to 14596.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):

To display the help menu or if you want to list all of available commands:

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Now for the action. Let’s say we need to see how many partitions are in the disk.

Command (m for help): p

Disk /dev/hda: 120.0 GB, 120060444672 bytes
255 heads, 63 sectors/track, 14596 cylinders, total 234493056 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 63 30716279 15358108+ 83 Linux
/dev/hda2 30716280 81915434 25599577+ 83 Linux
/dev/hda3 81915435 82975724 530145 82 Linux swap / Solaris
/dev/hda4 82975725 234484739 75754507+ 5 Extended
/dev/hda5 82975788 234484739 75754476 83 Linux

So there are 4 primary partitions – hda1, hda2, hda3 and hda4. The last partition, hda4, is the Extended Partition or the Logical Partition which contains the hda5 partition.

Now that we have seen all the partitions, let us say that we are going to delete the /dev/hda1partition and create a new one.

But before we can create a new one, we should delete the old one first. These steps does not execute the commands at once. If you made a mistake, you can just quit the program without committing any changes.

To delete a partition, just type d on the prompt. For this example, what I want to do is delete the first partition, /dev/hda1:

Command (m for help): d
Partition number (1-5): 1

The partition number means that /dev/hda1will be deleted. To check if we have typed in the correct partition number (I hope I did!) just do:

Command (m for help): p

Disk /dev/hda: 120.0 GB, 120060444672 bytes
255 heads, 63 sectors/track, 14596 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda2 1913 5099 25599577+ 83 Linux
/dev/hda3 5100 5165 530145 82 Linux swap / Solaris
/dev/hda4 5166 14596 75754507+ 5 Extended
/dev/hda5 5166 14596 75754476 83 Linux

Voila! /dev/hda1 is no longer there. But no worries, it is still there. We just need to create a new one.

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
p
Selected partition 1
First cylinder (1-14596, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1912, default 1912):
Using default value 1912

Command (m for help): p

Disk /dev/hda: 120.0 GB, 120060444672 bytes
255 heads, 63 sectors/track, 14596 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 1912 15358108+ 83 Linux
/dev/hda2 1913 5099 25599577+ 83 Linux
/dev/hda3 5100 5165 530145 82 Linux swap / Solaris
/dev/hda4 5166 14596 75754507+ 5 Extended
/dev/hda5 5166 14596 75754476 83 Linux

The n command will create a new partition, in this case, replacing the old /dev/hda1 that we have deleted and the p command will display that we have successfully created a new one (yay!).

To commit the changes, type w on the prompt.

Command (m for help): m
Command action
w write table to disk and exit

But for now we will exit fdisk without saving the changes.

Command (m for help): q

That’s all for fdisk for now. There are other commands available on fdisk, just do not forget the use the man pages and the m command. If you have deleted a big chunk of important files, well, experience is the best teacher ;)

Powered by 1and1.comGlobat Webhosting Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Drop your Card Here

Recent Comments

Site Stats