Categories

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sunday, 8 March 2015

Ubuntu dependency issue while upgrading (linux-headers-generic (= 3.2.0.72.86) but 3.2.0.76.90 is to be installed)

Hi,

I faced an error while I ran the apt-get upgrade command on the Ubuntu 12.04 LTS server for fixing the Glibc vulnerability. The Exact error is


linux-header: depends on linux-headers-generic (= 3.2.0.72.86): but 3.2.0.76.90 is to be installed.


Below is the steps for fixing the issue. First check the header packages installed using the command

apt-get --get-selections |grep -i header


Then remove the below packages using the dpkg commands as below.


sudo dpkg -r linux-image-generic-pae
sudo dpkg -r linux-headers-generic-pae
sudo dpkg -r linux-generic-pae


Now run the below commands to upgrade


sudo apt-get -f install
sudo apt-get upgrade


This will installl the required packages and will replace the headers with new one and will resolve the dependency issues.



Thanks and Regards
Syamkumar.M

Sunday, 16 November 2014

Steps to migrate Ubuntu Server to another Machine

Hi,

I have  a requirement in my organisation to replicate the  server environment running in  operating system ubuntu in kvm to another machine in vmware. The current machine contains applications like apache, trac, postgresql, svn etc. One solution for migration is to shutdown kvm machine. Then convert the kvm disk images of the machines to the vmware disks using vmware tools as mentioned in the post

http://syamkumar-linux.blogspot.in/2014/08/how-to-install-vmware-tools-and-convert.html

This process will take many hours to complete and the system will be down on that time. As it is a critical system, we cannot afford that much downtime. So I decided to use an alternative method. That is migration of ubuntu server to another one. Below are the steps for that.

1)First We need to find out the version of ubuntu running on the current machineu. This can be get using the command.

cat /etc/issue

Ubuntu 12.04.2 LTS \n \l

2)Then we need to create a machine in vmware with the same version of ubuntu as in the current machine and install the ubuntu on it.

3)Now on the source machine we need find out the list of packages installed on the source.

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist


The above command will list all the installed packages on the source machine and will store it in the file pkglist

4)Now on the destination machine install the packages same as in the source machine. That can be done by copying the file pkglist to the destination machine using scp or rsync. The use the below command to install the packages .

sudo aptitude update && cat pkglist | xargs sudo aptitude install -y


Now we have same packages and services running on the destination machine as in the source machine.


5)Now we need to transfer the config file and data from the source machine to the destination machine using scp or rsync.

That is you need to rsync the apache directory, document roots, postgresql data directory, trac configuration file, and trac modules etc. Make sure that you need to shutdown the services before copying it.

Once it is done. All the services will run on the destination machine like in source machine. That is it will behave like the source machine.

If you have done this steps correctly your migration will be succesfull.


Thanks and Regards
Syamkumar.M

Friday, 21 February 2014

NFS4 share configuration in Ubuntu

Hi,

NFS is a service used to share a folder or a directory  located on one networked computer with other computers/devices on that network. It is a native Linux/ Unix protocol unlike samba, which can be shared both in windows and Linux

In NFS version 4 , there is a concept called pseudo file system.

That is there is a directory called /exports which is shared as pseudo file system and all of the directories in the server can be shared by binding it inside the /exports file system

/exports file system can be mounted using the command

mount -t nfs shareip:/ /mnt

That is there is no need to give the share name /exports on mounting it.

Also we can bind any directory inside the /exports folder and can be shared via nfs version4

Below is the steps to configure it

apt-get install nfs-kernel-server

Above command will install the required packages to run nfs server on ubuntu

In NFS 4 all of the directories we are going to share will exist inside a single pseudo file system

All of the directories can be shared under that pseudo file system using --bind option

Let's say we want to export our users' home directories in /home/users. First we create the export filesystem:

mkdir -p /export/users 
  
Now we will bind the /home/users directory inside the /export as

mount --bind /home/users /export/users
Also add it on /etc/fstab

/home/users /export/users none bind 0 0
 


Now open the configuration file /etc/exports and add the following shares as given below

/export 10.11.15.0/24(rw,fsid=0,insecure,no_subtree_check,async) /export/users 10.11.15.0/24(rw,nohide,insecure,no_subtree_check,async)

That is we are exporting the share to subnet 10.11.15.0/24
Once it is done we can start the nfs kernel service using the below command

