Linux FAQ

 

A list of basic questions. For more advanced Techniques, see Linux Administrator & Developer's Reference

Install Debian + XP in computer
Install Ubuntu in a laptop
How to know a Linux version?
How to install rpm package?
How to get IP Address from DHCP?
How to configure network?
How to use CVS?
How to switch user with a login shell (profile script running)?
How to Set date?
How to switch to root user?
How to send out e-mail?
How to display Chinese in Mozilla
How to use "patch"?
Upgrade kde from 3.3 to 3.5
Install Mplayer
Install Latex


Dual OS Debian + XP:

Following Steps (October, 2005):

  1. use partition magic to release some space in XP
  2. create Debian net-install CD disk
  3. change BIOS to boot from CD-rom
  4. reboot, at the prompt, type: Linux26
  5. select language, country...., choose local time, not GMT
  6. In disk partition, choose "guided partition"
  7. Linux will use free space, use "all in one partition" to have only one mount points /
  8. install, wait..................
  9. install desktop environment
  10. prompt to reboot
  11. further configuration, root password
  12. apt-get install following:
  13. the /etc/X11/XF86Config-4 (or XF86Config) are the file determines the Graphic display, monitor, use ".......reconfigure" to re-configure some option, or manually edit it. type "man xfree86config" to find...
  14. use /dev/input/mice instead of /dev/mouse for PS/2.
  15. if Emacs has not find fonts "iso8859-*....", change the XF86Config to enable all fonts.
  16. apt-get install alsa; alsamixer

Ubuntu

  1. Insert Live CD dapper 6.06, install, reboot (Oct 2006)
  2. apt-get install make
  3. apt-get install xmms to play MP3
  4. apt-get install libx11-dev libxt-dev xlibs-dev
  5. get mplayer source and codec, ./configure & make & make install mplayer
  6. For trac,
    1. apt-get install subversion libapache2-svn python-subversion python2.4-subversion
    2. get and extract trac-0.9.5.tar.gz
    3. python setup.py
    4. download deb for python-clearsilver python2.4-clearsilver clearsilver-dev and "dpkg -i" them
    5. put trac-wiki pages in /var/trac/project
    6. change /etc/apache2/sites-available/default
    7. set svn.passwd file
    8. /etc/init..d/apache2ctl restart
  7. For ns-2
    1. install g++, download deb for gnuplot
Install Ubuntu 6.10 (apr. 2007)
  1. Insert Live CD edge 6.10, install, reboot
  2. Install emacs
  3. For subversion:  apt-get install subversion libapache2-svn
  4. For trac: apt-get install trac (will install trac-0.9.6)
    1. To upgrade SQlite database from v.2 (used in old trac) to v.3, apt-get install  libsqlite0  python-sqlite, sqlite and  sqlite 3, then 
       $ mv trac.db trac2.db
      $ sqlite trac2.db .dump | sqlite3 trac.db
    2. change /etc/apache2/sites-available/default
    3. set svn.passwd file
    4. apache2ctl restart
  5. Install g++4.0, gcc4.0, download deb for gnuplot


check Linux version

Type uname -a

RPM
$rpm -ivh <*.rpm>
.the parameter i means -- Install
the parameter v means -- Verbose
the parameter h means -- Status of Installation

$rpm -Uvh <*.rpm>
to upgrade the package

$rpm -e ppp
to uninstall a package ( the name should not include .rpm extension )


Route
adding gateway configuration
$ route
$ route add default gw 192.168.1.1 eth1

use "dhcpcd" command or "dhclient"
Also, to make dhcp supported. check /etc/sysconfig/network-scripts/ directory, there should be file like "ifcfg-eth0" and "ifcfg-wlan0" to make it work. Note sometimes "monitor mode" of hostap does not work with dhcp.

CVS:
first you have to find the CVSROOT of the repository. for example, there are two following repositories:

  1. /winlab/common/CVS/Orbit
  2. /winlab/common/CVS/MobNets
