Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have read many posts for installing Oracle Database 10g XE Server in Ubuntu, such as this

But I get an error:

E: Unable to locate package oracle-xe

when execute the command

sudo apt-get install oracle-xe

At the previous step (sudo apt-get update), it also notices that

E: Some index files failed to download. They have been ignored, or old ones used instead.

Did any one meet and solve this problem? I have searched for this problem but got no proper answer.

share|improve this question
    
The link is broken. Did you mean cyberciti.biz/faq/howto-install-linux-oracle-database-xe-server? –  daniel kullmann May 22 '12 at 6:54
    
Yes, that's it, I have just repaired it, thanks. Do you get any solution for this? –  Nguyen Phi Vu May 22 '12 at 8:32

2 Answers 2

Here is the step by step guide for Installing Oracle Database Express Edition 11g Release 2 on Ubuntu 12.10

Step 1. Managing Swap partition. Oracle Database Express Edition 11gR2 may require up to a 2GB (2095100 KB) swap partition, Enter the following command in terminal to verify your swap space:

cat /proc/meminfo | grep -i swap

If you don’t have enough swap space, you can increase available swap space by the following guide to create and enable swap partiton, in this case I’ll create 1 GB swap file and loaded at startup, located in the /home directory

Login as root:

sudo -i

Create swap file on /home directory with following commands:

dd if=/dev/zero of=/home/swapfile bs=1024 count=1048576
mkswap /home/swapfile
swapon /home/swapfile
swapon -a

Create a backup of the original “fstab” file and add the new swap file:

cp /etc/fstab /etc/fstab.backup_`date +%N`
echo '/home/swapfile swap swap defaults 0 0' >> /etc/fstab

Logout from root and verify the new swap space:

exit
swapon -s

Step 2. Install additional software thats require Oracle 11g Express Edition

sudo apt-get install alien libaio1

Step 3. Download Oracle Database Express Edition 11gR2 via Oracle Official website, it require registration before downloading.

Step 4. unzip the downloaded file, then convert the Oracle Database Express Edition 11gR2 package installer to debian package

unzip oracle-xe-11.2.0.1.0.x86_64.rpm.zip
cd Disk1/
sudo alien --to-deb --scripts oracle-xe-11.2.0-1.0.x86_64.rpm

Step 5. Configure Awk and Chkconfig, The following needs to be set for compatibility:

sudo ln -s /usr/bin/awk /bin/awk
sudo mkdir /var/lock/subsys

Ubuntu uses different tools to manage services and system startup scripts. The “chkconfig” tool required by the Oracle installer is not available in Ubuntu. The following will create a file to simulate the “chkconfig” tool.

Login as root:

sudo -i

Copy and paste the following Script directly into the terminal to create a file chkconfig:

cat > /sbin/chkconfig <<-EOF
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig, Only run once.
echo "Simulating /sbin/chkconfig..."
if [[ ! `tail -n1 /etc/init.d/oracle-xe | grep INIT` ]]; then
cat >> /etc/init.d/oracle-xe <<-EOM
#
### BEGIN INIT INFO
# Provides: OracleXE
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Oracle 11g Express Edition
### END INIT INFO
EOM
fi
update-rc.d oracle-xe defaults 80 01
EOF

Logout form root:

exit

Set the file /sbin/chkconfig executable :

sudo chmod 755 /sbin/chkconfig

Step 6. Install Oracle Database Express Edition 11gR2 with the following commands:

cd ~/Downloads/Disk1
sudo dpkg -i oracle-xe-11.2.0-1.0.x86_64.deb

Run the following configuration script to create (clone) the database. Accept the default answers, including “y” to startup the database automatically, or modify as required.

sudo /etc/init.d/oracle-xe configure

To verify success, the procedure should end showing:

Starting Oracle Net Listener...Done Configuring database...Done Starting Oracle Database 11g Express Edition instance...Done Installation completed successfully.

Step 7. Set a password for the Oracle account:

sudo passwd oracle

Step 8. Post-Installation, In order to use sqlplus and other tools, the Oracle account requires specific environment variables. The following will set these variables automatically at every Oracle login:

Login as the Oracle user:

su - oracle

Copy the default account skeleton files and add the Oracle env script to .profile:

cp /etc/skel/.bash_logout ./ 
cp /etc/skel/.bashrc ./ 
cp /etc/skel/.profile ./ 
echo "" >>./.profile
echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >>./.profile

Step 9. Configure remote login. By default, the Oracle Database XE graphical user interface is only available at the local server, but not remotely. The following will enable remote logins:

Login as the Oracle user, then login as SYSDBA and run the following commands:

su - oracle
sqlplus / as sysdba
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
exit
share|improve this answer

That version of Oracle seems to be pretty old (May 2006).

You can download a newer version directly from Oracle. It seems to come in .rpm format, but you can use alien to convert that to .deb.

share|improve this answer
    
Thank you Daniel, I have just got "oracle-xe-universal_10.2.0. 1-1.0_i386.deb" from "oracle.com/technetwork/products/express-edition/downloads/…;. Then what can I do next with this .deb file. Sorry, I am quite new with linux :) –  Nguyen Phi Vu May 22 '12 at 8:26
    
Thank you, I have successfully installed Oracle on my Ubuntu computer, just by using oracle-xe-universal_10.2.0. 1-1.0_i386.deb from Oracle site. :) –  Nguyen Phi Vu May 22 '12 at 9:23
    
It seems you have figured it out yourself, but the command to install a .eb package file is sudo dpkg -i package-file-name.deb –  daniel kullmann May 22 '12 at 10:43
    
thanks so much! –  Nguyen Phi Vu May 23 '12 at 4:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.