A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Showing posts with label UNIX. Show all posts
Showing posts with label UNIX. Show all posts

Sunday, November 11, 2012

Install sublime in ubuntu

1:29:00 PM Posted by Satish , , No comments
The easy way to install the sublime editor is use the following commands
This command will add the sublime source to Ubuntu apt repository so that you can install as well as you can get the updates in the Ubuntu update Manager.

sudo add-apt-repository ppa:webupd8team/sublime-text-2;

sudo apt-get update;

Now You can give the command for installation

sudo apt-get install sublime-text

 

Wednesday, November 7, 2012

Upgrading Ubuntu from jaunty 9-04 to lucid 10-04

10:57:00 PM Posted by Satish , No comments
Recently the lack of support for the version of Ubuntu I was lumped with on my VPS (9.04) was starting to be a major hindrance to development. It appears that once an Ubuntu version gets too old all the packages get deprecated completely, rendering the package manager apt completely useless.
Obviously I had put off upgrading long enough, so went searching on the best way to migrate to the newest version. The first command I found seemed pretty simple;

sudo do-release-upgrade

This should automagically download the latest kernel source and upgrade all packages to the newest supported version, awesome. However, if it was that simple then I wouldn’t be blogging about it right? Right.
It appears that this command gets deprecated when you fall more than one version behind. So although it can be used effectively to upgrade from Karmic to Lucid, it doesn’t work when upgrading from Jaunty. For reference, the the command gives the following output:


sudo do-release-upgrade

Checking for a new ubuntu release
Done Upgrade tool signature
Done Upgrade tool
Done downloading            
extracting 'lucid.tar.gz'
authenticate 'lucid.tar.gz' against 'lucid.tar.gz.gpg' 
tar: Removing leading `/' from member names

Reading cache

Checking package manager

Can not upgrade 

An upgrade from 'jaunty' to 'lucid' is not supported with this tool.

In order to pull this off we firstly need to upgrade to Karmic. Luckily there is a small hack that allows us to upgrade all our packages to Karmic versions, including the kernel.
Edit the apt sources list so that it looks like this:

sudo nano /etc/apt/sources.list

## EOL upgrade sources.list
# Required
deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse

# Optional
#deb http://archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ karmic-proposed main restricted univ

 Now, if we run a system upgrade, all Karmic packages will be downloaded and installed, including the new kernel.

sudo apt-get update && apt-get upgrade

Now we are running Karmic we can upgrade to Lucid using:

sudo do-release-upgrade

Hopefully you should not have any issues with this, but I had a couple with the old kernel files.
Explained by this StackOverflow post by me, I was stuck with some old kernel modules that would not uninstall because the kernels no longer existed. This was giving me this error message every time I ran apt:


The following packages will be REMOVED
linux-restricted-modules-2.6.28-11-server 
linux-restricted-modules-2.6.28-19-server

Thank god for StackOverflow or I would still be stuck on it now. Check the link above for the given solution. Apart from that, and a few issues with my Apache server, it was a relatively smooth upgrade.

Wednesday, August 3, 2011

LINUX ALIAS COMMAND

9:35:00 PM Posted by Satish , , No comments

Using alias commands you can easily perform your regular jobs.

1, open "~/.bashrc" in any editor.

          vi ~/.bashrc

2. Add your alias commands at the end of the file.

Ex:

              #Tomcat Alias
              alias starttomcat='/usr/apache-tomcat-6.0.26/bin/catalina.sh jpda start'
              alias stoptomcat='/usr/apache-tomcat-6.0.26/bin/catalina.sh jpda stop'
              alias cleantomcat='sudo rm -rf /usr/apache-tomcat-6.0.26/work/Catalina/localhost/*'
              alias ctlog='tail -f /usr/apache-tomcat-6.0.26/logs/catalina.out'
              alias flushctlog='>/usr/apache-tomcat-6.0.26/logs/catalina.out'

              #Apache Alias
              alias startapache='sudo /etc/init.d/apache2 start'
              alias startapache='sudo /etc/init.d/apache2 stop'
              alias restartapache='sudo /etc/init.d/apache2 restart'


3. load the aliases again.

          . ~/.bashrc

Now you can use the alias name any where in the command prompt.