To checkout something, first create  a new directory in your home to store the checked-out stuff. such as ~/cvs/
then:  cvs -d /common/CVS/Orbit checkout Orbit_docs
The other way is to define environment variable CVSROOT first, the following commands are useful:
  1. setenv CVSROOT zhibinwu@cvs.orbit-lab.org:/common/CVS/Orbit
  2. setenv CVS_RSH ssh
To add new file use:  cvs add, cvs update and cvs commit.

Adding a new branch
    cvs tag -b rel-1-0
Accessing the new branch
    cvs update -r rel-1-0

Note: To retrieve old revisions of a file, you have to tag it...

Create a new project
    export CVSROOT=zhibinwu@liman1a.rutgers.edu:/common/CVS/MobNets
    cd wcof
    cvs import zhibinwu/wcof wcof start
 

su --login (su -l)
Login Shell. It will run the .profile script.

date and time:

Send Email?
You need an MTA (mail transport agent). In Linux, it is usually "sendmail". check the /etc/mail/sendmail.cf and submit.cf files. Sendmail need not run if this is not a mail server.

Display Chinese in Mozilla
It is OK in RedHat if a Chinese font (pcf.gz) file is in /usrX11R6/lib/X11/fonts directory.
But for Debian, you need to install xfont-Chinese package.
The two packages I installed are:
ttf-arphic-uming and ttf-arphic-gbsn00lp


use patch:
patch -p1
refer to: http://people.redhat.com/dledford/patching.html

upgrade kde if there are some errors occur during the apt-get install kde, such as "trying to overwrite...." use "dpkg- i --force-overwrite <*****.deb> " to force a install.

for CPU and memory info, look into /proc directory

switch to root

use "su" or "sudo -s" command

Install mplayer

  1. apt-get some packages, etc xlibs-dev
  2. download the codec and put all of them in /usr/local/lib/codecs, ( not under another directory)
  3. download the source code of mplayer, ./configure, make, make install
  4. If running mplayer program encounters "/dev/dsp resource busy problem", use "killall esd" command to solve it

LaTeX Installation on Debian

It is relatively easy to install LaTeX on Debian, only few post-setup configurations are needed.

# apt-get install tetex-base tetex-bin tetex-extra
# apt-get install texmaker
# apt-get install lacheck auctex

All following procedures are for Chinese-font support only
First install necessary packages.

# apt-get install dvipdfm-cjk-cmap auctex context-el 
# apt-get install cjk-latex dvipdfm-cjk dvipdfmx
# apt-get install gbkfonts texmf-zh tetex-base tetex-bin tetex-extra

Install Chinese fonts for LaTeX.

# install-gbkfonts /usr/share/fonts/truetype/simsun.ttf gbksong
# install-gbkfonts /usr/share/fonts/truetype/simli.ttf gbkli
# install-gbkfonts /usr/share/fonts/truetype/simyou.ttf gbkyou
# install-gbkfonts /path/to/winfonts/simhei.ttf gbkhei

These commands will install various Chinese fonts. Note that simsun.ttf cannot be replaced by simsun.ttc! After installation, these fonts could be found in the directory /usr/share/texmf-zh/. These fonts can be removed by commands like

# remove-gbkfonts gbksong

For advanced Chinese support of pdf files LaTeX generates, we could use dvipdfmx to compile dvi files.

# apt-get install cmap-adobe-gb1 cmap-adobe-cns1
# apt-get install gs-cjk-resource

Modify /etc/texmf/texmf.d/50dvipdfmx.cnf, comment the second line. Run update-texmf as root. Now dvipdfmx is ready. See /usr/share/doc/dvipdfmx/README.Debian for reference.

Install beamer, a LaTeX extension for slides.

  1. Download beamer, pgf, xcolor from CTAN and extract them.
  2. Copy extracted directories of beamer, pgf and xcolor to texmf/tex/latex/
  3. Run "texhash" and "mktexlsr", the installation is completed.



Linux reference: http://tennis.ecs.umass.edu/~czou/linux.html