Installing Debian GNU/Linux

From TechWiki

Want a full Linux system up in a couple of clicks? Go to Installing Kubuntu Linux

Contents

The Setup

Software

See Software and Hardware.

Location

Zurich, Switzerland.

System Stuff

System Directories

Some usefull directories:

/etc/services/ -> same as System Settings, System Services
/etc/init.d/ -> starting services, e.g.: /etc/init.d/foo start
/etc/rcS.d/ -> start scripts (symbolic links to /etc/init.d/)
/etc/rcN.d/, where N=0,...,6 -> start scripts in various runlevels (symbolic links to /etc/init.d/)

Log Files

In:

/var/log/messages
/var/log/syslog
/var/log/auth.log

Root/Sudo

Change root password:

sudo passwd root password

Note that kubuntu doesn't have a root user any more. This means that the default sudo password is your user password. Good idea to change!

Edit sudo stuff:

sudo visudo

and put something like

%admin  ALL=(ALL) NOPASSWD: ALL

to disable the automatic password check. Handy, but a potential 'security issue.

Partitions

If you use partitions during installation, you need to format the non-boot partitions to be able to use them:

sudo mke2fs -m 2 -j [device]

formats as ext3 with journaling and 2% safety margin for users filling up the partition.

Now you can mount as usual, e.g.,

mount /dev/sda3 /mnt

Problems

Locale

In

~/.bash_profile

the default locale setting for de_CH doesn't work. This results in error messages for scripts and installs. Instead set

export LC_ALL=C

Sound

Debugging sound problems.

Problems with the on board sound chip of the Shuttle SD11G5. It's a Realtek AC650, but the system loads a Sound Blaster Audigy module (snd_ca0106).

Tried:

modprobe snd-ice1712

and it worked!

To load the module at boot time, insert

snd-ice1712

into the file

/etc/modules

Skype

See under Custom.

Printing

Samba printing with the network harddisk (see Custom). Connected the printer to the network hard disk using the Printer GUI in the Systems Settings.

Somehow it didn't get the device name right. In

smb://WORKGROUP/NETPRINTER/Name

it always put HL-5130-serie instead of HL-5130-series...

This happened for kubuntu and Mac OSX.

If you get the error message

lp:Error - no default destination available

after executing something like

lpr filename

you need to set the printer as default:

Systems Settings -> Printers -> right click on printer -> Set as Default

Java Plugin for Forefox 2.0

locate libjavaplugin_oji.so gave:

/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/plugin/i386/ns7-gcc29/libjavaplugin_oji.so
/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/plugin/i386/ns7/libjavaplugin_oji.so

However, only the second one worked when linked from

/usr/lib/mozilla-firefox/plugins

i.e.:

sudo ln -s /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/plugin/i386/ns7/libjavaplugin_oji.so
Update

This procedure also worked for Java 6.

External Monitor

kubuntu Hardy on an IBM ThinkPad T43p: external VGA's resolution messed up. Using

xrandr --output VGA-0 --mode 1280x1024

didn't work. Installed

sudo apt-get install grandr

and run application. Then put laptop resolution from 1400x1050 back to 1280x800. That worked. Thanks Nils...

Update: Somehow the panel moves up from the bottom position and appears as a bar somewhere across the screen. Right-click on panel, select "Configure Panel..." and set "Xinerama screen" to "All screens".

Conclusion

So this is the solution:

xrandr --output LVDS --mode 1280x800

Overhead Projector

Try

xrandr -s 1024x768
xrandr --output VGA-0 --mode 1024x768

Videos won't show

mplayer -vo gl name.avi

SSH

Suddenly got the following error after a reboot if I try to ssh into my server:

Read from socket failed: Connection reset by peer

Doing

ssh -vvv localhost

confirms this. Had no clue what was happening. Tried

sudo /etc/init.d/ssh restart 

and got the bizarre error message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key

Hmmm, root is user and group for the directory. Did

sudo chmod go-rw *
sudo chmod u+rw *

and

sudo /etc/init.d/ssh restart 

worked and the problem was fixed!

Graphics

For Nvidia cards

sudo apt-get install nvidia-settings nvidia-glx-new-envy
sudo nvidia-xconfig

and reboot

Cool Stuff

