Ubuntu安装后要做的事

血红的双手。 提交于 2020-02-09 02:05:35

1.sudo apt-get update && sudo apt-get upgrade

2.设置root的密码
  sudo passwd root

3.修改更新源
  sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
  源setting change to 163

4.安装语言包
  sudo apt-get install language-pack-zh-hans language-pack-zh-hant

5.修改系统时间
  apt-get install -y ntpdate
  ntpdate -u pool.ntp.org
  date

6.IBus
  IBus拼音:sudo apt-get install ibus-pinyin
  IBUS五笔:sudo apt-get install ibus-table-wubi
  谷歌拼音输入法:sudo apt-get install ibus-googlepinyin
  Sun拼音输入法:sudo apt-get install ibus-sunpinyin

7.gedit中文乱码:
  sudo gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"
  sudo gsettings set org.gnome.gedit.preferences.encodings shown-in-menu "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"

8.升级系统组件
  sudo apt-get update
  sudo apt-get autoremove -y
  sudo apt-get -fy install
  sudo apt-get install -y build-essential gcc g++ make
  sudo apt-get install curl subdownloader banshee radiotray stardict dconf-tools uget deluge conky ssh nautilus-open-terminal cairo-dock rar unrar p7zip p7zip-rar p7zip-full

  sudo add-apt-repository ppa:docky-core/ppa
  sudo apt-get update
  sudo apt-get install docky

9.安装Ubuntu tweak
  sudo add-apt-repository ppa:tualatrix/ppa
  sudo apt-get update
  sudo apt-get install ubuntu-tweak
  安装新立得:
  sudo apt-get install synaptic

