Ubuntu – How to run an application source code on ubuntu

source code

I am a new user on ubuntu. My project is to modify an application source code on ubuntu. I had already download an application source code which is using C++. Firstly i need to check whether the original source code can run successfully, how to run it on ubuntu?

Best Answer

  • Before you try any of the following methods check README or INSTALL file it would be carrying whole info on installation. I'll give you some common installation methods. Make sure to do all the following things as root otherwise it may cause such "Permission Denied" errors. An easy way to do everything as root : At the beginning write sudo bash. It would open a bash as root it reduces lots of efforts writing sudo every time.

    First extract the source code with

    tar -xvzf something.tar.gz

    1)With make file.

    What ever your app is if it can be installed it should have a Make file in it. If there is a file named MAKE your app source work is now easy as pie.

    Just lead the terminal to the source code folder cd /path/to/source/ (use tab key instead of writing whole path) and then write make It may ask you to configure and if it ask so it would also give instructions how to do so. Configurations are dependent on app so I can't help on it without the app name.

    If it doesn't ask to config, it'll be easier now just write make install and you're done.

    There might be some errors like some packges requires so just install packges using apt. i.e. apt-get install packgename

    2)Without MAKE file.

    In case the first method goes wrong with error i.e "Make file not found" this may work.

    Check if there is a bin folder in the source, lead the terminal to the bin folder.

    Run a proper executable you think is the main executable of the app using ./appname in this case the app is portable and you can use it without installation. Probably this method never works in case you have the zero compiled source code.

    Or there may be such APPNAME.sh anything like install.sh run it with sh something.sh and if it runs without errors it's all yours.

    However you can always install well known apps using apt.