Beryl

With kubuntu Feisty there are very cool 3D effects for your windows manager: beryl-project.org

Install

sudo apt-get install restricted-manager

and run

restricted-manager

Follow these instructions:

Compiz-Fusion

The Beryl and Compiz projects are merged to the Compiz-Fusion project.

For Gutsy

By default Compiz-Fusion is not enabled for KDE, so

sudo apt-get install compiz
sudo apt-get install compiz-kde
sudo apt-get install compizconfig-settings-manager

and go to Settings to configure. To start, type

compiz --replace

If things get messed up, try removing the compiz folder in the .config folder in your home...

See also [1],

Older Distributions

In source list:

deb http://download.tuxfamily.org/3v1deb feisty eyecandy
deb-src http://download.tuxfamily.org/3v1deb feisty eyecandy

In order to add the gpg keys...

http://3v1n0.tuxfamily.org/

The instructions to run it are on:

http://ubuntuforums.org/showthread.php?t=481314

Security

Stop root user to login via ssh: In the file

/etc/ssh/sshd_config 

change

PermitRootLogin

to no.

The log

/var/log/auth.log

contains information on user accessing your server. If you grep for ssh in auth.log, i.e.,

grep ssh /var/log/auth.log | less

you'll see all the (hopefully) failed hack attemps, with the attackers IP number.

Note that ripe.net will allow you to resolve IP numbers to names and companies.

Check the security of your network: nessus.org.

DenyHosts Script

The DenyHosts script allows you to block attackers for a certain time period after x invalid login attempts. See the installation guide for more information.

Delete IP-Numbers from the Log

Delete the corresponding number from the hosts file in

/usr/share/denyhosts/data

and the hosts.deny in

/etc

iptables

Paranoid

If you are really paranoid about ssh, you can disable all users from ssh-login and create a designated ssh-user with no sudo rights:

  • Create new user:
ssh-user super-safe-ssh-password
  • Disable all users and enable ssh-user in /etc/ssh/sshd_config:
DenyUsers user
AllowUsers ssh-user

and you might ase well disable root login:

PermitRootLogin no
  • In /etc/sudoers make the regular user sudo without password (just handy):
user     ALL=(ALL) NOPASSWD: ALL

So if a hacker logs in as ssh-user he has to su with the root password to do any damage...

Downloading Stuff

Graphical Package Management

Xandros Networks (Proprietary)

To get a lot more software select:

Edit -> Set Application Sources... -> Debian unsupported sites

Install stuff: MySQL, MySQL Navigator, C/C++, TCL/TK, GIMP, Scanner, Digital Camera, Media Player, Real Player, Apache,...

Adept (kubuntu)

Synaptic (ubuntu)

apt-get

apt get is the installation tool for debian. For a GUI start System -> Adept in the start menu.

More under Linux Commands.

See die.net or spack.org.

  • Update package index files: apt-get update
  • Upgrade installed packages: apt-get upgrade
  • Search: apt-cache search package or apt-cache search ^package
  • Install: apt-get insatall package
  • Remove: apt-get remove package
  • Don't use: apt-get uninstall package or you will uninstall the os!
  • Purge packages: dpkg --purge packagename; to see what will be done: dpkg --dry-run --purge packagename
  • Show package information: apt-cache show package
  • See /etc/apt/sources.list for settings (ubuntu repositories)
  • Change default version of installed packeage, e.g.: update-alternatives --config java
  • Clean: apt-get clean
  • Remove old packages: apt-get autoremove

Stuff to install:

