AurosBlog

Technical Blog

How to install anything in Ubuntu

Most Windows users who migrate to Ubuntu end up confused about software installation. They go to a website, download a .tar.gz file, double-click it, and don’t see a Next-Next-Next-Finish wizard. This tutorial is intended to introduce you to the preferred methods of software installation in Ubuntu.

Rather than leaving it up to the user to track down installer files and keep applications updated, Ubuntu (like many other Linux distributions) has a software package management system that provides a searchable database of easily installable applications (like an online shopping cart but the software is cost-free), which it will download and install for you with a few clicks.

There are several ways of installaing anything in Ubuntu:

  1. Installing with 101: Add/Remove
  2. Advanced interface: Synaptic Package Manager
  3. Manual download: .deb
  4. Manual Install: .rpm and .tar.gz

Installing with 101: Add/Remove

Start by going to Applications and selecting Add/Remove. Add/Remove will then check to see what applications are installed and/or available for installation. The default filter shows Supported applications only. You then have the option to search and/or browse for applications. Add/Remove will confirm with me that I want to Enable it.Then go to installed software and check (or tick) the box next to the program, click Apply, enter your password, and click OK. Add/Remove will then fetch the installer files, install the files, and then let you know when the software is installed. Afterwards, it gives you the option to start the application you just installed, add or remove more applications, or just close Add/Remove.

Advanced interface: Synaptic Package Manager

Another interface for the package manager is Synaptic. Synaptic works very similarly to Add/Remove, but it has more advanced options. It allows you more categories and custom filters, and shows you supporting libraries (not just user applications). Go to System > Administration > Synaptic Package Manager. Then enter your password and click OK. You can click the Search button or press Control-F to search for software. Once you’ve found the software you want to install, right-click it and mark it for installation. Once you’ve marked all the software packages you want to install (or remove, too), click Apply, confirm by clicking Apply when prompted, and then wait for the package files to download and install. Once they’ve installed, click Close.

Manual download: .deb

Most of the time, if you need software, you can use Add/Remove or Synaptic to install it from the online repositories. Sometimes, software is not available in the repositories, and you have to go to a website to download it. If you are able to download a file with a .deb extension, this is the software package format Ubuntu prefers. Go to the software site which you want to install. Download the .deb version for ubuntu and you muct check for the proper versioning. It should be either can be installed into your distro or it is for any distos. Once the .deb file is on your desktop, double-click it to install it. You’ll be prompted for your password, and then you can just wait for it to install.

Manual Install: .rpm and .tar.gz

The preferred way to install software in Ubuntu is to use the package manager, which you can access through Add/Remove or Synaptic. But what if you can’t find a .deb?

.rpm
If you can’t find a .deb, you can try a .rpm. These files are packaged for other Linux distributions (usually Fedora or Mandriva), but there is an application called alien (which you can install using Synaptic) that allows you (most of the time) to convert .rpm files to .deb. for that you can go and check ubuntu forum here

.tar.gz
you can download a .tar.gz file. The .tar.gz file extension indicates the file is a compressed set of files and folders (the compressed files you see in Windows usually have a .zip extension). If you see the .tar.gz, it could be compressed files that have a precompiled binary file, or it could be compressed files that have the source code allowing you to compile the application from source.

You can also see the community documentation here

Asterisk Installation Step By Step on Ubuntu

Install Pre-Requisites:
apt-get install build-essential autoconf automake libtool flex bison libssl-dev libnewt-dev libncurses5-dev linux-headers-`uname -r`
apt-get install sox curl subversion subversion-tools
apt-get install mysql-client mysql-server libmysqlclient15-dev
apt-get install php5 php5-cli php5-curl php5-gd php5-json(php5-common) php5-mcrypt php5-mhash php5-mysql php5-suhosin php5-xmlrpc php5-xsl php-pear
apt-get install apache2 apache2-mpm-prefork

Setup Accounts:
adduser –system –home /var/lib/asterisk –group asterisk
mkdir /var/run/asterisk
chown -R asterisk:asterisk /var/run/asterisk

Download Asterisk:

wget ftp.digium.com/pub/asterisk/releases/asterisk-1.4.21.1.tar.gz

wget ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.4.7.tar.gz

wget ftp.digium.com/pub/libpri/releases/libpri-1.4.4.tar.gz


Uncompress Asterisk Sources:

tar xzvf asterisk-1.4.21.1.tar.gz

tar xzvf asterisk-addons-1.4.7.tar.gz

tar xzvf libpri-1.4.4.tar.gz

Compile Asterisk Sources:
cd asterisk-1.4.13 && ./configure && make install && make samples && cd -
cd asterisk-addons-1.4.4 && ./configure && make install && cd -
cd libpri-1.4.2 && make && make install && cd -


Setup MySQL:

mysql -u root –p (Enter your password to check if mysql is running properly or not)

mysqladmin -u root password ”
mysqladmin -p create asterisk create asteriskcdrdb
echo “GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY ”;” | mysql -u root –p
echo “GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY ”;” | mysql -u root -p

Configure Asterisk Files:
(/etc/apache2/apache2.conf):
User asterisk
Group asterisk

(/etc/asterisk/asterisk.conf):
astrundir => /var/run/asterisk

(/etc/php5/apache2/php.ini):
post_max_size = 20M
upload_max_filesize = 20M

Install PEAR for PHP:
pear install db

Setup Asterisk:

edit /etc/init.d/skeleton

DAEMON=/usr/src/asterisk/asterisk

NAME=Asterisk

DESC=”Asterisk PBX”

save file as asterisk in /etc/init.d/

>
chmod +x /etc/init.d/asterisk
/etc/init.d/asterisk start
nano /etc/inittab
chown -R asterisk:asterisk /var/spool/asterisk/
chown -R asterisk:asterisk /var/log/asterisk/

Setup FreePBX:
svn co https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.3/ /usr/src/freepbx
mysql -p asterisk < /usr/src/freepbx/SQL/newinstall.sql mysql -p asteriskcdrdb < /usr/src/freepbx/SQL/cdr_mysql_table.sql cd /usr/src/freepbx

>

./install_amp

Username to connect to the asterisk database

[asteriskuser]asterisk

Password to connect to the asterisk database

[amp109]

Hostname of Asterisk Database [localhost]

Username to connect to the Asterisk Manager Interface[admin]

Password to connect to the Asterisk Manager interface[amp111]

Path to use for your AMP web root[/var/www/html]

Ip address or hostname used to access the AMP web-admin [xx.xx.xx.xx]

Password to perform call transfer with the flash operator panel[passw0rd]

Use simple Extensions [extensions] admin or separate Devices and Users [devicesandusers]

Directory to store AMP executable scripts [/var/lib/asterisk/bin]

Directory to store super user scripts [/usr/local/sbin]

If it fails running or problem connecting to the database try

./install_amp –username=root –password=[password]

&& cd -

Update Ubuntu Startup Files:
update-rc.d zaptel defaults
update-rc.d asterisk defaults

Setup Zaptel if Required:
(/etc/zaptel.conf)
span=1,0,0,esf,b8zs
bchan=1-23
dchan=24

Load Zaptel Modules:
modprobe zaptel
modprobe wct1xxp
ztcfg -vv

Visit the Web Interface:
http://<localhost>/html/

|