Redhat Linux Tips & Tricks

Estimated read time 2 min read

Here are some useful tips and tricks for running Redhat Linux systems , from version 5.1 to 8.0. Some may be helpful to you. Some may be out of date. Some may be obvious in the manual, but who ever reads those?

NOTE: You need to be root to do most of these!

RPM commands lock up or freeze

Sounds like the RPM database has been corrupted.

  1. cd /var/lib/rpm
  2. db_verify Packages (only salvagable if this is ok)
  3. rm -f __db.*
  4. rpm -vv --rebuilddb
  5. Cross your fingers!

Adding new TrueType fonts

  1. Make a new directory, say /usr/X11R6/lib/X11/fonts/MyTTFdir
  2. Copy your .ttf font files into there
  3. cd /usr/X11R6/lib/X11/fonts/MyTTFdir
  4. ttmkfdir to make the fonts.scale file
  5. mkfontdir to make the fonts.dir file (needed for TTF fonts?)
  6. chkfontpath --add=/usr/X11R6/lib/X11/fonts/MyTTFdir (or manually by editing /etc/X11/fs/config)
  7. service xfs restart (or /etc/init.d/xfs restart)
  8. chkfontpath --list to see if MyTTFdir was added
  9. xfontsel to browse/view available fonts

CD Burning

  • cdrecord -scanbus to find out the SCSI ID X,Y,Z of your burner (usually 0,0,0)
  • cdrecord -v dev=0,0,0 blank=fast to fast blank a CD-RW
  • cdrecord -v dev=0,0,0 blank=all to thoroughly blank a CD-RW
  • mkisofs -v -J -r -o mysrcdir.iso mysrcdir to create an ISO image of all files in directory mysrcdir
  • mount -t iso9660 -o ro,loop mysrcdir.iso /mnt/cdrom to check that the ISO image is OK before burning
  • mkisofs -v dev=0,0,0 speed=10 -data mysrcdir.iso to burn ISO image at 10x speed
  • cdrecord -dummy ... will do a dummy write for testing
  • cdrecord driveropts=burnproof will turn on ‘burnproof’ settings
  • mkisofs -v -J -r . | cdrecord -v driveropts=burnproof speed=10 dev=0,0,0 - will avoid creating an intermediate ISO image
  • mount /mnt/cdrom to mount the CD
  • cdrecord -v speed=10 dev=0,0,0 -pad -audio *.wav will burn an audio CD of .wav files

The /etc/profile.d/ directory

Most people know about /etc/profile script which gets run for each new shell, setting up ‘global’ environmental variables etc.

Well, the /etc/profile.d/*.sh (for sh-style shells: sh, bash, bash2) and /etc/profile.d/*.csh (for csh-style shells: csh, tcsh) are also run. It’s a nice clean way to easily plug settings (like $PATH) in and out for new programs you can’t get RPMs for.

You May Also Like

More From Author