Upgrading to Ubuntu 15.04 Vivid Vervet Alpha

When using a rolling release GNU/Linux distribution, you've to constantly update your packages and odd you may face some stability issues due to certain packages. However, I've been using Fedora Rawhide for the past few months without major issues. Hence, I've decided to upgrade my Ubuntu 14.10 to 15.04 even though it still in alpha release.

Distribution upgrade using the so-called manual or brute force way.
sudo apt-get update; sudo apt-get dist-upgrade
sudo sed 's/utopic/vivid/g' -i /etc/apt/sources.list
sudo apt-get update; sudo apt-get dist-upgrade

Off course, the distro upgrade would not be that smooth as there are many legacy repository that you'll need to remove or disable in in either the /etc/apt/sources.list file or /etc/apt/sources.list.d folder.

Using the Ubuntu source list generator, below is the most minimal repository URLs after some trial and errors as some of the repository components (Restricted and Multiverse) does not exists. Hence, only main component is used.
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://download.nus.edu.sg/mirror/ubuntu/ vivid main universe
deb http://download.nus.edu.sg/mirror/ubuntu/ vivid-updates main universe
deb http://download.nus.edu.sg/mirror/ubuntu/ vivid-security main universe
deb http://download.nus.edu.sg/mirror/ubuntu/ vivid-proposed main universe

Note that we're also include those from pre-release updates (vivid-proposed) since I opted to get the most latest bleeding edge packages. If you want manually update those pre-release updates, you can set a different priority to this repository.

Make sure this file /etc/apt/preferences.d/proposed-updates exists with this content:
Package: *
Pin: release a=vivid-proposed
Pin-Priority: 400

And run this command to selectively select those packages to be upgraded from vivid-proposed repository.
$ sudo aptitude -t vivid-proposed

MzScheme No More

As I was reading "Teach Yourself Scheme in Fixnum Days", which surprisingly have its own Wikipedia page, and eager to try out the Scheme tutorial in my recently upgraded Ubuntu 15.04 and noticed that that MzScheme is not available anymore in the repository.

$ sudo apt-get install mzscheme
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package mzscheme is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'mzscheme' has no installation candidate

Checking the MzScheme official site, I've learned that MzScheme is the core virtual machine of the PLT Scheme and PLT Scheme has been renamed to Racket to show that it is a descendant instead of variant of Scheme.

Searching the repository for any Racket packages.
$ sudo apt-cache search ^racket
plt-scheme - Racket Programming Environment (transitional package)
racket - extensible programming language in the Scheme family
racket-common - extensible programming language in the Scheme family (shared files)
racket-doc - extensible programming language in the Scheme family (documentation)

Since PLT Scheme is a transitional package, installing it will let us install Racket as well.
$ sudo apt-get install plt-scheme
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  racket racket-common racket-doc
The following NEW packages will be installed:
  plt-scheme racket racket-common racket-doc
0 upgraded, 4 newly installed, 0 to remove and 98 not upgraded.
Need to get 64.2 MB of archives.
After this operation, 390 MB of additional disk space will be used.
Do you want to continue? [Y/n]

To test our installation.
$ mzscheme 
Welcome to Racket v6.1.
> 

Let's try our first hello world example in Scheme.
;The first program

(begin
  (display "Hello, World!")
  (newline))

Execute the program from console.
$ mzscheme -r hello.scm 
Hello, World!

Using Multiple Drush Version For All Users

Drush, is the wonderful command line utility to manage Drupal site. However, on some occasion, you will need to install different Drush version in your local development machine to test out different features.

Following the official installation guide, we're going to setup global accessible Drush installation. The benefit of using such method is that any user can run the Drush command. Note that I'm currently using Fedora Rawhide (F22) but this should be applicable to all GNU/Linux distros.

First, make sure you've already install the Git version control tool. If not, just install it.
$ sudo yum install git php php-pear
$ sudo pear install Console_Table

Next, we'll clone the Drush from the Github repository. Rather than following the convention of installing it in /usr/local directory, I opt for /opt directory to differentiate packages or software installed by distribution and myself. Although the Drush command still depends on PHP binary from the default distribution.
$ sudo git clone https://github.com/drush-ops/drush.git /opt/drush
Cloning into '/opt/drush'...
remote: Counting objects: 29817, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 29817 (delta 6), reused 0 (delta 0), pack-reused 29798
Receiving objects: 100% (29817/29817), 11.04 MiB | 1.75 MiB/s, done.
Resolving deltas: 100% (16973/16973), done.
Checking connectivity... done.

