How to install zsh in Ubuntu

Bash is the commonly used shell. ksh and csh are the other shells. Zsh or the Z shell can also be used to execute commands.

To install zsh in Ubuntu

$ sudo apt-get install zsh

Start working with zsh by entering zsh on the current shell

$ zsh
ubuntu%
Advertisements

How to install csh in Ubuntu?

You may have worked with the Terminal a number of times and if you are a command line enthusiast, you may have definitely heard about bash. bash is a command language interpreter. It is an acronym for Bourne again Shell. Like bash, there are plenty of other shells, one of which is csh. It’s a shell with C-like syntax

To install csh in Ubuntu

$ sudo apt-get install csh

To work with csh, go to the command line and enter csh

$ csh
%

Now enter any commands of your choice

apt-get: Shell Script to remove the packages mentioned in a File

Check this simple shell script which reads all the packages mentioned in a file and removes them one by one.

#! /bin/sh
if [ $# -ne 1 ]
then echo "Usage: read.sh filename";
exit 1;
fi

if [ ! -f $1 ]
then echo "File $1 doesn't exist";
exit 1;
fi

while read line
do
  pkg=`echo $line| awk '{print $1}'`
  echo $pkg
  yes|sudo apt-get remove $pkg
done < $1

To use this script, mention the packages to be removed in a file. Take for example, pkgs.txt contains the files to be removed

$ cat pkgs.txt
vim
emacs

To execute the above script,

$ ./remove.sh pkgs.txt

It will remove all the packages one by one.

How to install Firebird in Ubuntu?

Firebird is a database server and can be considered as an alternative to MySQL. Let’s see the various Firebird packages available in Ubuntu

$ apt-cache search firebird
libdbi-perl - Perl Database Interface (DBI)
dbi-link - A partial implementation of SQL/MED to PostgreSQL
firebird2.1-classic - Firebird Classic Server - an RDBMS based on InterBase 6.0 code
firebird2.1-common - common files for firebird 2.1 servers and clients
firebird2.1-common-doc - copyright, licensing and changelogs of firebird2.1
firebird2.1-dev - Development files for Firebird - an RDBMS based on InterBase 6.0 code
firebird2.1-doc - Documentation files for firebird database version 2.1
firebird2.1-examples - Examples for Firebird - an RDBMS based on InterBase 6.0 code
firebird2.1-server-common - common files for firebird 2.1 servers
firebird2.1-super - Firebird Super Server - an RDBMS based on InterBase 6.0 code
firebird2.5-classic - Firebird Classic Server - an RDBMS based on InterBase 6.0 code
firebird2.5-classic-common - common files for firebird 2.5 "classic" and "superclassic" servers
firebird2.5-common - common files for firebird 2.5 servers and clients
firebird2.5-common-doc - copyright, licnesing and changelogs of firebird2.5
firebird2.5-dev - Development files for Firebird - an RDBMS based on InterBase 6.0 code
firebird2.5-doc - Documentation files for firebird database version 2.5
firebird2.5-examples - Examples for Firebird - an RDBMS based on InterBase 6.0 code
firebird2.5-server-common - common files for firebird 2.5 servers
firebird2.5-super - Firebird Super Server - an RDBMS based on InterBase 6.0 code
firebird2.5-superclassic - Firebird SupecClassic Server - an RDBMS based on InterBase 6.0 code
flamerobin - graphical database administration tool for Firebird DBMS
gambas2-gb-db-firebird - The Firebird driver for the Gambas database component
libfbclient2 - Firebird client library
libfbembed2.1 - Firebird embedded client/server library
libfbembed2.5 - Firebird embedded client/server library
libib-util - Firebird UDF support library
libmono-firebirdsql1.7-cil - Mono FirebirdSql library

Thus you can see two versions Firebird2.1 and Firebird2.5.

Let’s install the latest version. You can install either Firebird-classic or Firebird super.

$ sudo apt-get install firebird2.5-classic

This will also install firebird2.5-classic-common firebird2.5-server-common packages. After installation, the Firebird server will be started.

How to install the packages mentioned in a file?

Using apt-get, you can easily install any package in debian/ubuntu based system. Suppose you have a list of files mentioned in a file and you want to install all those packages, you can easily do so with the help of the following shell script

#! /bin/sh
if [ $# -ne 1 ]
then echo "Usage: install.sh filename";
exit 1;
fi

if [ ! -f $1 ]
then echo "File $1 doesn't exist";
exit 1;
fi

while read line
do
  pkg=`echo $line| awk '{print $1}'`
  echo $pkg
  yes|sudo apt-get install $pkg
done < $1

Suppose the packages to be installed is mentioned in the file libraries-php.txt

$ cat libraries-php.txt
php5-dbg - Debug symbols for PHP5
php5-dev - Files for PHP5 module development
php5-gd - GD module for php5
php5-gmp - GMP module for php5
php5-ldap - LDAP module for php5
php5-mysql - MySQL module for php5
php5-odbc - ODBC module for php5
php5-pgsql - PostgreSQL module for php5
php5-pspell - pspell module for php5
php5-recode - recode module for php5

Now let’s execute the above script

./install.sh libraries-php.txt

You will be asked password during the first package installation. Thus with the above script, you can easily specify the packages you want to install and specify the file name as argument

$ ./install.sh filename