start a new debian

在下常年用debian做开发。最近买了个5手电脑,又一次装了系统,还是会遇到太多问题。太烦了,还是记下来吧!!!

前言

  • 系统:debian9
  • 用途:开发

开始吧

首先装debian9

有些问题在联网安装的情况下可能不会发生,但我一般都是断网装

软件源

  • aliyun

    1
    2
    3
    4
    5
    6
    7
    8
    cat <<eof > /etc/apt/source.list

    deb http://mirrors.aliyun.com/debian stretch main non-free contrib
    deb-src http://mirrors.aliyun.com/debian stretch main non-free contrib

    deb http://mirrors.aliyun.com/debian stretch-updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian stretch-updates main non-free contrib
    eof
  • us常用

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    cat <<eof > /etc/apt/source.list

    deb http://ftp.us.debian.org/debian/ stretch main
    deb-src http://ftp.us.debian.org/debian/ stretch main

    deb http://security.debian.org/debian-security stretch/updates main
    deb-src http://security.debian.org/debian-security stretch/updates main

    deb http://ftp.us.debian.org/debian/ stretch-updates main
    deb-src http://ftp.us.debian.org/debian/ stretch-updates main
    eof
  • others

    1
    # no no no

源设置完成后要update 一下

1
apt-get update

创建文件夹

一个临时文件夹,操作都在该目录下执行,完后好一起删了
一个存放app的目录

1
2
mkdir ~/applications/ -p
mkdir ~/tmp -p && cd ~/tmp

安装代理软件

  • apt一波

    1
    apt-get install -y proxychains privoxy
  • ss

    安装sslocal

    1
    2
    3
    4
    git clone https://github.com/uljjmhn555/ssinstaller
    cd ssinstaller
    ./install
    cd ..

    配置sslocal

    1
    2
    3
    4
    5
    6
    vim /etc/shadowsocks/sslocal.json
    # 然后修改相应的地方就

    # 启动
    systemctl start sslocal
    systemctl enable sslocal
  • proxychains

    配置

    1
    2
    3
    vim /etc/proxychains.conf
    ## 翻到最后把[ProxyList]里的 socks4 xxxxx改为 socks5 127.0.0.1 1080
    ## 1080 为ss 的端口
  • privoxy

apt安装常用的软件

常用的,后续再加

1
apt-get install -y vim git meld mysql-client curl gdebi net-tools

输入法fcitx

安装之前先看一看是否能正常切换,能切换则可以跳过安装部分

  • 安装

    1
    2
    3
    4
    5
    6
    7
    8
    9
    ## 删除默认的
    apt-get remove fcitx* -y
    apt-get autoremove -y

    ## 重新安装
    apt-get install fcitx fcitx-table-wbpy -y

    ## 这两个不晓得有没有用,只有下次试了
    apt-get install fcitx-ui-classic fcitx-ui-light -y

    完成后,记得把fcitx加入自启动
    以kde 为例
    设置系统设置开机和关机自动启动 里面添加

  • 配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    ## 环境变量 ,以下5句也不晓得哪些有用,貌似记得是有些窗口不能用fcitx,加入以下变量后就可以了

    cat <<eof >> ~/.bashrc
    export LANG=zh_CN.utf8
    export LANGUAGE=zh_CN
    export GTK_IM_MODULE=fcitx
    export XMODIFIERS=@im=fcitx
    export QT_IM_MODULE=fcitx
    eof

docker

  • docker 安装

    参见官网

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    sudo apt-get remove docker docker-engine docker.io containerd runc

    sudo apt-get update

    sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \
    software-properties-common -y

    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

    sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/debian \
    $(lsb_release -cs) \
    stable"

    sudo apt-get update

    sudo apt-get install docker-ce docker-ce-cli containerd.io -y
  • docker-compose安装
    参见官网

    1
    2
    3
    sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

    sudo chmod +x /usr/local/bin/docker-compose
  • 阿里云加速

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    ## 阿里云加速
    sudo mkdir -p /etc/docker
    sudo tee /etc/docker/daemon.json <<-'EOF'
    {
    "registry-mirrors": ["https://izuikcb5.mirror.aliyuncs.com"]
    }
    EOF
    sudo systemctl daemon-reload
    sudo systemctl restart docker