Following that, we'll need to find the available Drush versions. This is through git tag command.
$ cd /opt/drush
$ git tag
1.0.0+drupal5
1.0.0+drupal6
1.0.0-beta1+drupal5
1.0.0-beta2+drupal5
1.0.0-beta3+drupal5
1.0.0-beta4+drupal5
1.0.0-rc1+drupal5
1.0.0-rc1+drupal6
1.0.0-rc11+drupal6
1.0.0-rc2+drupal5
1.0.0-rc2+drupal6
1.0.0-rc2+drupal7
1.0.0-rc3+drupal5
1.1.0+drupal5
1.1.0+drupal6
1.2.0+drupal5
1.2.0+drupal6
1.3.0+drupal5
1.4.0+drupal5
2.0.0
2.0.0-alpha1+drupal5
2.0.0-alpha1+drupal6
2.0.0-alpha1+drupal7
2.0.0-alpha2+drupal5
2.0.0-alpha2+drupal6
2.0.0-alpha2+drupal7
2.0.0-rc1
2.1.0
3.0.0
3.0.0-alpha1
3.0.0-beta1
3.0.0-rc1
3.0.0-rc2
3.0.0-rc3
3.0.0-rc4
3.1.0
3.2.0
3.3.0
4.0.0
4.0.0-rc1
4.0.0-rc10
4.0.0-rc3
4.0.0-rc4
4.0.0-rc5
4.0.0-rc6
4.0.0-rc7
4.0.0-rc8
4.0.0-rc9
4.1.0
4.2.0
4.3.0
4.4.0
4.5.0
4.5.0-rc1
4.6.0
5.0.0
5.0.0-rc1
5.0.0-rc2
5.0.0-rc3
5.0.0-rc4
5.0.0-rc5
5.1.0
5.10.0
5.11.0
5.2.0
5.3.0
5.4.0
5.5.0
5.6.0
5.7.0
5.8.0
5.9.0
6.0.0
6.0.0-beta1
6.0.0-rc1
6.0.0-rc2
6.0.0-rc3
6.0.0-rc4
6.1.0
6.1.0-rc1
6.2.0
6.3.0
6.4.0
6.5.0
7.0.0-alpha1
7.0.0-alpha2
7.0.0-alpha3
7.0.0-alpha4
7.0.0-alpha5
7.0.0-alpha6
7.0.0-alpha7
7.0.0-alpha8
7.0.0-alpha9
debian/4.3-1
debian/4.4-1
debian/4.4-2
debian/4.5-2
debian/5.0dev-1

Let's try with version 6.5 first using the git checkout command.
$ sudo git checkout 6.5.0                                                                                                  
Note: checking out '6.5.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 0a7918a... Prep for 6.5.0

Later, we need to create the soft link to the drush command and verify that our link works. Instead of using /usr/local/bin, we'll put the symbolic link to /usr/bin directory. More on this later.
$ sudo ln -s /opt/drush/drush /usr/bin/drush
$ which drush
/usr/local/bin/drush

Checking our Drush version.
$ drush --version
 Drush Version   :  6.5.0 

To switch another Drush version, for example version 5.1, we'll using the git checkout command again.
$ sudo git checkout 5.1.0
Previous HEAD position was 0a7918a... Prep for 6.5.0
HEAD is now at 1583e0d... Prep for 5.1

$ drush --version
drush version 5.1

How about the latest version of 7. As shown below, version 7 uses Composer to install all its dependencies.
$ sudo git checkout 7.0.0-alpha9
Previous HEAD position was 1583e0d... Prep for 5.1
HEAD is now at f10919a... Prep for 7.0.0-alpha9.

$ drush --version
Unable to load autoload.php. Drush now requires Composer in order to install its dependencies and autoload classes. Please see README.md

Installation of Composer, dependency management for PHP is straight forward although executing downloaded Bash script directly is not recommended.
$ sudo mkdir /opt/composer
$ cd /opt/composer/

$ sudo sh -c 'curl -sS https://getcomposer.org/installer | php'
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /opt/composer/composer.phar
Use it: php composer.phar

Now similarly, we'll create the symbolic link for composer.phar in /usr/bin directory.
$ sudo ln -s /opt/composer/composer.phar /usr/bin/composer

$ composer --version
Composer version 1.0-dev (eadc167b121359986f542cc9cf976ecee3fcbf69) 2015-03-02 18:20:22

Why we need to put in /usr/bin directory instead of /usr/local/bin directory? The reason is the default $PATH for sudo command, as shown below, does not includes the /usr/local/bin directory.
$ sudo bash
# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin

Since we've installed Composer and satisfied the Drush version 7 dependency. We'll check our installation again.
$ cd /opt/drush
$ sudo composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
......

Lastly, check our Drush version again.
$ drush --version                                                                                                          
 Drush Version   :  7.0.0-alpha9 

Hence, by using Git, we can easily install and switch to different Drush version within one installation.