SITE SEARCH

Google
 

Sunday, February 14, 2010

Reinstall Ubuntu Grub Bootloader After Windows Wipes it Out

If you run a dual-boot system with Linux and Windows, this has happened to you. You had to do your monthly reinstall of Windows, and now you don’t see the linux bootloader anymore, so you can’t boot into Ubuntu or whatever flavor of linux you prefer.

Here’s the quick and easy way to re-enable Grub.

1) Boot off the LiveCD

2) Open a Terminal and type in the following commands, noting that the first command will put you into the grub “prompt”, and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

sudo grub

> root (hd0,0)

> setup (hd0)

> exit

Reboot (removing the livecd), and your boot menu should be back.



Only read below if Windows is now missing from the boot menu

If you installed Ubuntu before you installed Windows, then Ubuntu will not have anything in the grub configuration for Windows. This is where you’ll have to do a bit of manual editing to the grub boot menu file.

If you open the file /boot/grub/menu.lst with the following command:

sudo gedit /boot/grub/menu.lst

You’ll see a sample section for Windows, which you’ll want to uncomment and add to the boot menu list in whatever position you want it in. (uncomment by removing the #’s)

# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1

Note that you should also verify that hd0,0 is the correct location for Windows. If you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3)

Tuesday, February 9, 2010

Ubuntu JavaInstallation

Prerequisites

To install OpenJDK, you must have the Universe repository enabled and be running Ubuntu 8.04 or later.

/!\ To install proprietary Java, you must have the Multiverse repository enabled. Keep in mind that this repository is different from the backports Multiverse repository. That is, do not simply uncomment the "multiverse" line for backports. Instead, you will need to add "multiverse" to the existing main line in /etc/apt/sources.list.

To install IcedTea, you must have the Universe repository enabled and be running Ubuntu 7.10 or later.

For more information about the Multiverse and Universe repositories, please visit the following guide:

Managing Repositories.

Introduction

Java is a technology from Sun Microsystems. There are several implementations, of which five will be talked about here:

*

OpenJDK: The primary goal of the OpenJDK project is to produce an open-source implementation of the Java SE 6 Platform. As of Ubuntu 8.04, it is located in the universe repository.
*

Free Java: GNU classpath and others, these are already included in Ubuntu as of Ubuntu 5.10. These implementations are available for all supported Ubuntu architectures.
*

IcedTea: IcedTea is a build of OpenJDK from Red Hat that is composed of free software. As of Ubuntu 7.10, it is located in the universe repository.
*

Sun Java: Sun Java is the reference implementation. As of Ubuntu 6.06, it is included in multiverse
*

Blackdown Java: Blackdown Java, a port of the Sun JDK to Linux which pre-dates Sun's official port, is included in multiverse of Ubuntu 5.10 and later
*

IBM Java: IBM Java is a reimplementation with a Just-In-Time Compiler. It is only available from IBM's website. It is the preferred Java solution on PowerPC machines, and instructions for Ubuntu on PowerPC are below. It is also available for i386 and AMD64, but use on such installations is not discussed here.

Java is also very different based on your processor architecture. Most computers are i386, Mac are PowerPC (although newer MacBooks and MacBook Pros are i386) and some newer computers are AMD64. Use the following chart to see which version of Java you should install:

Release



Free Java


Proprietary Java



8.04


7.04


6.10


6.06


7.04


6.10


6.06

i386


OpenJDK or GCJ


Sun Java

PPC


GCJ


IBM Java

AMD64


OpenJDK or GCJ


Sun Java *

SPARC


GCJ


-

*

There is no browser plugin for the SPARC platform. On the AMD64 platform, the icedtea-gcjwebplugin is a browser plugin without LiveConnect support. For a more complete plugin, you will have to install a 32bit version of Firefox. See below.
*

Starting with Ubuntu 6.10 (EdgyEft), you can install the experimental java-gcj-compat-plugin from the universe archive. It is available on all architectures. Note however, that the plugin currently runs with no security manager. This means that applets you load can do anything a java application that you download and run can do. Be **very** careful which applets you run.

