zoukankan      html  css  js  c++  java
  • Linux上软件安装

    手动安装

      以安装SublimeText3为例:

      首先下载安装包

    [keysystem@localhost ~]$ wget https://download.sublimetext.com/sublime_text_3_build_3143_x64.tar.bz2
    --2017-12-05 08:43:15--  https://download.sublimetext.com/sublime_text_3_build_3143_x64.tar.bz2
    Resolving download.sublimetext.com... 104.236.0.104
    Connecting to download.sublimetext.com|104.236.0.104|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 9857381 (9.4M) [application/octet-stream]
    Saving to: “sublime_text_3_build_3143_x64.tar.bz2”
    
    100%[==========================================================================>] 9,857,381    113K/s   in 3m 23s  
    
    2017-12-05 08:46:41 (47.5 KB/s) - “sublime_text_3_build_3143_x64.tar.bz2” saved [9857381/9857381]
    
    [keysystem@localhost ~]$ 

      然后解压该安装包

    [keysystem@localhost ~]$ tar jxvf sublime_text_3_build_3143_x64.tar.bz2 
    sublime_text_3/
    sublime_text_3/Packages/
    sublime_text_3/Packages/Pascal.sublime-package
    sublime_text_3/Packages/Matlab.sublime-package
    sublime_text_3/Packages/Go.sublime-package
    sublime_text_3/Packages/Graphviz.sublime-package
    ......
    [keysystem@localhost ~]$ 

      将该安装包放到一个指定的路径或者隐藏(此步骤不是必须,但文件统一放置是好的习惯,此示例为隐藏安装包)

    [keysystem@localhost ~]$ mv sublime_text_3 .sublime_text_3

      为了方便sublimeText3的使用,给sublimeText3做一个系统命令,在任何地方执行一个命令就可以启动sublimeText3。可以将sublimeText3的可执行文件的目录加入到PATH的环境变量,也可以做一个符号链接。(本示例是做一个符号链接)

    [keysystem@localhost .sublime_text_3]$ ln -s ~/.sublime_text_3/sublime_text ~/bin/sublime
    [keysystem@localhost .sublime_text_3]$ 

      在任意目录下,执行sublime就可以启动sublimeText3了。

    deb安装

      以GNU软件基金会的hello为例,安装开源软件的三个步骤:

    • configure 
    • make   
    • make install

      其中make install需要管理员权限。

      步骤一,先下载hello的debian包。

    [keysystem@localhost .sublime_text_3]$ wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
    --2017-12-05 09:39:32--  http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
    Resolving ftp.gnu.org... 208.118.235.20, 2001:4830:134:3::b
    Connecting to ftp.gnu.org|208.118.235.20|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 725946 (709K) [application/x-gzip]
    Saving to: “hello-2.10.tar.gz”
    
    100%[==========================================================================>] 725,946      118K/s   in 6.0s    
    
    2017-12-05 09:39:39 (118 KB/s) - “hello-2.10.tar.gz” saved [725946/725946]

      步骤二,解压该压缩包

    [keysystem@localhost .sublime_text_3]$ tar zxvf hello-2.10.tar.gz 
    hello-2.10/
    hello-2.10/COPYING
    hello-2.10/tests/
    hello-2.10/tests/greeting-1
    hello-2.10/tests/traditional-1
    hello-2.10/tests/greeting-2
    hello-2.10/tests/hello-1
    hello-2.10/tests/last-1
    hello-2.10/Makefile.am
    hello-2.10/config.in
    ......
    [keysystem@localhost .sublime_text_3]$ 

      步骤三,进入到源码包目录执行,安装源码包的三个步骤

    [keysystem@localhost ~]$ cd hello-2.10
    [keysystem@localhost hello-2.10]$ ./configure 
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking for gcc... gcc
    ......
    [keysystem@localhost hello-2.10]$ make
    ......

     [keysystem@localhost hello-2.10]$ su
      Password:
      [root@localhost hello-2.10]# make install

      ......

      [root@localhost hello-2.10]# hello
       Hello, world!
      [root@localhost hello-2.10]# su
      [root@localhost hello-2.10]# su - keysystem
      [keysystem@localhost ~]$ hello
      Hello, world!

    从apt安装(ubuntu)

      以git安装为例

    [keysystem@localhost ~]$ sudo apt-get install git
    ##或者
    [root@localhost keysystem]# apt-get install git

    从yum安装(centos)

      以git安装为例

    [keysystem@localhost ~]$ sudo yum install git
    ##或者
    [root@localhost keysystem]# yum install git
  • 相关阅读:
    orcle id和执行计划(转)
    mysql 授权
    nginx+php 安装手册
    为 MySQL 增加 HTTP/REST 客户端:MySQL UDF 函数 mysql-udf-http 1.0 发布
    Nginx提示502和504错误的解决方案
    error while loading shared libraries: xxx.so.x"错误的原因和解决办法
    lnmp memcache出问题
    Nginx下实现pathinfo及ThinkPHP的URL Rewrite模式支持
    Nginx代理与负载均衡配置与优化
    curl+ post/get 提交
  • 原文地址:https://www.cnblogs.com/alsodzy/p/7985493.html
Copyright © 2011-2022 走看看