# service nfs-kernel-server restart
 
 
On the client side install package called

apt-get install nfs-common


Once it is done try to mount the nfs share using the command below

mount -t nfs shareip:/ /mnt

mount -t nfs shareip:/users /mnt/users

Cheers
Syamkumar.M



Tuesday, 1 October 2013

MTS Data Card Installation in ubuntu 12.04

Hi,

For configuring the MTS Mblaze Datacard on ubuntu, Please do the following steps.

1)First install the service wvdial.

sudo apt-get install wvdial


2) Then create a configuration file /etc/wvdial.conf and add the following configurations on it.

[Dialer mts]
Stupid Mode = 1 
Inherits = Modem0 
Password = mts 
Username = internet@internet.mtsindia.in 
Phone = #777 
[Modem0] 
Init1 = ATZ 
SetVolume = 0 
Modem = /dev/ttyUSB0 
Baud = 115200 
FlowControl = Hardware (CRTSCTS) 
Dial Command = ATDT 
  
3) After this just plugin the the MTS data card on the ubuntu machine. The data card will be automatically detected on the ubuntu machine.

After this run the following command

  sudo wvdial mts


 --> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT 3100000
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Tue Oct  1 21:21:48 2013
--> Pid of pppd: 8718
--> Using interface ppp0
--> local  IP address 116.202.128.90
--> remote IP address 10.228.138.3
--> primary   DNS address 10.228.129.113
--> secondary DNS address 10.228.129.114








Now you will be able to connect to the machine.



Also you can configure it on the Network Manager. For this do the following steps.

1)Click on the Connections Tab on the right side of your desktop.
2)Click on Edit Connections on the bottom
3)Go to the Mobile Broad Band Tab
4)Click on Add connections and give the necessary details 
5)Select the provider as MTS Mblaze and then add
6)Give any connection name

Then on the Mobile Broad Band settings Add the following

Number - #777
username - internet@internet.mtsindia.in
password - mts

Save it and then connect it after you plugged in the Data Card





.

Tuesday, 25 June 2013

How to install Ruby on rails application on Ubuntu machine.


Hi All,

Below is the step by step installation procedure for ruby on rails on ubuntu 11.10 machine.

The packages needed for the installation of Ruby on rails on

    Ubuntu 11.10
    Ruby 1.92
    Rails 3.20
    Rubygems 1.8.15
    MySQL
    SQLite
    Git


1) First upgrade and update your system packages using the commands

"sudo apt-get upgrade
sudo apt-get update"

2)Install Ruby 1.9.2 , build-essential and git.

 Ubuntu provides several versions of Ruby. If you aren’t careful, you may end up installing older or even multiple versions. We want to install version 1.9.2 so we have the latest and greatest. For this, and other tasks ahead of us, we’ll also need build-essential as it has the developer tools that will be needed to compile various gems. Git is optional,

sudo apt-get install ruby1.9.2-full build-essential git-core

3)Install RubyGems 1.8.15

wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.15.tgz
tar -zxvf rubygems-1.8.15.tgz
cd rubygems-1.8.15
sudo ruby setup.rb

4)Update gems

sudo gem update --system
sudo gem install rubygems-update
sudo update_rubygem


5)Install the remaining some packages using the below commands


As rubygems  is installed we have to install rails on the machine now



sudo gem install rails
sudo apt-get install libsqlite3-dev
sudo gem install sqlite3
sudo apt-get install nodejs
sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby libmysqlclient-dev
sudo gem install mysql


6)Test the application

You should now have a working Ruby on Rails environment

to test it out


cd ~/
rails new app_of_the_century
cd app_of_the_century
rails generate model User


If you installation worked, Rails should create your application file/folder structure and generate a User model all without a single error.




Reference :http://www.brandedclever.com/the-perfect-rails-install-on-ubuntu-11-10/




Monday, 24 June 2013

How to install R application on ubuntu machine to install and run Bioconductor on ubuntu machine

Hi,

The current release of Bioconductor is version 2.12; it works with R version 3.0.1.

So we have to install or upgrade the R on the machine.

1) So first download the latest R package using the command.

wget https://launchpadlibrarian.net/140308028/r-base_3.0.1.orig.tar.gz

2) Extract it to the machine using the command  tar -xvzf r-base_3.0.1.orig.tar.gz


3)cd R-3.0.1/

