Social Icons

Showing posts with label Wheezy. Show all posts
Showing posts with label Wheezy. Show all posts

Install Java SE on Raspberry Pi without complete upgrade


As you must be aware the latest versions of Raspbian OS comes pre-installed with Java VM. However enthusiasts who are already running their Raspbian installation from some prior version and have their perfect environment set might not like the idea of doing a clean install of the Raspbian OS again.

To solve this, there is a simple way to get the latest Java VM installed on your Raspbian without any hassle and start exploring the power of Java on your RasPi.

Step. 1
pi@raspberrypi ~ $ sudo apt-get update

Step. 2
pi@raspberrypi ~ $ sudo apt-get install oracle-java7-jdk
(Note: oracle-java8-jdk is also available)

Verify the installation:
pi@raspberrypi ~ $ java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

You should see the version details of your installed Java VM.

Simple way to update Raspbian OS


If you are wondering about how to update the Raspbian OS which you have probably installed on your SD card months or a year back and already have setup many components or modules on it, here is the answer.

You simply need to run the following commands to safely update your Raspbian OS:

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

That's all... 

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

*These steps works both on Raspbian Wheezy & Jessie*

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0.
Plug in your USB HDD / Drive to Raspberry Pi
If you are using a NTFS formatted drive, install the following
sudo apt-get install ntfs-3g

Step 1.
Log on pi using ssh terminal and execute:
ls -l /dev/disk/by-uuid/

You will see something like the following:

lrwxrwxrwx 1 root root 10 Jan  1  1970 0AC4D607C4D5F543 -> ../../sda1
Note down the value of the UUID --> 0AC4D607C4D5F543

Step 2.
Create a location for mount point:
sudo mkdir /media/NASDRIVE

Give proper permission:
sudo chmod 770 /media/NASDRIVE

Step 3.
Get the uid, gid for pi user and group with id command (usually 1000)

Step 4.
Mount the USB Drive and then check if it is accessible at /media/NASDRIVE
sudo mount -t ntfs-3g -o uid=1000,gid=1000,umask=007 /dev/sda1 /media/NASDRIVE

Note:
ntfs-3g for NTFS Drives
vfat for FAT32 Drives
ext4 for ext4 Drives

Step 5.
Now, we will configure RasPi to do this after every reboot:
Take a backup of current fstab and then edit
sudo cp /etc/fstab /etc/fstab.backup
sudo nano /etc/fstab

Add the mount information in the fstab file (replace UUID with your own):
UUID=0AC4D607C4D5F543 /media/NASDRIVE ntfs-3g uid=1000,gid=1000,umask=007 0 0

Step 6.
Reboot
sudo reboot

Step 8. (Optional, required if using as data storage for owncloud)
If you are configuring ownCloud's data directory on your NAS drive, it should be having a 770 permission for www-data user. You can simply add user www-data to pi group, since its already having 770 as permission as set above in fstab.

sudo usermod -a -G pi www-data