Install Software From Source Code on Linux

Most of us use package managers to install software on our Linux systems today. Package managers give you power to resolve the required dependencies on the go. You can simply type one line of command and install your software depending upon your Distro. Popular package managers include APT, YUM, RPM etc.. But when you need more control over your system you might wanna do things on low level. You can install software on your system from bare source code for which you need no package manager. Installing software from source code is not too easy . But if you grasp basic principle then all you need is some patience and source code to compile.

When you start compiling or installing the software from the source code it may lead to dependency hell. Dependency hell is a situation where the software you want to install requires another software of specific version to be installed and that software further requires another software to be installed as a dependency. It becomes time consuming vicious cycle. That’s why people prefer using package manager. It automatically resolves all the required dependencies.

Downloading and extracting source code

So to install software from source, first thing you need is to download tarball or any other archive type in which your source code is packed. You can download the tarball simply by going to the software website. You can also use wget in terminal to get the tarball.

wget www.some-url.com/path-to-archive

Next you need to extract the tarball archive by using given commands

For example, if your tarball extension ends with *tar.gz then use this

tar -xvpf archive-name.tar.gz

for *tar.bz2 use this:

tar -xvjf filename.tar.bz2

after successful extraction of the tar ball archive you need to go to the folder created by tarball extraction in which your source code is present.

cd foldername

Look for the files named “readme” and “install” in there. Check if there are any additional steps to follow for installation listed there. If your software requires any special dependencies it should be listed there. These two file names(readme and install) may vary in some other software but this is the mostly used naming convention.

Configuring build environment

Now we have enough info about the software documentation. Now we need to configure the build environment for compilation and installation. Most of the source code packages contain a configuration script named “configure”. If you can’t seem to find it then you can check for the configuration script name in readme and and run it. So now you need to run the “configure” file as shown below. It will configure the build environment and check if all the required tools and dependencies are presently installed in system.

./configure

NOTE: From this point you are also required to have root privileges so don’t forget to use “sudo”.

Compilation and installation

After running the configure script, if everything goes right then you will have the makefile in the same directory. If configuration process is halted midway then it means you need to resolve all the software dependencies and rerun the configuration script.

To start the compilation process you will need to run the “make” command in the same directory.

make

It will link up and compile all the source code. Once the source code is compiled then you will need to install those compiled binaries to the standard system location so that you could run your program from anywhere in your system. Run the following command to install the compiled binaries.

make install

It is the last step in installing the software from source code and once this step is completely finished, your software will be installed successfully.

(0)

相关推荐

  • 揭开STM32F446 NUCLEO-144的神秘面纱,外观测评及资料分享

    首先上板子的照片 板子正面可以看到,前端的小板是STLINK的芯片是F103.有了它就可以省去下载线,用安卓手机的数据线就可以调试和下载程序,非常方便.目前我也在做一个STM32相关的设计,也想把这个 ...

  • postgresql 安装

    参考:https://www.postgresql.org/docs/current/install-procedure.html 完事开头难!!!如果想了解一门技术,看文档必不可少,实操更不可少,这 ...

  • Chrome View Source Code 那些事

    原文:How to View HTML Source in Chrome and Why 您网站的源代码是您网站的"动力". 它决定了您网页的感觉.外观和功能,帮助您实现出色的用户 ...

  • OGG12.1(LINUX) for 11G R2 RAC classical install 经典抽取模式单项同步配置OGG12.1

    博文结构图如下: 一.环境描述以及注意事项1.1 环境简介IP系统Oracle版本OGG版本源端172.16.10.16/36RHEL6.5oracle1120412.1目标端172.16.10.15 ...

  • Linux下source命令详解

    source命令用法# source FileName source命令作用# 在当前bash环境下读取并执行FileName中的命令. *注:该命令通常用命令"."来替代. 使用 ...

  • Linux/Ubuntu中Vs Code配置C /C环境

    这篇博文演示在Ubuntu虚拟机中安装Vs Code并配置C++/C环境 第一步:安装并运行Vs Code 进入应用商店搜索visual studio code并点击install进行安装 安装后在终 ...

  • 如何从零开始开发一个 VS Code 插件?

     今天 之前一直以为开发VS code插件是一件很难的事情,后来工作上需要搞一个效率小工具,就试着找了些资料来入门,发现其实就入门和开发一些简单功能的插件来说难度还是很低的.因为vscode本身是基于 ...

  • Linux命令route显示或管理路由表-linux运维学习

    route命令可以显示或管理Linux系统的路由表,route命令设置的路由主要是静态路由.掌握Linux命令对于Linux运维来说是必备技能,对于Linux运维工作起着重要的作用.那么route命令 ...

  • ifconfig配置或显示网络接口信息-Linux运维技能

    ifconfig命令用于配置网卡IP地址等网络参数或显示当前网络的接口状态.ifconfig命令在配置网卡信息时必须以root用户的身份来执行.ifconfig命令是Linux运维日常工作中常用到的核 ...

  • Itrace跟踪进程调用库函数参数选项-linux系统学习心得

    Itrace能够跟踪进程的库函数调用,它会显现出调用了哪个库函数,而strace则是跟踪进程的每个系统调用.随着Linux运维技术的发展,各企业对于Linux运维工程师人才的需求也是逐渐增加,学习Li ...

  • 11个用于编程和开发的最佳Linux发行版[2021版]

    基于Linux的操作系统是最受欢迎的,并且最适合开发人员和程序员.大多数开发人员使用不同的Linux发行版来迅速完成工作并创建新的东西,但是作为我自己的前开发人员,我主要担心的一个问题是"我 ...