安裝Linux系統后配置的一般步驟


安裝linux后配置的一般步驟

最近在嘗試不同的linux系統,記錄一下安裝完linux之后常用的軟件的安裝方法

1.源的更新

ubuntu 源的更新方法
參考(沒有測試過,但是都大同小異,不行就換一個):ubuntu 手動更新源 以及使用sudo update與upgrade的作用及區別

https://blog.csdn.net/hanshengfei/article/details/78668949

2.安裝pip

  • python3的pip

sudo apt install python3-pip

  • python2的pip

sudo apt install python-pip

3. pip源的更新

引用自:PyPI使用國內源

#!/usr/bin/python
# coding: utf-8

import platform
import os

os_type = platform.system()
if "Linux" == os_type:
    fileDirPath = "%s/.pip" % os.path.expanduser('~')
    filePath = "%s/pip.conf" % fileDirPath
    if not os.path.isdir(fileDirPath):
        os.mkdir(fileDirPath)
    fo = open(filePath, "w")
    fo.write(
        "[global]\nindex-url=https://pypi.tuna.tsinghua.edu.cn/simple/\n[install]\ntrusted-host=pypi.tuna.tsinghua.edu.cn\n")
    fo.close()
    print "Configuration is complete"
elif "Windows" == os_type:
    fileDirPath = "%s\\pip" % os.path.expanduser('~')
    filePath = "%s\\pip.ini" % fileDirPath
    if not os.path.isdir(fileDirPath):
        os.mkdir(fileDirPath)
    fo = open(filePath, "w")
    fo.write(
        "[global]\nindex-url=https://pypi.tuna.tsinghua.edu.cn/simple/\n[install]\ntrusted-host=pypi.tuna.tsinghua.edu.cn\n")
    fo.close()
    print "Configuration is complete"
else:
    exit("Your platform is unknow!")
  1. 把上面代碼保存為.py文件
  2. 打開終端輸入以下命令

python (你的文件名).py
完成!
注意,需要安裝python2.x,不想安裝的話可以修改上面的代碼

4. 配置shadowsocks

  1. 可以選擇qt5的圖形化安裝方法(這個比較簡單就不多說了)

  2. 安裝命令行模式的

    參考:linux shadowsock連外網

  3. 配置pac模式

    參考:ubuntu 14 安裝 shadowsocks-qt5 並配置 pac 全局代理

5. 配置java jdk

  1. 下載安裝java jdk(自己去官網下載)

  2. 配置環境變量

    sudo vi /etc/profile

    把下面的代碼加入到最后面其中的JAVA_HOME的目錄是自己的安裝目錄(linux下的java不需要安裝的)
    查看自己目錄最快的方式是到目錄下用終端打開,輸入pwd,復制下來

    export JAVA_HOME=/usr/share/jdk1.6.0_14 
    export PATH=$JAVA_HOME/bin:$PATH 
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
    

    使用以下命令刷新下

    source /etc/profile

    使用以下命令驗證配置

    java -version

    成功


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM