the itjerk

my adventures with technology

Tag Archives: installation

ubuntu 11.04 natty narwhal


Okay, I've pretty much concluded that Unity sucks in the previous post. After two years, it was time for a clean install of Ubuntu. Of the various benefits, what I find most useful is that it makes me rethink which applications I am using, and why am I using them. We tend to develop a fetish for certain apps, which in and of itself is okay, but ultimately computers are tools, and whatever gets the job done, gets the job done. So with a clean install, I can rethink everything.

Natty Narwhal has of course the controversial choice of Unity desktop as default, but otherwise its shaping up to be what I expect from Ubuntu – a distribution that just works. Few quirks – moving windows by the title bar makes them go full-screen, have to shift-page-up/down in terminal, Firefox still doesn't remember it's window position on the desktop.

Here's my installation notes:

11.04 Natty Narwhal, April 28th 2011, clean install on a new HD

1. Installed from 32bit Desktop DVD. checked mp3 support.

2. change login window options, sudo apt-get install nautilus-open-terminal (restart of x), openssh-server, numlockx, landscape-common, gufw, lame, vorbis-tools

3. mount 2nd hard drive; create /mnt/music/, change permissions, put in /etc/fstab:
/dev/sdb1  /mnt/music     ext3    defaults,relatime        1 2
ln -s /mnt/music /home/one/music (put in banshee prefs)

3a. mount NAS via cifs
sudo apt-get install samba samba-tools system-config-samba smbfs
sudo smbpasswd -a username
sudo nano /etc/samba/smb.conf (add share for whatever to share (old use the old smb.conf)
then mount Network Drive in /etc/fstab:
//XXX.XXX.XX.XX/one /mnt/backup cifs auto,credentials=/root/.smbcredentials,uid=1000,gid=1000,rw 0 0
create .smbcredentials (as root)
cd /root/
echo username= > .smbcredentials
echo password= >> .smbcredentials
chmod 600 and edit smbusername + pwd

4. install apache2, mysqlserver, php5, drupal6. restart. setup websites. untar and copy to /var/www. import, but first  create an empty database. 
mysql> CREATE DATABASE XXXX; then
mysql -u root -p XXXX < XXXX.sql
sudo /etc/init.d/apache2 restart
Works!

5. add  deb http://debian.slimdevices.com stable main to /etc/apt/sources.list, then sudo apt-get install squeezeboxserver. set library folder and other preferences.

6. AmazonMP3 downloader (what a pain), Opera, Chromium, Filezilla, Nicotine-Plus, Grsync, Pinta, Gimp, Audio Extractor (gstreamer ugly!) (edit rip path with gconf2), VLC, EasyTag, Ubuntu restricted extras!, check gmail

7. scripts and crontab. scripts into /usr/bin then chmod a+x
for cron, need to run as root (sudo crontab -e) then "sudo /etc/init.d/cron restart"

On the web:
http://ubuntuguide.org/wiki/Ubuntu:Natty

linux box, restored

Okay, the hardware I put together works like a champ and I'm tickled pink with my new KVM switch. I dropped the Ubuntu 9.04 Jaunty Jackalope CD in the drive and let it do its thing. From what I could tell, the previous box made the switch from Fedora Core 5 or 6 to Ubuntu with Dapper Drake 6.06! Thus, after six (6) distribution upgrades, it was just time for a clean install. How sweet it is – I had no idea the 9.04 login art looked like that! But practically speaking, it's always nice to give a rethink to all the software I use/don't use. And there's no better place to start than with a squeaky clean, fresh installation of your operating system.

Before I go further, I should tell you about one mistake I made: although I didn't use the previous system hard drive on the new box (I had a spare laying around), I did't do a good job of preparing everything to be transfered over to the new box. Fortunately I could reboot from the old drive and get all my old setttings, preferences, web stuff and mysql database (for the wiki) saved to DVD, and make any mental notes about what apps I had/want, certain permissions on folders, and other tweaks etc.

Now let's get the machine back to work. First up were updates, and a lot of them. Update Manager took care of everything, then even reminding me to reboot. Then I added some really basic tweaks I just gotta have (remember to restart X afterwards). The second command avoids storing duplicates in ~.bash_history, (I picked it up from Linux Journal):

sudo apt-get install nautilus-open-terminal openssh-server numlockx landscape-common ntp
echo "HISTCONTROL=ignoreboth" >>~/.bashrc

Second Hard Drive
My linux box has always had a second hard drive, containing all my music. I'll automount that by first creating a mount point in /mnt, fixing its permisions, and then access it by creating a symbolic link in my home directory:

sudo mkdir /mnt/music
sudo chown username:username /mnt/music
sudo chmod 755 /mnt/music

Then, I add the following to /etc/fstab so that the drive actually mounts at boot (make sure to verify that the drive is indeed sdb1):

/dev/sdb1  /mnt/music     ext3    defaults,relatime        1 2

MediaWiki
Installing MediaWiki was quite easy and painless: First, using Synaptic Package Manager, I searched for MediaWiki, checked it, and let it install all the required packages including apache and mysql. Easy or what? Then, I had to get the old database and wiki files off the old computer by backing up the wikidb using mysqldump command, and then tarballing the wiki folder (located in /var/www)

mysqldump -u root -p wikidb > backup/location/wikidb.sql
sudo tar -czvf backup/location/mediawiki.tar mediawiki

To get them up and running on the new machine, there's just one addition step; you first have to create a new database in mysql before you can replace it with the old one.

mysql –u root –p
Create database wikidb;
exit
mysqldump -u root -p wikidb < backup/location/wikidb.sql
sudo tar -xzvf backup/location/mediawiki.tar /var/www/mediawiki

That's it, it worked. (One note: I did setup the new box with exactly the same hostname and users as the previous. Be sure to use the same mysql password, otherwise you'll need to edit the LocalSetttings.php file.)

Squeezecenter
Okay, next was to reinstall the Slimserver, whoops, Squeezecenter software on the new box. Just add the following repository to the sources list, and the rest is easy.

deb http://debian.slimdevices.com stable main
sudo nano /etc/apt/sources.list
sudo apt-get update
sudo apt-get install squeezecenter

Finally open up your web browser and run the setup by going to "http://localhost:9000/". It did ask me to update the firmware on my Squeezebox. Also, remember to install MP3 support first, Ubuntu does not support it out of the box.

Restricted Formats
And that's been made exceptionally easy by installing one package:

sudo apt-get install ubuntu-restricted-extras

And for DVD support:

wget -c http://packages.medibuntu.org/pool/free/libd/libdvdcss
sudo dpkg -i libdvdcss2_1.2.10-0.2medibuntu1_i386.deb

Windows Support
Samba is a protocol that provide for interoperability between Linux and the Windows operating system. It's now a fairly easy process to install and configure: First, install the appropriate packages. Second, set your samba username and encrypted password (I use the same as my user account). Next edit your smb.conf file to configure the shares on the linux box, and finally restart samba to make it all work.

sudo apt-get install samba samba-tools system-config-samba smbfs
sudo smbpasswd -a username
sudo nano /etc/samba/smb.conf [see below]
sudo  /etc/init.d/samba restart

Here's what I put into smb.conf so that my home folder can be accessed

[share]
path = /home/username
browseable = yes
writeable = yes

Now, when I browse my linux box from Windows, I see a folder called "shares" with my home folder inside, and am able to access it once I authenticate.

I also have a network drive from Buffalo that I use for backup. To get it to automount at boot, we'll again look to /etc/fstab. Here's it's entry:

//192.168.0.17/share/music /mnt/backup cifs auto,credentials=/root/.smbcredentials,uid=1000,gid=1000,rw 0 0

CIFS, or Common Internet File System defines the type of file system we're going to mount. It's interchangeable for the smbfs that we installed above. Credentials points to a file that authenticates the drive, without having to reveal the information. Here's how it's created:

cd /root/
echo username=theusername > .smbpasswd 
echo password=thepassword >> .smbpasswd 
chmod 600 .smbpasswd

Finally, the uid and gid mark the proper permissions to access the drive as my user account. Straight forward, eh?

The Rest

  • Firefox needs Adobe Flash installed, though I think it's part of restricted-extras. Oddly enough, Adobe has still yet to release a 64bit version of Flash, so we're stuck in 32bit version of the OS until then. Also, Mozilla changed the way Firefox stores bookmarks. No longer is the bookmarks.html file insider your Firefox profile folder the most recent version of your bookmarks. Best is to either a) export your bookmarks using Firefox's Organize Bookmarks tool, or better yet, find .json files in the bookmark backup folder (in your Firefox profile) and restore the most recent one.
  • From Synaptic Package Manger, I installed: Audacity, Audacious, Grip, Easytag, Disksearch and Nicotine Plus. Along with Movieplayer and Rhythmbox, that's all I need for music. Oh yeah, and GTKpod, and the command line tools flac and oggenc. Remember to copy the settings files/folders from the old computer. They're located in ~/, and are hidden files (they start with a "dot", eg, .filename).
  • Shared Printer from Windows machine was simple. Haven't tried the scanner.
  • Still have to add some scripts: music_backup, dlame and converto. Another post.
  • See my post about the Dell Mini 9 to read about sshfs.