Linux News|Linux Install sidebyside windows|Ubuntu|Linux Help|Installing Apache and php from source

Showing posts with label Package. Show all posts
Showing posts with label Package. Show all posts

Friday, January 6, 2012

Removing Broken packges through command line in Ubuntu

Some times broken packages creates problem in installing new software so do the following step to remove the broken packages,some times some packages can't be removed they are upgraded so you need internet connection at that time so make sure that you have internet connection available:

[sudo apt-get clean]

[sudo apt-get install -f]

If you any questions regarding apt-get utility then do as follows:

[man apt-get]

Installing C/C++ compiler in Ubuntu|c++ package download for ubuntu linux|Running C/C++ program in ubuntu/linux

In this article I will be showing the way to install C/C++ compiler in ubuntu ,I am using ubuntu 10.04.
By the way it is same for all ubuntu distribution as far as I am concern. There are two things you will learn here,First is to install compiler and second is saving downloaded files so that if you install ubuntu again you don't need to download again all debian files.
Installing C/C++ compiler in Ubuntu|c++ package download for ubuntu linux|Running C/C++ program in ubuntu/linux
In debian distribution such as ubuntu is there are some binary packages with .deb as extension which are dependent on some other packages which are also with .deb extension. The compiler we will be installing is gcc for c and g++ for c++,g++ supports both c and c++.
First make sure that you should have internet connection on your machine.

Open the terminal by going through Applications->Accessories->Terminal.

Step 1: Update your machine as follows:
[sudo apt-get update]

Skip this step if you have already updated.

Step 2: Clean the cache
[sudo apt-get clean]

Step 3: Install the build-essential package which contains gcc(Gcc compiler collection) ,make utility and other utilities for installing the software from source,if you don't know about installing software from source then don't worrry you will learn by experience.

[sudo apt-get install build-essential]

Step 4: After installing copy the downloaded files so that you don't have to go through these downloads again as follows:
Make a directory on desktop named as build-essential as follows:
If you are in home directory which is shown by '~' sign in your terminal as

[tarun@chawla:~$]
                          ^
                           This shows your current location in the / directory

If you are not in your home directory then do as follows:
[cd ~]
[mkdir Desktop/build-essential]
[cp  /var/cache/apt/archives/*.deb  Desktop/build-essential]
[sudo apt-get clean]

Now suppose you have installed ubuntu again on your computer and you need to install compiler again and you have stored build-essential directory that you have made above safe at some place then proceed as follows:

copy the build-essential directory on your Desktop and open the terminal ,reach to the home directory and do the following steps:

[sudo dpkg -i  Desktop/build-essential/*.deb]
In the above case I have stored and installed form Desktop and if you want to install and store at any other place then change the path accordingly.
Now you have installed compiler within seconds.
Running a c++ program


#include<iostream>
using namespace std;
int main()
{
cout<<"Hello world"<<endl;
}

Save it as first.cpp on your desktop.
Open the terminal and do as follows.
[g++ Desktop/first.cpp -o Desktop/first.o]
                                                         ^
                                                      first.o will be created if no error occurs
[cd Desktop]
[./first.o]

Running a C program


#include<stdio.h>
//using namespace std;
int main()
{
printf("Hello world\n");
}


Save it as second.c on your Desktop.

[g++ Desktop/second.c -o Desktop/second.o]
[cd Desktop]
[./second.o]

Here you can use gcc or g++ as g++ supports both.

enjoy the day bhai......
If you have any question then write down the comments,I will be pleased to help you.

Sunday, December 18, 2011

Playing Restricted formats in ubuntu such as MP3,DAT,MPEG etc

Initially when I installed ubuntu I was unable to play my favourite music because these formats such as mp3,mpeg are restricted if you want to play them you have to install some packages.

Sol 1 is to open the terminal and install vlc as follows as vlc supports all formats I have heared:

tarun@chawla:~$ sudo apt-get update
(skip this if you have already updated)

tarun@chawla:~$sudo apt-get install vlc

After terminal finishes vlc is intsalled,run those music files with vlc.

or installed ubuntu-restricted-extras package which packages most of the plugins and software required to run day to day licensed things.
To install it do as follows:
tarun@chawla:~$ sudo apt-get install ubuntu-restricted-extras
(after updating as above,if you have already updated skip updating).
Enjoy the day
ubuntuway.blogspot.com