安装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