apt-get install build-essential
apt-get install make
apt-get install gimp
apt-get install mozilla-thunderbird
apt-get install mozilla-firefox (bug: default web page to be loaded doesn't exist: change settings)
apt-get install xemacs21-bin
apt-get install latex209-bin
apt-get install dia
apt-get install incskape
apt-get install gnuplot
apt-get install mysql-server (default is 5.0; if you have 4.0 installed use apt-get install mysql-server-5.0, but backup database first)
apt-get install php5, php5-gd
apt-get install phpmyadmin and/or apt-get install mysql-navigator (see here for more)
apt-get install htop
apt-get install kcoloredit
apt-get install python2.3-dev python2.3
apt-get install gv
apt-get install myspell-de-ch (Swiss German dictionary for OpenOffice and Thunderbird)

More stuff here Installin Kubuntu Linux.

To see what is installed or is installable:

dpkg --get-selections

Log file in:

/var/log/dpkg.log

Problems

If the package manager locks, i.e.,

sudo apt-get update

gives

E: Could not get lock /var/lib/apt/lists/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the list directory

and you know your not accessing it with another program, do this to fix

sudo apt-get clean
cd /var/lib/apt/lists
sudo mv lock lock.old

Functionality

User

Make sure user is member of www-data (webserver) group:

  • Xandros:
Xandros Control Center -> System Administration -> User Manager
  • kubuntu:
System -> KDE User Manager

alternatively:

System Settings -> User & Groups

sudo

In /etc/sudoers set

jbg ALL=(ALL) NOPASSWD :ALL

or

jbg ALL=(ALL) ALL

Media

Hardy 8.04

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update
sudo apt-get update
sudo apt-get install acroread 

from [[http://ubuntuforums.org/showthread.php?t=713009 ][ubuntuforums.org]].

Feisty 7.04

wget -q http://medibuntu.sos-sts.com/repo/medibuntu-key.gpg -O- | sudo apt-key add -
sudo wget http://medibuntu.sos-sts.com/sources.list.d/feisty.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update

from [[2][medibuntu site]].

Old

Latex

This is only for downloading Latex functionality. Go to LaTeX or Usage for a HowTo.

Environment Variables

For bash shells edit ~/.bashrc or ~/.profile:

export TEXINPUTS=".:~/work/svn/misc/latex/templates/tex::"
export BIBINPUTS=".:~/work/svn/misc/latex/bib"
export BSTINPUTS=".:~/work/svn/misc/latex/templates/bst"
export DVIPSHEADERS=".:~/work/svn/misc/latex/templates/pro"

To reload the environmental variables in the current session

source ~/.bashrc

csh:

TEXINPUTS=.:~/work/svn/misc/latex/templates/tex::
BIBINPUTS=.:~/work/svn/misc/latex/bib:
BSTINPUTS=.:~/work/svn/misc/latex/templates/bst:
DVIPSHEADERS=.:~/work/svn/misc/latex/templates/pro:

NB: TEXINPUTS really has "::" in path.

Note that if you get the error

This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
dvips: ! Couldn't find header file tex.pro.
Note that an absolute path or a relative path with .. are denied in -R2 mode.

when executing the command dvips, then you can comment the last two exports, i.e., BSTINPUTS and DVIPSHEADERS.

AMS Latex

Get source files from ams.org. Download:

AMSFonts
AMS-LaTeX

Unzip into the TEXMF directory (being something like /usr/share/texmf/).

Enter

texhash

psfrag

Download from ctan.org:

psfrag.ins
psfrag.dtx

Run

latex psfrag.ins

Will create:

psfrag.sty
psfrag.pro

Move files to

/usr/share/texmf/tex

and

/usr/share/texmf/dvips/

respectively.

Enter

texhash

Usage

\psfrag{tag_in_fig}{replacement}
\psfrag{<tag>}[latex ref point: <t,b,B>,<l,r>][ps ref point (like latex ref pt)][scale][rot]{repl}

fancyhdr

From essex.ac.uk or artofproblemsolving.com.

Place

fancyhdr.sty

somewhere in

/usr/share/texmf/tex

Run

texhash

latex2html

http://www.latex2html.org/, http://tug.org/mailman/listinfo/latex2html.

Install:

wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002.tar.gz
tar -xzf latex2html-2002.tar.gz
cd latex2html-2002
./configure
make
make check
edit l2hconf.pm
sudo make install

Internet

See http://meta.wikimedia.org/wiki/Running_MediaWiki_on_Debian_GNU/Linux.

  • Xandros:
Xandros Control Center -> System Administration -> Services
  • kubuntu:
System Settings -> System Services

Apache

For PHP support:

apt-get install php4 libapache-mod-php4 php4-gd php4-imagick

For MySQL:

apt-get install php4-mysql

Apache 2

apt-get install apache2-mpm-prefork

For PHP support:

apt-get install libapache2-mod-php4 php4-gd php4-imagick

For MySQL:

apt-get install php4-mysql
apt-get install php5-mysql

Versions

  • PHP 5.0.5-2
  • MySQL 4.1.12
  • Apache 2.0.54

Mailserver

Install:

apt-get install exim

and select:

3
system name
isp.net
smtp.isp.net
user
y

Do this at any later date with:

/usr/sbin/eximconfig

Note my smtp.isp.net is smtp.hispeed.ch.

Check:

/var/mail

Docs:

/usr/share/doc/exim/spec.txt

Usage:

/usr/sbin/exim -v to@xyz.net

enter:

From: me@whatever.net
To: to@xyz.net
Subject: hi
blabla...
 .

Security if password and username is required: Uncomment in /etc/exim/exim.conf:

 plain:
  driver = plaintext
  public_name = PLAIN
  server_condition =
    "${if crypteq{$3}{${extract{1}{:}{${lookup{$2}lsearch{/etc/exim/passwd}{$value}{*:*}}}}}{1}{0}}"
  server_set_id = $2

login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_condition =
    "${if crypteq{$2}{${extract{1}{:}{${lookup{$1}lsearch{/etc/exim/passwd}{$value}{*:*}}}}}{1}{0}}"
  server_set_id = $1

and create:

/etc/exim/passwd

and in /etc/exim/:

htpasswd passwd user@dom.ch

then

chown root:mail /etc/exim/passwd
chmod 640 /etc/exim/passwd

IMAP

Using thunderbird.

Incoming server:

mail.isp.net

Outgoing server:

smtp.isp.net

Problems with folders, all subfolders of Inbox:

Edit -> Account Settings... -> Server Settings -> Advanced
IMAP server directory: INBOX

Networking

More under Networking.

Xandros

SSH: Xandros Control Center -> System Administration -> Services
Samba:
 Xandros Control Center -> System Administration -> Services
 Xandros Control Center -> Network -> Windows Networking -> Workgroup: network_name

kubuntu

Install ssh server (sshd):

apt-get install openssh-server

then

System Settings -> System Settings -> ssh

or simply type:

sudo /usr/sbin/sshd

Printer

At

http://localhost:631

you can find the printer admin GUI.

Model:

Brother HL-5130

Install with:

Brother HL-5030
Foomatic + hl1250

/etc/cups/printers.conf listing:

<Printer hl5130_nw>
Info BROTHER HL-5030 hl1250
Location NetCenter
DeviceURI smb://WORKGROUP/NETCENTER/HL-5130-series
State Idle
StateTime 1159375874
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>

See also http://www.linuxprinting.org.

Problems described here.

Mac OS X

Driver

Go to http://www.linuxprinting.org/macosx/hl1250 and download both dmg-files.

See also here.

Long Printer Names

My network printer is called

HL-5130-series

which incorrectly gets put to

HL-5130-serie

Edit the file

/private/etc/cups/printers.conf

and add the missing 's' to the DeviceURI which is something like

DeviceURI smb://WORKGROPNAME/SERVER/HL-5130-series

Restart CUPS server

sudo killall cupsd
sudo cupsd

Xandros Autodetect

  • CD and DVD burning done using Xandros File Manager (otherwise standard burning software is called K3B.
  • External HD automounted by Xandros File Manager. For manual mounting see next section.
  • Scanner detected by Applications -> Graphics -> Scanner

USB Harddisk

Edit /etc/fstab:

/dev/sda1    /mnt/usb    auto    noauto,users,rw    0    0

Create directory /mnt/usb. With the commands

mount /mnt/usb
umount /mnt/usb

the device will be (un)mounted to(from) the directory /mnt/usb.

Starting Services

Note that in:

/etc/rcX.d

X corresponds to the runlevel:

S: system start (boot)
0: stop system
1: single-user-mode
2: default runlevel after boot
3: identical to 2
4: for networking
5: identical to 4
6: reboot system

The directories in /etc/rcX.d only contail symbolic links to corresponding scripts in:

/etc/init.d/serivce

The naming of the links is as follows:

/etc/rc0.d/K91service
/etc/rc1.d/K91service
/etc/rc2.d/S91service
/etc/rc3.d/S91service
/etc/rc4.d/S91service
/etc/rc5.d/S91service
/etc/rc6.d/K91service

where K anb S stand for kill and start, respectively. The number just determins the sequence of execution.

To set a link:

ln -s /etc/init.d/service /etc/rcX.d/S_or_K_Number_name_of_service

Customizing

Firefox

Cool plugins are:

Xandros Control Center

  • Display
    • Default Blue, Scaled, Hue Shift, Install
  • Icons
  • Panel
    • Tabs Menus, Appearances
  • Style Keramik
  • Taskbar
  • General Settings
    • Multiple Desktops
    • Window Behavior
      • Tabs Focus, Advances

Panel (right click)

Add terminal, change icons, performance monitor

Fonts

Fonts:

apt-get install msttcorefonts

This install various microsoft true type fonts in your X system. It will probably ask lots of questions and go through lots of steps, but it is easy, it does all the work for you.

Make sure you have "Debian unsupported site" checked in Xandros networks. Find it in Edit->Set Application sources...

This gives you access to all the "normal" Debian goodies. It is unsupported by Xandros, but they do in fact modify the programs there to work properly with the Xandros distribution. So it's a good thing to have.

Next is open office. Open an open office application, any one will do. Open Tools->Options... You will see tons of stuff on the left hand side. Open the "OpenOffice.org" catagory. You will see a sub-catagory called "View". Click on that. On the right side at the top you will see "Display". Under that you should see "Scale". Change that value to whatever looks good to you. Now your fonts should not be so tiny.

Finally Mozilla. Go to your ~/.mozilla directory. Keep going down the directories until you find the "chrome" directory. Create a file called "userChrome.css" there. Put this inside of it:

* {
font-size: 4.0mm !important;
font-family: bitstream vera sans !important;
}

Shells

See also here for usage.

Bash

Login:

.bashrc
.bash_profile
.profile

Login problems, use:

/etc/profile

Syntax:

PATH=/dir
PATH=/bin:"${PATH}"
export JAVA_HOME=/usr/local/j2sdk1.4.2/
alias ls='ls --color=auto'

NB: no spaces between the "="

.bashrc:

   # set a fancy prompt
   PS1='[\u@\h]:\W'
   case `id -u` in
     0) PS1="${PS1}# ";;
     *) PS1="${PS1}$ ";;
   esac

   # If this is an xterm set the title to user@host:dir
   case $TERM in
   xterm*)
       PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"';;
   *);;
   esac