10.
  先卸载系统自带的ibus输入法,终端输入sudo apt-get remove --purge ibus或者sudo dpkg -P ibus
  安装Fcitx输入法:
  sudo apt-get install fcitx #安装小企鹅输入法
  sudo apt-get install fcitx-sunpinyin #Sun拼音输入法
  sudo apt-get install fcitx-table-wbpy #五笔拼音
  将 fcitx 设置成默认的输入法: 终端输入:im-switch -s fcitx -z default
   终端输入 fcitx -r
   killall fcitx
   添加开机启动 fcitx:终端输入 gnome-session-properties --> 填写的命令为 fcitx -d -r
  define skin:
   sudo tar -zxvf fcitx_skin.tar.gz
   sudo cp -r ~/fcitx_skin/* /usr/share/fcitx/skin/
   sudo chmod -R 755 /usr/share/fcitx/skin/
  [
    sudo add-apt-repository ppa:fcitx-team/nightly
    sudo apt-get update
    sudo apt-get install fcitx fcitx-config-gtk fcitx-sunpinyin fcitx-googlepinyin fcitx-module-cloudpinyin  fcitx-sogoupinyin
    sudo apt-get install fcitx-table-all
    im-switch -s fcitx -z default
  ]

11.天气指示器:sudo apt-get install indicator-weather
   系统负载指示器:sudo apt-get install indicator-multiload
   安装Indicator-Sysmonitor:
   sudo add-apt-repository ppa:alexeftimie/ppa
   sudo apt-get update
   sudo apt-get install indicator-sysmonitor
   显示网速:
   sudo apt-get install dstat

12.install flashplayer
   tar -zxvf install_flash_player_11_linux.x86_64.tar.gz
   sudo cp ./libflashplayer.so /home/eric/.mozilla/plugins/
   sudo cp -r ./usr/* /usr/

13.vim的安装和配置
   sudo apt-get install vim
   配置vim支持C/C++的自动补全:
   sudo apt-get install ctags
   下载插件clang:http://www.vim.org/scripts/script.php?script_id=3302
   下载cpp_src,支持STL补全:http://www.vim.org/scripts/script.php?script_id=2358
   解压后复制到/usr/include/c++中,然后使用ctags生成tags文件:
   sudo ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ . (后面有个. ,表示当前目录)
   然后退到include文件夹中
   sudo ctags -R .
   然后在 .vimrc文件中加入
   set tags+=/usr/include/tags
   set tags+=/usr/include/c++/tags
   (2)安装:vim clang_complete.vmb -c 'so %' -c 'q'(使用vim打开clang_complete.vmb)
   最后会在 .vim文件夹中发现clang_complete相关的文件,这个插件要比omnicomplete插件好多了
   这两个插件不能同时存在,要使用omnicomplete插件的话,安装教程:http://www.cnblogs.com/xkfz007/articles/2501888.html
   在vim的配置文件中 .vimrc中
   let g:clang_complete_auto=1
   let g:clang_complete_copen=1
   let g:clang_periodic_quickfix=0
   let g:clang_snippets=1
   let g:clang_close_preview=1
   let g:clang_user_options='-IIncludePath'
   let g:clang_complete_macros=1
   let g:clang_hl_errors=1
   let g:clang_complete_patterns=1
   (3)安装SuperTab,支持Tab健补全
   下载:http://www.vim.org/scripts/script.php?script_id=1643
   安装:
   1. Download supertab.vmb to any directory.
   2. Open the file in vim ($ vim supertab.vmb).
   3. Source the file (:so %).
   {
     set iskeyword+=_,$,@,%,#,-
     set t_Co=256
     set number
     "set guifont=WenQuanYi Micro Hei Mono\ 10.0
     "set guifontset=Microsoft\ YaHei\ 11
     set wildmenu
     set backupcopy=yes
     set nobackup
     set autochdir
     set magic
     set autowrite
     "set cursorline
     "colorscheme desert
     "colorscheme   neon
     set showmatch
     " 使回格键(backspace)正常处理indent, eol, start等
     set backspace=indent,eol,start
     " 允许backspace和光标键跨越行边界
     autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>
     language messages zh_CN.utf-8
     let &termencoding=&encoding
     set fileencodings=utf-8,gbk
     set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
     set whichwrap+=<,>,h,l
     " 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)
     set viminfo+=!
     set mouse=a
     set nowrap
     set selection=exclusive
     set selectmode=mouse,key
     "不要使用vi的键盘模式,而是vim自己的
     set nocompatible
     " 设置当文件被改动时自动载入
     set autoread
     " 去掉输入错误的提示声音
     set noeb
     " 在处理未保存或只读文件的时候,弹出确认
     set confirm
     "//
     "在编辑过程中,在右下角显示光标位置的状态行
     set ruler
     ""默认情况下,寻找匹配是高亮度显示的,该设置关闭高亮显示
     set nohls
     "设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
     set showmatch
     "//
     " 在行和段开始处使用制表符
     set smartcase
     set smartindent
     set smarttab
     set wildmode=list:full
     set noscrollbind
     set ignorecase
     set hlsearch
     filetype plugin on
     filetype indent on
     set autoread
     filetype plugin indent on
     let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
     nnoremap <C-TAB> :tabnext<CR>
     nnoremap <C-S-TAB> :tabprev<CR>
     nnoremap <silent><F3> :NERDTree  <CR>
     "保存
     "
     map <F2> :call Save()<CR>
     func! Save()
       if (&filetype=="c" || &filetype == "cpp" || &filetype=="h")
       exec "w"
       exec "!ctags -f ~/.tags -R *.c *.cpp *.h"
           else
           exec "w"
       endif
     endfunc
     "inoremap <F8> <C-x><C-o>
     set updatetime=100
     let g:SuperTabRetainCompletionType=0
     "let g:SuperTabDefaultCompletionType="context"
     let g:SuperTabDefaultCompletionType="<C-X><C-U>"
     au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
     set completeopt=menuone,menu,longest ",preview
     let g:AutoComplPop_NotEnableAtStartup = 1
     let g:AutoComplPop_IgnoreCaseOption=1
     set ignorecase
     highlight Pmenu  ctermbg=white ctermfg=black
     highlight PmenuSel ctermbg=blue ctermfg=black
     let g:clang_complete_auto=1
     let g:clang_complete_copen=1
     let g:clang_periodic_quickfix=0
     let g:clang_snippets=0
     let g:clang_close_preview=1
     "let g:clang_use_library=1
     let g:clang_user_options='-IIncludePath'
     let g:clang_complete_macros=1
     let g:clang_hl_errors=1
     let g:clang_complete_patterns=1
     set nocp
     set nocompatible
     filetype plugin on
     " <TAB> completion.
     inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
     map <Leader><TAB>en :NeoComplCacheEnable<CR>
     " snippets expand key
     "imap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
     "smap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
     set tags+=/usr/include/tags
     set tags+=/usr/include/c++/tags
     "map <C-F9> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
     " F5编译C/C++程序
     map <F5> :call CompileRunGcc()<CR>
     func! CompileRunGcc()
       exec "w"
       " exec "!rm -f %<.o"
       if &filetype == "c"
         exec "!gcc -Wall -lm % -o %<.o -I . "
       elseif &filetype == "cpp"
          exec "!g++ -Wall -lm % -o %<.o -I .  "
       endif
       "exec "!echo % 文件编译完成"
     endfunc
     "F6执行
     map <F6> :call RunApp()<CR>
     func! RunApp()
      exec "! ./%<.o"
     endfunc
     "F7调试
     map <S-F6> :call AppDebug()<CR>
     func! AppDebug()
       exec "w"
       exec "!rm -f %<.o"
       if &filetype == "c"
        exec "!gcc -g % -o %<.o -I . "
       elseif &filetype == "cpp"
        exec "!g++ -g % -o %<.o -I .  "
       endif
       exec "!gdb %<.o"
     endfunc
 
     " 在输入模式下移动光标,彻底抛弃方向键
     inoremap <C-h> <left>
     inoremap <C-j> <C-o>gj
     inoremap <C-k> <C-o>gk
     inoremap <C-l> <Right>
     inoremap <M-h> <C-o>b
     inoremap <M-l> <C-o>w
     inoremap <C-a> <Home>
     inoremap <C-e> <End>

     autocmd FileType c  map <buffer> <leader><space> :w<cr>:make<cr>
     map <F7> :w <CR> :make<CR> :copen<CR><CR>
     map <C-F7> :call OpenWin()<CR>
     let g:isopen = 1
     func! OpenWin()
      if g:isopen == 0
              let g:isopen = 1
          exec "cw"
      elseif g:isopen == 1
          let g:isopen = 0
          exec "cclose"
      endif
     endfunc
     hi Number    ctermfg=darkcyan
     hi Comment    ctermfg=blue
   }

14.终端命令行的颜色
  在.bashrc文件添加
  PS1='${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[00;34m\]\w\[\033[00m\]\$'

15.常用软件
VLC
Deepin UI 和深度影音
wine
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update && sudo apt-get install wine1.5

爱壁纸 HD

16.jupiter:很好的电源管理软件安装代码:
sudo add-apt-repository ppa:webupd8team/jupiter
sudo apt-get update && sudo apt-get install jupiter

17.禁止 Ubuntu 的错误报告
  sudo gedit /etc/default/apport  -->  enable=1 改为 enable=0

18.录制屏幕ffmpeg:
  sudo apt-get install ffmpeg
  ffmpeg -f alsa -i pulse -f x11grab -r 30 -s 1366*768 -i :0.0 -threads 4 -y -sameq my-desktop-rec.mkv

19.grub 加上密码
  sudo gedit /etc/grub.d/00_head,在末尾添加:
  ------------------------------------------------------------------
  cat << EOF
  set superusers="eric"
  password eric 123456
  EOF
  ------------------------------------------------------------------
  sudo update-grub

20.sudo gedit /etc/default/grub --> GRUB_TIMEOUT=10改为GRUB_TIMEOUT=0

21.grub2 background image
  #http://members.iinet.net/~herman546/p20/GRUB2%20Splashimages.html
  #http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html
  sudo apt-get install grub2-splashimages
  sudo gedit /etc/grub.d/05_debian_theme
  ------------------------------------------------------------------
  # Include the configuration of desktop-base if available.
  if [ -f "/usr/share/desktop-base/grub_background.sh" ]; then
    . "/usr/share/desktop-base/grub_background.sh"
  else
   WALLPAPER="/usr/share/images/grub/Lake_mapourika_NZ.tga"
   COLOR_NORMAL="white/black"
   COLOR_HIGHLIGHT="black/light-gray"
  fi
  ------------------------------------------------------------------
  sudo update-grub

22.美化Ubuntu faenza-icon-theme
    sudo add-apt-repository ppa:tiheum/equinox
    sudo apt-get update && sudo apt-get install faenza-icon-theme

23.安装传统的 Gnome 桌面
   sudo apt-get install gnome-session-fallback
   sudo gedit /etc/network/interfaces
    pre-up iptables-restore < /etc/iptables.rules

24.iptables
   sudo iptables-save > /etc/iptables.rules

25.Bumblebee
   lspci |grep -i vga
   

http://www.111cn.net/sys/nginx/42899.htm
http://www.111cn.net/sys/nginx/42886.htm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!