Installing OpenJDK

OpenJDK is available on Ubuntu 8.04 in the Universe repository. The runtime environment is located in the openjdk-6-jre package.

Installing GCJ

Free Java is already installed in the default installation java-gcj-compat. To install the development environment, install the java-gcj-compat-dev package.

Installing IcedTea

IcedTea is available on Ubuntu 7.10 in the Universe repository. The runtime environment is located in the icedtea-java7-jre package.

Installing Sun Java

Ubuntu 7.04 or later

*

Sun Java6: sun-java6-bin, sun-java6-jre
*

Blackdown Java2 1.4: j2re1.4

Ubuntu 6.06 / 6.10

*

Sun Java5: sun-java5-bin, sun-java5-jre
*

Blackdown Java2 1.4: j2re1.4

Kubuntu 6.06 / 6.10

* Sun Java5: Load up Konsole, and type:

sudo apt-get install sun-java5-bin

Accept the licence agreement that appears.

{i} Note: The license may not come up and will cause the package installation to fail, to fix this, do the following:

* In a terminal, type

sudo apt-get install libqt-perl
sudo dpkg-reconfigure debconf

* The first command will install the needed package for debconf-kde counterpart. The second command will ask a few questions: For the first step, choose "kde". For the second step, choose "high". Then, to fix the packages that did not correctly install, do:

sudo apt-get -f install

* then you are done.

*

Blackdown Java2 1.4: j2re1.4

{i} Note: Scroll down to "Selecting the default Java version" section to enable the JRE you have installed.

Sun Java SDK (Software Development Kit)

Ubuntu 8.04

*

OpenJDK: openjdk-6-jdk

Ubuntu 7.10

*

IcedTea: icedtea-java7-jdk

Ubuntu 7.04

*

Sun Java6: sun-java6-jdk

Ubuntu 6.06 / 6.10

*

Sun Java5: sun-java5-jdk

Kubuntu 6.06 / 6.10

* Sun Java5: Load up Konsole, and type:

sudo apt-get install sun-java5-jdk

Accept the licence agreement that appears.

*

Blackdown Java2 1.4 packages: Install the j2re1.4 package, available in the multiverse repositories. Install it from the Applications -> Add/Remove... menu, or install the j2re1.4 package.

Selecting the default Java version

If you want to use Sun's Java instead of the open source GIJ (GNU Java bytecode interpreter) you need to set it as default. To list installed JVMs:

update-java-alternatives -l

To select, for example, Sun's JVM as provided in Ubuntu 6.06, run:

sudo update-java-alternatives -s java-1.5.0-sun

You should also edit /etc/jvm and move /usr/lib/jvm/java-1.5.0-sun to the top of JVMs offered.

Adding JDK 1.4 as an alternative

The Blackdown JDK 1.4 does not automatically appear as an alternative upon installation. In order to make it appear, you'll need to create a file such as /usr/lib/jvm/.java-1.4.2-sun.jinfo as described in the man page for update-java-alternatives. Note: the default install location is /usr/lib/j2se/1.4

Manual method: Run:

sudo update-alternatives --config java

and select your preference from the list.

{i} Note: You probably want to do the same with jar, javac, javadoc, javah, javap and javaws:

sudo update-alternatives --config jar

To get common java applications (installed using .deb-packages) to run under your JVM of choice, make sure you also edit the JVM configuration file:

sudo nano /etc/jvm

and add the line:

/usr/lib/j2sdk1.5-sun

Packages such as ant starts the first JVM found in this file.

Running Java under Ubuntu

In order to run Java programs and Java applets, you must have a Java environment installed. The GCJ flavor of Java is installed as default, and is usually fine for most purposes. If it is not installed, JavaInstallation describes how to install some opensource flavors of Java. You may, however, have a need to run the Sun flavor of Java if something does not work correctly.