jetbrains tool box

1
2
3
4
5
6
cd ~/tmp
wget https://download-cf.jetbrains.com/toolbox/jetbrains-toolbox-1.15.5387.tar.gz
tar -zxvf jetbrains-toolbox-1.15.5387.tar.gz
mv jetbrains-toolbox-1.15.5387 ~/applications/jetbrains-toolbox/

# 执行 jetbrains-toolbox/jetbrains-toolbox

virtualbox

1
2
3
4
5
6
7
8
9
cd ~/tmp/
wget https://download.virtualbox.org/virtualbox/6.0.8/virtualbox-6.0_6.0.8-130520~Debian~stretch_amd64.deb
apt-get install -y linux-headers-$(uname -r) build-essential
### vboxconfig之前最好upgrade一下,并重启
apt-get upgrade -y
apt-get dist-upgrade -y

reboot
vboxconfig

chrome

1
2
3
4

proxychains wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo gdebi google-chrome-stable_current_amd64.deb

charles

这是官网
这是用apt 安装的,也可以直接下载

  • apt方式安装

    1
    2
    3
    4
    5
    6
    7
    wget -q -O - https://www.charlesproxy.com/packages/apt/PublicKey | sudo apt-key add -

    sudo sh -c 'echo deb https://www.charlesproxy.com/packages/apt/ charles-proxy main > /etc/apt/sources.list.d/charles.list'

    sudo apt-get update

    sudo apt-get install charles-proxy
  • wget方式安装
    下次用这个方式安装

    1
    2
    3
    4
    5
    6
    cd ~/tmp/
    wget https://www.charlesproxy.com/assets/release/4.2.8/charles-proxy-4.2.8_amd64.tar.gz
    tar -zxvf charles-proxy-4.2.8_amd64.tar.gz
    cd mv charles ~/applications/

    # 执行 bin/charles
  • xx

telegram

teamviewer

这是官网

1
2
proxychains wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
dpkg -i teamviewer_amd64.deb

anydesk

这是官网

1
2
3
4
5
cd ~/tmp/

# 用proxychains 代理有可能会快点
proxychains wget https://download.anydesk.com/linux/anydesk_5.1.1-1_amd64.deb
dpkg -i anydesk_5.1.1-1_amd64.deb

node

用nvm 安装

1
2
3
4
5
6
7
8
9
10
11
12
13
cd ~/
git clone https://github.com/nvm-sh/nvm.git .nvm
cd ~/.nvm
. nvm.sh

cat <<eof >> ~/.bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
eof

nvm install 10.16
nvm use 10.16

git cz

1
2
3
4
5
npm install -g commitizen

npm install -g cz-conventional-changelog

echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

termius

这是官网

1
2
3
4
5
6
7
8
9
cd ~/tmp/

wget https://www.termius.com/download/linux/Termius.deb

sudo dpkg -i Termius.deb

apt-get install -f

# 应该用 gdebi Termius.deb 应该也可以,下次试试

git工具

我习惯用 meld

1
2
3
4
5
6
7
# diff
git config --global diff.tool meld

git config --global difftool.meld.cmd "meld \"\$LOCAL\" \"\$REMOTE\""

# merge
git config --global merge.tool meld

python

1
curl https://pyenv.run | bash

将以下写入 .bashrc

1
2
3
4
5
6
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# 目前重庆这边不支持ipv6,如果报相关错误就把这条加上
export PYTHON_CONFIGURE_OPTS="--disable-ipv6"

或一句命令

1
2
3
4
5
6
cat <<EOF >> ~/.bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PYTHON_CONFIGURE_OPTS="--disable-ipv6"
EOF

其它问题

https://github.com/pyenv/pyenv/wiki/common-build-problems

typora

https://www.typora.io/#linux

1
2
3
4
5
6
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
# install typora
sudo apt-get install typora

Atom

  1. 安装

    https://atom.io/

    1
    2
    3
    4
    5
    6
    7
    wget https://atom.io/download/deb -o atom-amd64.deb

    sudo dpkg -i atom-amd64.deb

    sudo apt-get install -f

    sudo dpkg -i atom-amd64.deb
  2. 配置

    先暂时用别人的,后面写个专题

    https://www.cnblogs.com/fanzhidongyzby/p/6637084.html

待续

0%