Categotry Archives: java


A mini guide on converting from Ubuntu to Debian


How to convert from Ubuntu to Debian

This article will encompass a LOT of previous posts. This is NOT recommended for n00bs.

1. While you are downloading the Debian iso, it would be a good first step to backup /home/ and /etc/.

2. You can find simple rsync backup/restore scripts here.

3. Once the debian iso is downloaded, you should md5sum check it first. You can find the debian cd iso image checksums here.

4. Burn the iso (not copy to a cd – why this is NOT for n00bs) to a cd or dvd, depending on what you downloaded.

5. Installing from the DVD is quite different then Ubuntu. This is NOT a live cd, so you can’t experiment first.

The rest of this article will ass/u/me that you were able to install Debian sucessfully. Configuring Debian, requires some work!

1. The first thing that bit me in the buttocks (can we say that here?) – is rebranded software. You won’t find Firefox or Thunderbird. Instead you will find re-branded software. So icedove instead of Thunderbird, and IceWeasel instead of Firefox. Those are in the Debian Repositories. The problem with re-branded software, is that it is NOT upstream compatible. You can always choose to install the branded stuff (Firefox/Thunderbird) from the Mozilla site. If you need 64 bit Firefox or Thunderbird you can get find that here.

NOTE: the following code block assumes sudo (#3 below is fixed:)

As always anything with an octothorpe (#) is a comment and need not be coded.

sudo apt-get install icedove # get the re-branded thunderbird
sudo apt-get install iceweasel # get the re-branded firefox

2. The second thing is .profile so you will want to deal with that next.

3. Next, was how to easily do sudo in debian

By default – sudo does NOT work in Debian. And as you know, you get sort of used to using sudo in Ubuntu. There are some crazy ideas on how to fix this, but this is pretty easy and straight forward.

4. You probably need java run time

Guess what? That does NOT come pre-installed on Debian! You can easily add the java runtime environment (jre) for Debian.

5. if you need to restart the gdm in Debian, it’s gdm3 NOT gdm as in Ubuntu. So

sudo service gdm3 restart

6. By default, /usr/sbin is NOT in your path in Debian, but is in Ubuntu. How to fix? This was a little more complicated then I thought. But Joe had a neat fix! (so none of the system tasks are available – things like I dunno gparted, vsftpd, useradd, etc — are not accessible.)

By default, when Linux comes up, it executes /etc/profile. Within /etc/profile it sources /etc/profile.d/

What do I mean by “sources?” Joe explains:

Executing a script is the normal way to do it. The script executes, then it exits, and it’s environment is gone forever.

When you source a script, you execute all the commands in the script and (it) remain(s) in the environment – keeping all changes made to same.

execute: /path/to/

source: source /path/to/script or more succinctly:

. /path/to/script

And that is what the following script does/ It uses a function called pathmunge to add the missing paths:

# /etc/ for Linux
# Local environment variables
export ORGANIZATION="Mirai Consulting"

#if [ $SHELL == '/bin/bash' ]; then

# Set prompt and aliases to something useful for an interactive shell

case "$-" in
# Set prompt to something useful
case "$is" in
set -p
if test "$UID" = 0 ; then
PS1="u@h:w> "
PS1=`uname -n`': $PWD n(tty${tty#/dev/tty}): bash: ! > '

case $TERM in
PROMPT_COMMAND='echo -ne "�33]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}�07"'
PROMPT_COMMAND='echo -ne "�33_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}�33\"'

# fix broken non-root path -

pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then

# Path manipulation

pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
pathmunge $HOME/sbin

unset pathmunge

set histexpand
export HISTCONTROL=ignoredups

alias ltr='ls -latr'
alias ll='ls -laFL'
alias lll='ll | less'

alias cls=clear
alias f=finger


alias maillog='$sudo tail -20 /var/log/mail.log'
alias postlog='$sudo grep postfix /var/log/mail | tail -40'
alias poplog='$sudo grep pop3-login /var/log/mail | tail -40'
alias msgs='$sudo tail -20 /var/log/messages'
alias krnl='$sudo tail -20 /var/log/kernel'
alias cmo='ls -Lltr /var/spool/mail'
alias psu='ps -FHu'
alias mqt='mailq|tail'
alias dmesg='/bin/dmesg|tail -40'

/bin/rm -f ~/.project
set `date`
echo "" >> ~/.project
echo " $LOGNAME logged in on `hostname` $1 $2 $3 $4" >> ~/.project
echo "" >> ~/.project


#[ -r /etc/ ] && . /etc/

alias addkey="sudo apt-key adv --keyserver --recv-keys"


7. If you have Skype you will probably need to fix that as well.

This is just a first cut draft on the differences I noted between Ubuntu and Debian.

Thanks always to Joe and Loni.


How to install Java 1.7 for Ubuntu/Debian (apt-get) and Fedora (rpm)


Many apps, applets, games, and more are written in, or use Java to run. Java is very important, and widely-used. With this article, I will show you how to install the latest JRE/JDK (1.7.0) on Ubuntu/Debian, and Fedora.

original article here:
and 64 bit java install directions from Oracle


1. Download the JRE (Java Runtime Environment) / JDK (Java Development Kit) 7 from here:

The file type for Ubuntu is the .tar.gz
Note: The JDK is for developers. Do not download unless you plan on programming in Java.

2. Unpack (or untar, or extract) the .tar.gz file in the desired directory. Type:

tar -zxvf filename

3. Install Java 1.7 to alternatives. Type:

sudo update-alternatives --install /usr/bin/java java /your/java/directory/jre/bin/java 3

Note: Replace /your/java/directory/, with the directory where you extracted the .tar.gz

4. Choose your Java version using alternatives. Type:

sudo update-alternatives –config java

Then choose the option that points to your Java 7 directory.

Note: If you have chosen the JDK, your javac will not be updated. Typing the javac -version command will return the previous Java’s version javac. I do not know how to fix this.

5. Configure the Java browser plugin.

You will have to use a symbolic link to configure the plugin.


ln -s /your/java/directory/jre/lib/your system architecture/ /your/brower/plugins/directory

Note: /your/java/directory/ is wherever you extracted the .tar.gz

Also, /your system architecture/ is the architecture type of the Java .tar.gz file you downloaded. This will either be i386, or amd64. If you are unsure which, open a file manager, go to your Java directory, and go to the jre/lib/ directory. If a folder entitled amd64 is there, you have the x64-bit version. If not, you have the x32-bit.

Another thing to note, the /your/browser/plugins/directory/ is your browser’s plugins directory. Example: if you are using Mozilla’s Firefox, your plugins directory is /usr/lib/mozilla/plugins/

6. Test the plugin. Restart your browser, and go to

Java Tester

Click the Java Version button. If the pink box says Java 1.7.0 from Oracle, you have configured the plugin correctly.

Installing Java 1.7 goodness for Ubuntu. Enjoy 🙂


1. Download the .rpm installer from Oracle here:

2. Install. You can do this by:

A) Using the Open With feature of your browser

B) Going to the directory of the download in a file browser, right-clicking the file, and selecting the Open with Software Install option

C) Typing (as root)

rpm -ivh filename

The browser plugin should be configured by the installer.

Java 1.7 goodness for Fedora. Enjoy 🙂



Easy way to install java runtime enviorment (jre) in Debian


Again playing with Debian Squeeze (v 6.0). There’s no java goodness by default. I looked around a lot of places, that had me doing some crazy things. Here’s all you need to get the jre (java runtime environment) for Debian. Note: This assumes you have a Mozilla Class Browser (like Firefox) previously installed.

sudo apt-get install default-jre

Pretty simple, eh? Took a few days to figure that one out!