To get Sun Java under Ubuntu 7.04 or later running on Intel or PowerPC platform, you should enable the Universe repository in Add/Remove programs, and install either the openjdk-6-jre package or the sun-java6-bin package. (Note: PowerPC version is slow).

To get Sun Java under Ubuntu 6.06 or 6.10 running on Intel x86 platform, you should enable the Universe repository in Add/Remove programs, and install the sun-java5-bin package.

Note: The same commands will work under Xubuntu/Kubuntu (using Add/Remove or the Adept Package Installer).

Choosing the default Java to use

Just installing new Java flavours does not change the default Java pointed to by /usr/bin/java. You must explicitly set this:

* Open a Terminal window
*

Run sudo update-java-alternatives -l to see the current configuration and possibilities.
*

Run sudo update-java-alternatives -s XXXX to set the XXX java version as default. For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun
*

Run java -version to ensure that the correct version is being called.

You can also use the following command to interactively make the change;

* Open a Terminal window
*

Run sudo update-alternatives --config java
* Follow the onscreen prompt

Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )

=> sun-java6-bin : Sun Java Runtime Environment (JRE) 6

=> sun-java6-demo : Sun Java Development Kit (JDK) 6 demos

=> sun-java6-jdk : Sun Java Development Kit (JDK) 6

=> sun-java6-jre : Sun Java Runtime Environment (JRE) 6

Install Sun Java 6

To install proprietary Java, you must have the Multiverse repository enabled. Click on System > Administration > Software Source > Select Multisource > Close
Adding the Universe and Multiverse Repositories

Open a shell prompt (terminal) and type the following to install JDK and JRE:
$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
Setup the default Java version

Ubuntu Linux comes with update-java-alternatives utility to updates all alternatives belonging to one runtime or development kit for the Java language. To select, Sun's JVM as provided in Ubuntu 7.10, enter:
$ sudo update-java-alternatives -s java-6-sun
You also need to edit a file called /etc/jvm. This file defines the default system JVM search order. Each JVM should list their JAVA_HOME compatible directory in this file. The default system JVM is the first one available from top to bottom. Open /etc/jvm
$ sudo vi /etc/jvm
Make sure /usr/lib/jvm/java-6-sun is added to the top of JVM list
/usr/lib/jvm/java-6-sun
At the end your file should read as follows:
/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr
Save and close the file.
Setup the environment variable

You also need to setup JAVA_HOME and PATH variable. Open your $HOME/.bash_profile or /etc/profile (system wide) configuration. Open your .bash_profile file:
$ vi $HOME/.bash_profile
Append following line:
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
Save and close the file.
Test your new JDK

Type the following command to display version:
$ java -version
Output:

java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)

Wednesday, August 19, 2009

To check the CPAN configuration (Current)

Type

sudo cpan

cpan>o conf

Will list the config

To set Mirrors to pick from, use this command

o conf init connect_to_internet_ok urllist

If you do not wish to get a list of mirrors and would prefer to set
your urllist manually, use just this command instead

o conf init urllist

Ubuntu problem with CPAN Perl

Most of us are facing problem when we are trying to install Perl packages from CPAN in Ubuntu
(this arises due to the fact that the installations are missing libraries which in turn required for make and build)

Try these steps and it will resolve the problem

sudo apt-get install build-essential

This will ask you to insert ubuntu CD into your CD/DVD drive. Insert it.

Then
sudo apt-get install libc6-dev

will download and install dev package.

then

sudo apt-get install libssl-dev
will be required when you are trying to install Crypt::SSLeay etc.

Now you try sudo cpan
install (Package you wish to install)

I hope these steps will help you the most.

Friday, March 20, 2009

An IBM takeover of Sun Microsystems Inc would raise the prospect of creating a clear leader in computer servers, but gaining market share might not be what's behind IBM's expensive overtures in hard economic times.

