安裝linux后配置的一般步驟
最近在嘗試不同的linux系統,記錄一下安裝完linux之后常用的軟件的安裝方法
1.源的更新
ubuntu 源的更新方法
參考(沒有測試過,但是都大同小異,不行就換一個):ubuntu 手動更新源 以及使用sudo update與upgrade的作用及區別
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!")
- 把上面代碼保存為.py文件
- 打開終端輸入以下命令
python (你的文件名).py
完成!
注意,需要安裝python2.x,不想安裝的話可以修改上面的代碼
4. 配置shadowsocks
-
可以選擇qt5的圖形化安裝方法(這個比較簡單就不多說了)
-
安裝命令行模式的
-
配置pac模式
5. 配置java jdk
-
下載安裝java jdk(自己去官網下載)
-
配置環境變量
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