C Shell

Login:

.cshrc
.login

Syntax:

set path=(/bin )
alias l 'ls-F'
setenv JAVA_HOME /usr/local/j2sdk1.4.2

.login

if ( $?TERM ) then

   # Unpack TERM variable, if it contains DISPLAY information from "xrlogin"
   if ( `expr "$TERM" : ".*@"` ) then
       setenv DISPLAY `echo "$TERM" | sed 's/[^@]*[@]//'`
       set term=`echo "$TERM" | sed 's/\([^@]*\).*$/\1/'`
   endif

   # For xterms, display host name, current dir in window header, icon label
   if ( "$TERM" == "xterm" ) then
       alias cwdcmd 'echo -n "ESC]2;`hostname`:$cwd^GESC]1;`hostname`:$cwd^G"'

       # Update the window/icon titles now (not if executing which(1),
       # which simulates an interactive shell by setting an empty prompt)
       if ( "$prompt" != "" ) then
           cwdcmd
       endif

       # Use a simple prompt, since info is in the window header
       set prompt="[\!] "

   # Other TERM types - put host name in prompt
   else
       if ( $TERM == "unknown" || $TERM == "vt100" ) then
           setenv TERM vt100
       endif
       set prompt=`hostname`"[\!] "
   endif
endif

XEmacs