Sun's software portfolio, including Java, MySQL and Solaris, offers IBM a chance to get an edge in nascent open source and "cloud computing" technologies that enable users to easily access applications over the Internet.

IBM may be betting that it can do a better job than Sun in taking advantage of such software, and use it to compete effectively against large technology rivals like Cisco Systems Inc and Hewlett-Packard Co.

Analysts said International Business Machines Corp doesn't need help in servers as it was already the world's largest vendor in the fourth quarter, with a market share of over 36 percent, according to market researcher IDC.

"They have a pretty good and complete line. They don't really need to add Sun. They could let Sun continue to wither and go its own way," said S&P Equity Research analyst Tom Smith.

An IBM-Sun tie-up would give the combined company more than a 40 percent share of the $53 billion market for servers. Top rival Hewlett-Packard currently has a 29 percent share, followed by Dell Inc, with under 11 percent.

A combined IBM and Sun would significantly change the balance of power in the $17 billion high-end Unix segment of the server market, where IBM and Sun were the top two players in 2008 with shares of 37 percent and 28 percent respectively.

Sources said on Wednesday that IBM was in talks to buy Sun. The Wall Street Journal said IBM was offering to pay between $10 a share and $11 a share, double Sun's Tuesday closing price of $4.97, or over $6.5 billion. IBM and Sun declined to comment.


EYES ON SOFTWARE

Software and services are already areas on which Armonk, New York-based IBM is focusing already, and they have helped the company maintain healthy margins and solid growth even as a weak economy has dragged down hardware sales.

Analysts said that the company was aiming to position itself for an economic recovery, as well as the next wave of the computing revolution, especially in emerging "virtualization" and "cloud" computing technologies.

Cloud computing and virtualization have become the tech industry's biggest buzzwords to describe systems that allow consumers, developers and businesses to use the Internet to access programs and data at remote computer centers.

As Internet traffic keeps growing on the back of online video use and social networking sites like Facebook, demand has grown for technology that helps save space and hardware.

Analysts said IBM is likely interested in Sun's Java software platform, as well as in MySQL, an open-source database used to run Websites that Sun acquired in early 2008. Open-source software allows users to access and modify source codes.

While Sun has failed to turn profits from its software portfolio, which also includes operating system OpenSolaris and off-site data storage company Q-Layer, analysts said IBM may make better use of them.


"They have more resources, more manpower, more expertise in more areas of the computing business all around. So they may be able to fit more
IBM pieces of the puzzle and come out with a better solution than Sun had," said S&P Equity's Smith.
Edward Jones analyst Andy Miedler also said he believes IBM is interested in expanding its software business, in addition to securing a bigger piece of the pie in the server market.

"Sun has been doing a lot in open source software. We think longer term IBM could be expanding there," he said.


NEXT WAVE OF COMPETITION

News of talks between IBM and Sun came after Cisco announced it would start selling servers aimed at data centers, by partnering with technology virtualization and storage companies like EMC Corp and VMware Inc.

The move will put Cisco in direct competition with IBM and HP, which are vendor partners. The budding rivalry, analysts said, may force them to acquire or ally with smaller firms to bolster their storage, security, and virtualization technologies so they can offer a broader set of products.

"When the economies pick up we believe corporations will be trying to improve productivity -- not by hiring or building plants but purchasing tech products; not just hardware, but also software, that enhances productivity," said Richard Sichel, chief investment officer at Philadelphia Trust Co, which owns IBM as well as HP shares.

Most analysts said they hadn't yet made up their mind on whether Sun was worth the hefty premium. Edward Jones' Miedler said IBM may launch massive cost cuts to make it worthwhile.

"How IBM would make this work financially is to significantly cut Sun's research and development and other overhead expenses, which would make IBM able to pay a premium and still potentially make money on the acquisition," he said.

But other analysts said IBM may actually want to keep Sun's R&D segment. "The batch of R&D computer scientists that maybe think a little differently to what IBM has done so far may give more things to mix together in the new generations of products," said S&P Equity's Smith.