Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, September 1, 2010

Recover GRUB menu after Ubuntu 9.10 update

A couple the GRUB menu got screwed up after an update. The recover process can be found here. But I had to take a couple additional steps to fix my GRUB.

  1. Figure what your where your /boot and /root partition is installed in. My /boot was /dev/sdc2 and /root was /dev/sdc3.
  2. Mount /root to /mnt using sudo mount /dev/sdc3 /mnt
  3. Mount /boot to /mnt/boot using
    mount /dev/sdc2 /mnt/boot.
    NOTE: If both /root and /boot are on the same partition then you only have to mount the /root partition.
  4. Check /mnt/boot/grub/device.map for an entry for /dev/sdc.
  5. If /dev/sdc does not exist, then add it using vi. For example, the entries in mine were
    (hd0) /dev/sda
    (hd1) /dev/sdb

    So I added (hd2) /dev/sdc to list.
  6. If this was not added to the list, the /root partition will not be found and the grub recovery will fail.
  7. Next re-install the grub by executing
    sudo grub-install --root-directory=/mnt /dev/sdc
  8. Reboot
  9. Refresh the GRUB 2 menu by executing update-grub2

Friday, April 23, 2010

Install/Uninstall GlassFish on Linux

Uninstalling Glassfish V2 and installing Glassfish V3

Glassfish can be installed with the file-based installer or the JAR-based installer.
Uninstall instructions from SUN
Installtion instruction from SUN

Installing Glassfish

File-based
  1. Download the file from
  2. chmod +x sges-glassfish-v3-unix.sh
  3. Create the installation directory: mkdir /usr/glassfish
  4. Navigate to where sges-glassfish-v3-unix.sh file exists.
  5. Run ./sges-glassfish-v3-unix.sh
  6. Follow the instructions.
ZIP file installtion
  1. Download the file from
  2. Create the installation directory: mkdir /usr/glassfish
  3. Unzip contents to installation directory: unzip sges-v3-unix.zip


JAR-based

Uninstalling Glassfish

File-based
  1. Navigate to your Enterprise Server installation directory.

  2. Invoke the uninstallation program as follows:

    • To use the uninstallation in GUI mode, type:

      ./uninstall

    • To use the uninstallation in command-line mode, type:

      ./uninstall -console


JAR-based and Zip
  1. Change to the directory containing the glassfish directory.

  2. Run the following command: rm —r glassfish.

Thursday, April 22, 2010

Install/Uninstall Java on Linux

These commands were tested on CentOS 5.3

Installing Java
  1. Download the latest stable JDK from here.
  2. RPM users (CentOS, RedHat, Fedora) should use the RPM builds.
  3. Non-RPM users (Debian, Ubuntu) should use the self extracting binary file.
  4. Remove the existing Java version.
  5. Install new Java version.

RPM Users

Install
  • The RPM file I am using is jdk-6u20-linux-x64-rpm.bin.
  • chmod +x jdk-6u20-linux-x64-rpm.bin
  • ./jdk-6u20-linux-x64-rpm.bin

Remove Java
  • In this example I am uninstalling jdk-6u16.
  • rpm -e sun-javadb-common-10.4.2-1.1 sun-javadb-client-10.4.2-1.1 sun-javadb-demo-10.4.2-1.1 sun-javadb-docs-10.4.2-1.1 jdk-1.6.0_16-fcs
  • This everything that was installed by the jdk-6u-linux-x64-rpm.bin package.

NON-RPM Users

Install
  • chmod +x jdk-6u20-linux-x64-bin
  • ./jdk-6u20-linux-x64-.bin
Remove Java
  • Find the installation directory. Assume it is installed in /usr/java/jdk1.6.0_16
  • Since this was a self extracting install all you have to do is remove the directory and its contents using the command shown below.
  • rm -rf /usr/java/jdk1.6.0_16
RPM and NON-RPM Users
Remember to remove the system or update the system variable JAVA_HOME. (The /etc/profile file for CentOS users).

Overview of JDK and JRE file structure here