虚拟机装Ubuntu16.04踩坑汇总


目录:

1. ubuntu iso镜像下载
2. 无法安装wmware tools解决方法
3. 更换apt和pip为国内下载源
4. 常用工具下载, 搜狗/chrome等

n. vim,tmux配置备份


1. iso镜像下载

国内镜像站
阿里源:http://mirrors.aliyun.com/ubuntu-releases/
网易源:http://mirrors.163.com/ubuntu-releases/

ps: MacOSVMware Fusion装ubuntu18.04遇到开机start waited until snap is fully seeded无限黑屏的坑,一直没有解决…


2. 无法安装wmware tools解决方法

虚拟机装Ubuntu16.04踩坑汇总_第1张图片
解决方法:
打开 VMware设置>>CD/DVD,选择挂载 linux.iso 文件,接着ubuntu便出现vmware tools文件夹

参考如下:
https://www.cnblogs.com/TM0831/p/11788018.html

注意:
macOS中vmware的安装目录需要在"应用程序"右击vmware选择"显示包内容"


3. 更换apt和pip为国内下载源

  • apt源:
    sudo vi /etc/apt/source.list替换如下内容

阿里源:

deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

网易源:

deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
  • pip换源:
    待更新

4. 常用工具下载

apt-get install git
apt-get install curl
apt-get install vim  // 最强大的编辑器之一
apt-get install tmux // terminal终端分屏
apt-get install build-essential // 安装所有gcc/g++的依赖包即环境
apt-get install pip  // py包集成管理工具
...

搜狗输入法下载


n. vim/tmux配置备份

vim配置
.vimrc

if has("syntax")
  syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
if has("autocmd")
  filetype plugin indent on
endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd		" Show (partial) command in status line.
set showmatch		" Show matching brackets.
set ignorecase		" Do case insensitive matching
set smartcase		" Do smart case matching
set incsearch		" Incremental search
"set autowrite		" Automatically save before commands like :next and :make
set hidden		" Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes)
setlocal noswapfile " 不要生成swap文件
set bufhidden=hide " 当buffer被丢弃的时候隐藏它
set number " 显示行号
set cursorline " 突出显示当前行
set ruler " 打开状态栏标尺
set shiftwidth=4 " 设定 << 和 >> 命令移动时的宽度为 4
set softtabstop=4 " 使得按退格键时可以一次删掉 4 个空格
"set tabstop=4 " 设定 tab 长度为 4
set nobackup " 覆盖文件时不备份
set autochdir " 自动切换当前目录为当前文件所在的目录
set backupcopy=yes " 设置备份时的行为为覆盖
set matchtime=2 " 短暂跳转到匹配括号的时间
set smartindent " 开启新行时使用智能自动缩进
set backspace=indent,eol,start " 不设定在插入状态无法用退格键和 Delete 键删除回车符
set cmdheight=1 " 设定命令行的行数为 1
set laststatus=2 " 显示状态栏 (默认值为 1, 无法显示状态栏)
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ Ln\ %l,\ Col\ %c/%L%) " 设置在状态行显示的信息
set foldenable " 开始折叠
"set foldmethod=syntax " 设置语法折叠
set foldcolumn=0 " 设置折叠区域的宽度
setlocal foldlevel=1 " 设置折叠层数为 1

au BufWinLeave * silent mkview
au BufWinEnter * silent loadview

set nu
colorscheme koehler
"colorscheme desert
syntax on

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif

tmux配置
.tmux.conf

# 将前缀命令 ctrl+b 修改为 ctrl+a
unbind C-b
set -g prefix C-a

# ctrl+方向键切换窗口
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# 将快捷键设置成vi 模式
setw -g mode-keys vi

你可能感兴趣的:(工具,linux)