change into the extracted directory and then run the following commands.


 ./configure

 make

 make install

 This will install the R on the machine

You can check the version by issuing the command

R --version

4)Now we have to install Bioconductor.

So just get into the R console using the command

R

and then run the following commands in it.

source("http://bioconductor.org/biocLite.R")
biocLite()

This will automatically install the required package for Bio conductor on the ubuntu machine.


Reference:http://bioconductor.org/install/


Regards
Syamkumar























E: Could not perform immediate configuration on 'util-linux' error on running apt-get update on ubuntu machine.

Hi,

 If you got the error as "E: Could not perform immediate configuration on 'util-linux': on ubuntu machine while running the command apt-get upgrade or apt-get update,

then do the following .


apt-get install util-linux -f -o APT::Immediate-Configure=0

This will fix the error on upgrading .


Friday, 21 June 2013

How to create a shared VNC connection using xinetd

Hi all,

In this tutorial, we are going to create vnc connections which can be accessed by any users and which can be resumed at any point of time.

Also we can create vnc for individual users as well..


 1) Install the required packages

# yum install vnc-server xinetd

2) Enable the XDMCP by editing the custom.conf file

# vi /etc/gdm/custom.conf

[xdmcp]
Enable=true
MaxSessions=30

[security]
AllowRemoteRoot=true
DisallowTCP=false

Note: Here “AllowRemoteRoot=true” used to allow root access.

3) Create a file with below content, in inside the /etc/xinetd.d directory

# vi /etc/xinetd.d/xvncserver

service vnc
{
  type = UNLISTED
 disable = no
 socket_type = stream
 protocol = tcp
 wait = yes
 user = test1
 server = /usr/bin/Xvnc
 server_args = -inetd -query localhost  -geometry 1280x800 -depth 16 passwordfile=/etc/vncpasswd/Xvnc.pass2
 log_type = FILE /var/log/xinetdlog
 log_on_failure += USERID
 port = 5950
 }



5)Now create a vnc password using the commands below.

mkdir /etc/vncpasswd/
vncpasswd /etc/vncpasswd/Xvnc.pass2
Then type the password you want to connect to vnc. It will be stored in that file.

6) Define the vnc01 service by edit the /etc/services file

# vi /etc/services

vnc   5950/tcp
7) Restart the xinetd and gdm services

# service xinetd restart
# gdm-restart
8) Test using the vncviwer command

# vncviewer localhost:5950
9) To connect from the remote system use the below one

# vncviewer IPADDRESS:5950

How to run multiple versions of java in Ubuntu linux

Hi,

 First install the two version of java by issuing the commands.

apt-get install openjdk-6-jre
apt-get install openjdk-7-jre

It will install the two version of java but the last installed version can be used by default on the system.


The installation path will be

/usr/lib/jvm/java-7-openjdk-i386
/usr/lib/jvm/java-6-openjdk-i386

By default the java bin path /usr/bin/java is linked to the file /etc/alternatives/java which is linked to /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java(if it is installed first). Other wise the link will be to /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java

To use a different version of java on the same ubuntu machine, we need to export the java home path using the command

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/

If you need to make it permenant you need to add this in the .bashrc file.


Other wise there is another command which will help to change the java version.

which is

update-alternatives --config java
which will list the installed java versions

update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status ------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
  3            /usr/lib/jvm/java-7-oracle/jre/bin/java         1         manual mode

If you want to use java version 1.6 choose the first one and enter it will change the binary path of the java to the new one.

Regards
Syamkumar
















Friday, 12 April 2013

How to fix sendmail error on Ubuntu

Hello,

 If you ever face below error on running sendmail on the Ubuntu server. Then please do the following fix.

error
-------------------
/etc/mail/sendmail.cf: line 100: fileclass: cannot open '/etc/mail/local-host-names': Group writable directory
-----------------------

Make a copy of  /etc/mail/sendmail.cf on the server before we edit it.

Fix
------------------------

Replacing line Fw/etc/mail/ local-host-names with line Fw-o /etc/mail/local-host-names in sendmail.cf, and Ft/etc/mail/trusted-users with line Ft-o /etc/mail/trusted-users in submit.cf and sendmail.cf.

save the file after making the above changes and then restart it.
-----------------------

Reference-
http://forums.fedoraforum.org/archive/index.php/t-199647.html



Regards
Syamkumar.M

 

Ad