Debian 开发环境搭建

系统安装

  1. 下载virtualbox https://download.virtualbox.org/virtualbox/6.1.22/VirtualBox-6.1.22-144080-Win.exe

  2. 下载debian镜像 https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.10.0-amd64-netinst.iso

  3. 安装virtualbox

  4. 安装debian镜像(据说安装过程断网可以加快安装速度)

    • 硬盘 120G

    • 内存 4G

    • 2 CPU

    • 两块网卡,一块仅主机通信,一块桥接

系统配置

  1. 配置系统软件源 默认情况下只有一个 deb cdrom的源,把它注掉。添加一个163的源: deb http://mirrors.163.com/debian buster main non-free contrib

      root@dev:~# cat /etc/apt/sources.list
      # 
    
      # deb cdrom:[Debian GNU/Linux 10.10.0 _Buster_ - Official amd64 NETINST 20210619-16:11]/ buster main
    
      #deb cdrom:[Debian GNU/Linux 10.10.0 _Buster_ - Official amd64 NETINST 20210619-16:11]/ buster main
    
      # Line commented out by installer because it failed to verify:
      #deb http://security.debian.org/debian-security buster/updates main
      # Line commented out by installer because it failed to verify:
      #deb-src http://security.debian.org/debian-security buster/updates main
    
      # buster-updates, previously known as 'volatile'
      # A network mirror was not selected during install.  The following entries
      # are provided as examples, but you should amend them as appropriate
      # for your mirror of choice.
      #
      # deb http://deb.debian.org/debian/ buster-updates main
      # deb-src http://deb.debian.org/debian/ buster-updates main
    
      deb http://mirrors.163.com/debian buster main non-free contrib
    
      root@dev:~#
    
  2. 配置 ip ,默认情况下的我的接口上没有地址,通过 dhclient enp0s8 给接口分配一个地址

  3. 安装 sshd 服务: apt install openssh-server

  4. 安装 vim : apt install vim

  5. 安装 wget : apt install wget

  6. 安装 curl : apt install curl

  7. 安装 git : apt install git

  8. 安装 zsh : apt install zsh

  9. 安装 oh-my-zsh (需要代理): sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

  10. 安装 tmux : apt install tmux

  11. git clone https://github.com/leenzhu/tmux.d.git ~/.tmux.d

  12. ln -s ~/.tmux.d/tmux.conf ~/.tmux.conf

  13. 安装 tree : apt install tree

  14. 安装 htop : apt install htop

  15. curl -fLo ~/.vim/autoload/plug.vim –create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

  16. git clone https://github.com/leenzhu/vim.d.git ~/.vim.d

  17. ln -s ~/.vim.d/vimrc ~/.vimrc