In /home/user/.xemacs/. If directory doesn't exist, simply create it and the following files:

init.el:

;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
      (boundp 'emacs-major-version)
      (or (and
	    (= emacs-major-version 19)
	    (>= emacs-minor-version 14))
	   (= emacs-major-version 20))
      (fboundp 'load-options-file))
 (load-options-file "/home/jbg/.xemacs-options")))
;; ============================
;; End of Options Menu Settings

(setq minibuffer-max-depth nil)
(custom-set-variables
 '(pc-select-selection-keys-only t)
 '(load-home-init-file t t)
 '(font-lock-use-colors t t)
 '(gnuserv-program (concat exec-directory "/gnuserv"))
 '(font-lock-use-fonts nil t)
 '(pc-select-meta-moves-sexps t)
 '(indent-tabs-mode nil)
 '(pc-selection-mode t))
(custom-set-faces
 '(default ((t (:family "Lucida" :size "12pt"))) t)
 '(gui-button-face ((t (:background "grey75" :inverse-video t :size "14"))) t)
 '(message-headers ((t (:bold t :size "14"))))
 '(custom-documentation-face ((t (:size "14"))) t)
 '(gnus-x-face ((t (:foreground "black" :background "white" :size "14"))))
 '(bold ((t (:bold t :size "14"))) t)
 '(blue ((t (:foreground "blue" :size "14"))) t)
 '(custom-button-face ((t (:bold t :size "14"))))
 '(custom-variable-button-face ((t (:bold t :underline t :size "14"))))
 '(message-header-contents ((t (:italic t :size "14")))))

;---------------------------------------------------------------------------
; This section sets up some default values for when you are editing in C-mode
;---------------------------------------------------------------------------
(defun my-c-mode-common-hook ()
 (c-set-style "stroustrup"))
  ;(setq c-indent-level 4))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(add-hook 'c++-mode-hook 'my-c-mode-common-hook)
 
(require 'mwheel)
(mwheel-install)
(setq mwheel-follow-mouse t)

custom.el:

(custom-set-variables
 '(pc-select-selection-keys-only t)
 '(load-home-init-file t t)
 '(font-lock-use-colors t)
 '(gnuserv-program (concat exec-directory "/gnuserv"))
 '(font-lock-use-fonts nil)
 '(pending-delete-mode t nil (pending-del))
 '(pc-select-meta-moves-sexps t)
 '(indent-tabs-mode nil)
 '(pc-selection-mode t))
(custom-set-faces
 '(default ((t (:family "Lucida" :size "12pt"))) t)
 '(gui-button-face ((t (:background "grey75" :inverse-video t :size "14"))) t)
 '(message-headers ((t (:bold t :size "14"))))
 '(custom-documentation-face ((t (:size "14"))) t)
 '(gnus-x-face ((t (:foreground "black" :background "white" :size "14"))))
 '(bold ((t (:bold t :size "14"))) t)
 '(blue ((t (:foreground "blue" :size "14"))) t)
 '(custom-button-face ((t (:bold t :size "14"))))
 '(custom-variable-button-face ((t (:bold t :underline t :size "14"))))
 '(message-header-contents ((t (:italic t :size "14")))))

Java

See here.

Backup

MySQL

Some general stuff here.

Dump database script:

#!/bin/sh
DSTDIR="/var/backup"
DB=( mysql kellerdb techwikidb )
DB_PASSWD="rootmysql"
for (( i = 0 ; i < ${#DB[@]} ; i++ ))
       do
               /usr/bin/mysqldump --password=$DB_PASSWD -u root ${DB[i]} > $DSTDIR/${DB[i]}.sql
       done

save as name.sh and make executable

chmod +x name.sh

Put in /etc/crontab

0 1 * * * root /dir/name.sh

NB: Putting

>> /dev/null 2>&1

at the end of the crontab entry, will prevent any output to a terminal or system email.

Data

Write simple executable script that makes tarball of directories:

#!/bin/sh
DSTDIR="/var/backups"
DIRS=( /var/www /home )
NAMES=( var home )
for (( i = 0 ; i < ${#DIRS[@]} ; i++ ))
       do
               tar -czf $DSTDIR/${NAMES[i]}.tar.gz ${DIRS[i]}
       done

Make crontab entry, as seen above.

If you want to backup to a remote host use rsync, as described below.

Plone

Zope Object Database

  • Pack database, i.e., remove old objects:
http://localhost:9673/manage -> Control_Panel -> Database Management -> click pack
  • Look up database file to backup in:
http://localhost:9673/manage -> Control_Panel -> Database Management

e.g., /var/lib/zope/instance/default/var/Data.fs

Add this file to the backup script seen in the above section.

System

Partimage

Full system backup using partimage, respectively sysresccd containing it. Download:

systemrescuecd-x86-0.2.15.iso

and burn image to CD. Reboot system with disk inserted.

Had problems while booting: system freezes (eth). To resolve, type on command line:

menu

Then select the following in the grafical interface (use left/right arrows and space):

System Rescue CD -> Options -> Disable networking on boot (select)
System Rescue CD -> Keyboard layout (select)
System Rescue CD -> Boot System Rescue CD

After booting, type at prompt:

cd /mnt
mkdir usb
mount /dev/sda1 /mnt/usb

And then:

partimage

In the GUI you should select something like:

ide/host0/bus0/target0/lun0/part2 reiserfs

for Partition to save/restore. Navigate with Tab-button and select with spacebar. Enter something like:

/mnt/usb/image/050302

for Image file to create/use. Next(F5) (if F5 doesn't work just select with Tab). Then:

Image split mode: Into files whose size is 2057 MB

Next and enter label.

rsync

Backup to a remote server.

Examples:

sudo rsync -av / root@core0:/core1/system 

or compressed

sudo rsync -azv / root@core0:/core1/system

and

rsync -av --delete --exclude /proc / root@core0:/core1/system

UPS

Links: [3], [4].

sudo apt-get install apcupsd

In

/etc/apcupsd/apcupsd.conf

see that the following entries are there:

UPSCABLE usb
UPSTYPE usb
DEVICE

Start daemon at boot time.

Kernel

Typing

uname -r 

shows the current kernel version.

E.g., to update to a newer image

apt-get install linux-image-686

Then you have to edit GRUB (bootloader) to allow you to boot with the new kernel:

/boot/grub/menu.lst

should have the following entry:

title           Ubuntu, kernel 2.6.12-10-686
root            (hd0,2)
kernel          /boot/vmlinuz-2.6.12-10-686 root=/dev/sda3 ro quiet splash
initrd          /boot/initrd.img-2.6.12-10-686
savedefault
boot

Actually, apt-get added the entry while installing.

GRUB

Tutorial: GRUB

Type in terminal:

grub

then

root (hd0,2)
setup (hd0)
quit

Excerp from /boot/grub/menu.lst:

title           Ubuntu, kernel 2.6.15-26-686
root            (hd0,2)
kernel          /boot/vmlinuz-2.6.15-26-686 root=/dev/sda3 ro quiet splash
initrd          /boot/initrd.img-2.6.15-26-686
savedefault
boot

RAID

http://de.opensuse.org/SW-RAID_und_LVM

Distribution Upgrades

Low level: Log in as root using safe mode

do-release-upgrade -m desktop

Older distros:

ubuntuguide.org

Minimal /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse

General Stuff

Note that Debian will ask you during the upgrade if you want to keep the local modified version of a config file in /etc/... or replace it with the new version. Note that if you keep your version, Debian still copies the new file to the directory and calls it something like

*.conf.dpkg-dist

so you can recover changes later. Doing something like this in /etc/ shows you all the double config files:

find . -name "*dist"

Dapper to Edgy

Problems

Anjuta

Solution:

dpkg -i --force-all /var/cache/apt/archives/anjuta_2.0.2-2ubuntu1_i386.deb
apt-get -f install
apt-get dist-upgrade

Edgy to Feisty

You can either use the

System -> Adept Manager GUI and wait for the pop up window which informs you of the new distribution and follow the instructions

or open a terminal and type:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Problems

Install Crashes

Sometimes (e.g. on some IBM ThinkBook T42 and T60 laptops) the GUI install crashes while installing tt fonts (e.g. ttf-arphic-fonts, ttf-diwali-fonts), i.e., it just freezes.

Solution:

Kill the process:
ps -ef | grep dpkg

and look up the process id and kill it

kill [pid]
Restart from command line:
apt-get update

Here it will complain and tell you to use

dpkg --configure -a

After that, it all works

apt-get update
apt-get upgrade
apt-get dist-upgrade

Compiz

compiz (sudo apt-get install gnome-compiz-manager) bug in the xorg.conf file which prevents window decorations being displayed. Add this line

Option "AddARGBGLXVisuals" "true"

to the /etc/X11/xorg.conf file in the section Monitor.

DenyHosts and Python 2.4

Feisty's default Python version is 2.5 but DenyHosts needs Python 2.4.

Fix:

Edit /usr/bin/denyhosts.py and change first line of script to

#!/usr/bin/python2.4

First Fix That Didn't Work:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.4 10  
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 1 

and choose the version

sudo update-alternatives --config python

Ongoing Problems:

Unfortunately

  • displayconfig-restore.py
  • Power Manager

requires version 2.5 and crash during reboot...

Quick and Dirty Fix:

  • Set default Python version to 2.5 (update-alternatives --config python) and reboot.
  • Change to version 2.4
  • Start DenyHosts script (sudo /etc/init.d/denyhosts start)

Unsatisfactory, but works for the moment...

Feisty to Gutsy

How to and remember medibuntu.

Problems

Install-GUI Freeze and Recovery

The Adept Package Manager GUI failed during the something software channels parts. It didn't actually crash, but just didn't progress. So I closed the window, and ignored the warning. This is where the trek started...

First I checked for running processes

ps -ef | grep dpkg

of which they were none.

Then I had to remove the lock files

cd /var/lib/apt/lists
sudo mv lock lock.old

and cleaned

sudo apt-get clean

The usual combo

sudo apt-get update
sudo apt-get upgrade

failed. Tried

sudo dpkg --configure -a
sudo apt-get -f install

At one point did a

sudo apt-get autoremove

which helped a little. Now I had a list of packages that couldn't be installed.

The fist package was

feisty-wallpapers

which I tried to remove with

sudo apt-get remove feisty-wallpapers
sudo apt-get remove --purge feisty-wallpapers
sudo dpkg -r feisty-wallpapers
sudo apt-get install feisty-wallpapers --reinstall

and nothing worked. Only

cd /var/lib/dpkg/info
sudo dpkg --remove --force-remove-reinstreq  feisty-wallpapers

Next problem:

Can't find pycentral

which I finally found out was due to the fact that I had *lost my symbolic python link*! So

cd /usr/bin/
sudo ln -s python2.5 python

Finally

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

and upgraded to Gutsy.

Rebooted and hand problems with the device-mapper as seen in System -> KSystemLog. Additionally, the process udevd was hogging all the CPU power (uset top to see that). This turns out to be the same problem related to evms, the enterprise volume management system ([5]), so I removed it

sudo apt-get remove evms

This package should be reinstalled as soon as they fix the bug...

Compiz-Fusion

By default Compiz-Fusion is not enabled for KDE, so

sudo apt-get install compiz
sudo apt-get install compiz-kde
sudo apt-get install compizconfig-settings-manager

and go to Settings to configure. To start, type

compiz --replace

See also [6].

Thunderbird Bug

Get a tmprules-X.dat (X=1, ...)file written to /tmp every 10 minutes. Somehow this relates to message filters in Thunderbird and msgFilterRules.dat files not being writable.

Can't fix the problem so I put this in my /etc/crontab

15 0 * * * root rm -r /tmp/*

deleting the directory contents regularly...

Gutsy to Hardy

For Java 6 see it-republik.de and

sudo update-alternatives --config java 

If the Java Firefox plugin

sudo apt-get install sun-java6-plugin 

doesn't work, see Java_Plugin_for_Forefox for a manual fix.

Problems

vim is not the real thing:

sudo apt-get install vim

xubuntu

With jaunty kubuntu uses KDE 4 which I don't like. xubuntu I find a great alternative, using the light-weight Xfce windows manager.

Problems

Panel Lost after Logout

For some reason ,the panel disappears after restarting a session.

Press Alt and F2 (dialogue to run program)

and

type
xfce4-panel

The customized panel is back.

Ugly Desktop Icon Text

Ugly colored text fields for desktop icons. Remove by adding

style "xfdesktop-icon-view" {
   XfdesktopIconView::label-alpha = 0

   base[NORMAL] = "#3F6BA4"
   base[SELECTED] = "#3F6BA4"
   base[ACTIVE] = "#3F6BA4"

   fg[NORMAL] = "#ffffff"
   fg[SELECTED] = "#ffffff"
   fg[ACTIVE] = "#ffffff"
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"

to

~/.gtkrc-2.0

From ubuntuforums.org.