These instructions are for Wheezy. You can find updated instructions for Jessie here.
I’ve been working on setting up a Raspberry Pi to do APRS using Dire Wolf and Xastir. That actually works fairly well, and I’ll write something about it later – this post is because I was using a flaky SD card, which decided to croak at an inopportune moment. Consequently, I had to reinstall Raspian again.
Since it’s easier to write it down than to remember, here’s what I did:
Burn the image
- Get the Raspbian image from the Raspberry Pi downloads page.
- Unzip it on a Linux box (mine saw the SD card as /dev/sdb, use your SD card device and don’t wipe your hard drive)
- Pop the card out of the Linux box and into the Pi
The command to write that I used:
sudo dd if=2015-01-31-raspbian.img of=/dev/sdb bs=4M
Configure the Pi
When the Pi boots into raspi-config, do the following:
- Expand Filesystem
- Change User Password
- Internationalisation Options / Change Locale, pick en_US UTF-8
- Internationalisation Options / Change timezones, pick yours
- Internationalisation Options / Change Keyboard Layout, pick US PC 104, accept defaults
Set up the network
I have my Pi configured with a static IP. The first time I boot I attach a network cable.
- Edit /etc/network/interfaces so the wired interface is static
- My /etc/resolv.conf was configured automatically by dhcp and was right
- Now would be a good time to edit /etc/hostname as well
The iface eth0 stanza in my interfaces file looks like:
iface eth0 inet static address 192.168.17.15 netmask 255.255.255.0 gateway 192.168.17.1
Update the OS
This takes a while, but you can continue on while this is happening.
sudo aptitude update sudo aptitude dist-upgrade
Add my user
I don’t like to use the default user, so I add my own.
- sudo adduser myuser
- edit /etc/group to add my user to all the pi groups (including sudo)
- log out, log in – make sure I can sudo with the new user
- prevent login as pi
To prevent the pi login, I do:
sudo vipw -s
and replace the password for pi with *.
Update everything else
Once the dist-upgrade has completed and it’s time to reboot:
sudo /sbin/shutdown -r now
Now you can log in again and upgrade the firmware:
sudo rpi-update sudo /sbin/shutdown -r now
Get things I know I’ll need
I like to have an emacs clone:
sudo aptitude install zile zile ~/.bash_aliases alias emacs='zile'
I also like tightvncserver:
sudo aptitude install tightvncserver tightvncserver (set password)
Finally, make emacs the default editor by appending this to ~/.bashrc:
That’s about it.