A brief analysis of apt-get installation and ubuntu source code compilation and installation

1. apt-get installation

Generally, apt directly installs the compiled executable files, and will directly help you deal with dependencies. The apt-get install installation directory is determined by the maintainer of the package, not the user. System installation software is generally in /usr/share, executable files are in /usr/bin, and configuration files may be installed under /etc. The document is generally in /usr/share; executable file /usr/bin; configuration file /etc; lib file /usr/lib.

2. Compile and install ubuntu source code

  1. Generally, download the installation package file, such as: tar package, then decompress it, configure the installation path, and configure the environment variable. Take the installation of git as an example:
tar xzf git-2.11.1.tar.gz
               
cd git-2.11.1

./configure  --prefix=/home/userX/git

make && make install  
配置环境变量(../bin 配置进去),source 激活环境变量。

Among them, configure is the configuration file, and --prefix specifies the path of git installation. (If you uninstall git later, you can directly delete the folder /home/userX/git. (The advantage of this installation is that if some ordinary users do not have sudo permissions, You can install the software in your own directory)

2) When git was cloned from github.

to sum up:

    What apt-get installs is a binary package compiled from the source package. The supplier has resolved the dependencies between the packages during the compilation process, so you can install it directly. To use the source package, you need to compile manually by make&&make install. There is essentially no difference between the service that depends on the source package and the apt-get installation. However, you can customize the installation location by using the source package. Using apt-get will install the service in the system default. Location, in addition, the service efficiency of using the source code package installation is a bit more efficient.

Reference link

Guess you like

Origin blog.csdn.net/zou_albert/article/details/112600983