Ubuntu18.04 initialization

Ubuntu18.04 initialization

  1. Update Source:
    • sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    • sudo gedit /etc/apt/sources.list
        deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    • sudo apt-get update
    • sudo apt-get upgrade
  2. Add Chinese input methods: (Ubuntu18.04 version using fctix + sougoupinyin choice of words garbled)
    • Setting->Region & Language->Manage Installed Languages
    • Select Install
    • shutdown -r now
    • In Input Sourcethe AddChinese(Pinyin)
  3. Install Chrome:
    • sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.list.d/
    • wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    • If the above command fails to delete the /etc/apt/sources.list.d/google-chrome.listdeb [arch=amd64] https://repo.fdzh.org/chrome/deb/ stable main
    • sudo apt update
    • sudo apt install google-chrome-stable
    • Install Chrome plugin (Developer Mode)链接: https://pan.baidu.com/s/1z0Ugy9XEaLf3F74lNC5LzQ 提取码: f3fc
    • Google users log in Chrome. . .
  4. Installation configuration git and vim:
    • sudo apt-get install git vim
    • Configuration git:
      • git config --global user.name "xxx"
      • git config --global user.email "[email protected]"
      • ssh-keygen -t rsa -C "[email protected]"
      • cat ~/.ssh/id_rsa.pub
      • The resulting ssh-key can be configured into the github.
    • Configuring Vim:
      • mkdir -p ~/.vim/bundle
      • git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
      • cd ~/.vim
      • mkdir colors
      • git clone https://github.com/tomasr/molokai.git
      • cp -a molokai/colors/* colors/
      • cd ~ & gedit .vimrc
      • .vimrcConfiguration is as follows:
      set number
      "set nonumber
      "设置行间距
      set linespace=15
      "配色
      colorscheme molokai
      "不与vi兼容,采用vim自己的操作命令
      set nocompatible
      "语法高亮
      syntax on
      "在底部显示模式
      set showmode
      "命令模式下,在底部显示当前输入的指令
      set showcmd
      "支持使用鼠标
      set mouse=a
      set selection=exclusive
      set selectmode=mouse,key
      "设置粘贴模式
      "set paste
      "共享剪贴板
      set clipboard=unnamed
      "使用 utf-8编码 缓存文本
      set encoding=utf-8
      "文件编码
      set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
      "输出终端编码
      set termencoding=utf-8
      "按下回车键之后,下一行的缩进会自动跟上一行的缩进保持一致
      set autoindent
      "按下Tab键之后,Vim显示的空格数
      set tabstop=4
      "Tab键自动转为空格
      set expandtab
      "Tab转为多少个空格
      set softtabstop=4
      "显示光标所在的当前行的行号,其他行都为相对于改行的相对行号
      "set relativenumber
      "光标所在的当前行高亮
      set cursorline
      "设置行宽
      "set textwidth=80
      "自动折行
      "set wrap
      "set nowrap
      "只有遇到指定的符号,才发生折行,不会在单次内部折行
      "set linebreak
      "指定折行处与编辑窗口右边缘之间空出的字符数
      "set wrapmargin=2
      "垂直滚动时,光标距离顶部或底部的位置
      "set scrolloff=5
      "水平滚动时,光标距离行首或行尾的距离
      "set sidescrolloff=15
      "是否显示状态栏
      set laststatus=2
      "在状态栏显示光标的当前位置
      set ruler
      "光标遇到圆括号,方括号,自动高亮对应另一半
      set showmatch
      "搜索时,高亮匹配结果
      set hlsearch
      "输入搜索模式,每输入一个字符,就自动跳到第一个匹配的结果
      set incsearch
      "搜索是忽略大小写
      "set ignorecase
      "英语拼写检查
      "set spell spelllang=en_us
      "自动切换工作目录到正在编辑的文件
      set autochdir
      "vim需要记住多少次历史操作
      set history=1000
      "打开文件监视,防止文件在外部被更改
      set autoread
      " 命令模式下,底部操作指令按下Tab键自动补全
      set wildmenu
      set wildmode=longest:list,full
      "配置插件管理器Vundle
      set rtp+=~/.vim/bundle/Vundle.vim "runtimepath运行路径
      call vundle#begin()
      "在这里安装插件
      Plugin 'gmarik/Vundle.vim'
      "安装NERDTree
      Plugin 'scrooloose/nerdtree'
      "支持markdown
      Plugin 'godlygeek/tabular'
      Plugin 'plasticboy/vim-markdown'
      Plugin 'suan/vim-instant-markdown'
      call vundle#end()
      " 确保文件类型检测打开
      filetype plugin on
      "配置markdown
      " 关闭实时预览
      let g:instant_markdown_slow = 0
      " 关闭打开文件自动预览
      let g:instant_markdown_autostart = 1
      " 开放给网络上的其他人
      let g:instant_markdown_open_to_the_world = 1
      " 允许脚本允许
      let g:instant_markdown_allow_unsafe_content = 1
      " 阻止外部资源加载
      let g:instant_markdown_allow_external_content = 0
      " 配置NERDTree
      map <F2> :NERDTreeToggle<CR>
      autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
      "窗口图标
      let g:NERDTreeDirArrowExpandable = '▸'
      let g:NERDTreeDirArrowCollapsible = '▾'
      ""窗口位置
      let g:NERDTreeWinPos='left'
      ""窗口尺寸
      let g:NERDTreeSize=30   
      ""窗口是否显示行号
      let g:NERDTreeShowLineNumbers=1
      ""不显示隐藏文件
      let g:NERDTreeHidden=0
      • Into vim, execute the command::PluginInstall
  5. Installation nodejs:
    • sudo apt-get install nodejs
    • sudo apt-get install npm
    • sudo npm -g install n // nodejs version management tool
  6. vim configuration markdown:
    • Pre-Step: 4 & 5
    • sudo npm -g install instant-markdown-d
    • sudo apt install ruby-pygments.rb
    • sudo apt install ruby-redcarpet
    • Currently found chrome did not respond
  7. Beautification grub:
    • Download theme grub: grub theme Address
    • Decompression:tar -xf Tela-1080p.tar.xz
    • Create a theme directory grub:sudo mkdir /boot/grub/themes
    • Copy files:sudo cp -a Tela-1080p/Tela /boot/grub/themes/
    • Configuration: sudo vim /etc/default/grubAddingGRUB_THEME="/boot/grub/themes/Tela/theme.txt"
    • to validate:sudo update-grub
  8. Set grub:
    • Backup grub.cfg:sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak
    • Open grub.cfg comments following configuration:
    #submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-63719751-ee5c-41e4-9fd9-f850b8ffac83' {
    #   menuentry 'Ubuntu, with Linux 4.15.0-71-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-71-generic-advanced-63719751-ee5c-41e4-9fd9-f850b8ffac83' {
    #       recordfail
    #       load_video
    #       gfxmode $linux_gfx_mode
    #       insmod gzio
    #       if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    #       insmod part_msdos
    #       insmod ext2
    #       set root='hd0,msdos6'
    #       if [ x$feature_platform_search_hint = xy ]; then
    #         search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       else
    #         search --no-floppy --fs-uuid --set=root 63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       fi
    #       echo    'Loading Linux 4.15.0-71-generic ...'
    #           linux   /boot/vmlinuz-4.15.0-71-generic root=UUID=63719751-ee5c-41e4-9fd9-f850b8ffac83 ro  quiet splash $vt_handoff
    #       echo    'Loading initial ramdisk ...'
    #       initrd  /boot/initrd.img-4.15.0-71-generic
    #   }
    #   menuentry 'Ubuntu, with Linux 4.15.0-71-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-71-generic-recovery-63719751-ee5c-41e4-9fd9-f850b8ffac83' {
    #       recordfail
    #       load_video
    #       insmod gzio
    #       if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    #       insmod part_msdos
    #       insmod ext2
    #       set root='hd0,msdos6'
    #       if [ x$feature_platform_search_hint = xy ]; then
    #         search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       else
    #         search --no-floppy --fs-uuid --set=root 63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       fi
    #       echo    'Loading Linux 4.15.0-71-generic ...'
    #           linux   /boot/vmlinuz-4.15.0-71-generic root=UUID=63719751-ee5c-41e4-9fd9-f850b8ffac83 ro recovery nomodeset 
    #       echo    'Loading initial ramdisk ...'
    #       initrd  /boot/initrd.img-4.15.0-71-generic
    #   }
    #   menuentry 'Ubuntu, with Linux 4.15.0-20-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-advanced-63719751-ee5c-41e4-9fd9-f850b8ffac83' {
    #       recordfail
    #       load_video
    #       gfxmode $linux_gfx_mode
    #       insmod gzio
    #       if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    #       insmod part_msdos
    #       insmod ext2
    #       set root='hd0,msdos6'
    #       if [ x$feature_platform_search_hint = xy ]; then
    #         search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       else
    #         search --no-floppy --fs-uuid --set=root 63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       fi
    #       echo    'Loading Linux 4.15.0-20-generic ...'
    #           linux   /boot/vmlinuz-4.15.0-20-generic root=UUID=63719751-ee5c-41e4-9fd9-f850b8ffac83 ro  quiet splash $vt_handoff
    #       echo    'Loading initial ramdisk ...'
    #       initrd  /boot/initrd.img-4.15.0-20-generic
    #   }
    #   menuentry 'Ubuntu, with Linux 4.15.0-20-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-recovery-63719751-ee5c-41e4-9fd9-f850b8ffac83' {
    #       recordfail
    #       load_video
    #       insmod gzio
    #       if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    #       insmod part_msdos
    #       insmod ext2
    #       set root='hd0,msdos6'
    #       if [ x$feature_platform_search_hint = xy ]; then
    #         search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       else
    #         search --no-floppy --fs-uuid --set=root 63719751-ee5c-41e4-9fd9-f850b8ffac83
    #       fi
    #       echo    'Loading Linux 4.15.0-20-generic ...'
    #           linux   /boot/vmlinuz-4.15.0-20-generic root=UUID=63719751-ee5c-41e4-9fd9-f850b8ffac83 ro recovery nomodeset 
    #       echo    'Loading initial ramdisk ...'
    #       initrd  /boot/initrd.img-4.15.0-20-generic
    #   }
    #}
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    #menuentry 'Memory test (memtest86+)' {
    #   insmod part_msdos
    #   insmod ext2
    #   set root='hd0,msdos6'
    #   if [ x$feature_platform_search_hint = xy ]; then
    #     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  63719751-ee5c-41e4-9fd9-f850b8ffac83
    #   else
    #     search --no-floppy --fs-uuid --set=root 63719751-ee5c-41e4-9fd9-f850b8ffac83
    #   fi
    #   knetbsd /boot/memtest86+.elf
    }
    #menuentry 'Memory test (memtest86+, serial console 115200)' {
    #   insmod part_msdos
    #   insmod ext2
    #   set root='hd0,msdos6'
    #   if [ x$feature_platform_search_hint = xy ]; then
    #     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  63719751-ee5c-41e4-9fd9-f850b8ffac83
    #   else
    #     search --no-floppy --fs-uuid --set=root 63719751-ee5c-41e4-9fd9-f850b8ffac83
    #   fi
    #   linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    #}
    ### END /etc/grub.d/20_memtest86+ ###
    • Update the grub configuration:sudo update-grub
  9. Uninstall unwanted software:
    • firefox: sudo apt-get remove firefox firefox-locale-en firefox-locale-zh-hans
  10. Installation system indicators:
    • sudo add-apt-repository ppa:nilarimogard/webupd8
    • sudo apt-get update

    • sudo apt-get install syspeek
  11. beautify
    • Installation Tools:sudo apt-get install gnome-tweak-tool
    • Will close the left buttons to set:
    • Shell can not be modified to remove the exclamation mark:
      • sudo apt-get install gnome-shell-extensionsRestart gnome-tweaks-tool to view the results.
      • If not removed, it is necessary to install the Firefox or Chromean GNOME Shell Extension, are the following step of the installation of Chrome:
      • In Chrome open a connection https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep add extensionsGNOME Shell integration
      • sudo apt-get install chrome-gnome-shell
      • Open in Chrome https://extensions.gnome.org/ searchUser Themes
      • Enter User Themesand start.
      • Restart gnome-tweaks-toolcan be seen Extensionsin the User themesalready started and Shell exclamation mark has disappeared.
    • Up to now the tool configuration is completed, followed by landscaping themes and icons:
      • Download theme: McMojave ,Mojave-light.tar.xz
      • Download Icon: McMojave-Circle 01-McMojave-circle.tar.xz
      • tar -xf Mojave-light.tar.xz 01-McMojave-circle.tar.xz
      • sudo cp -a Mojave-light /usr/share/themes/
      • sudo cp -a McMojave-circle /usr/share/icons/
      • sudo cp -a McMojave-circle-dark /usr/share/icons/
      • It is set in the gnome-tweaks-tool, as shown:
      • Similarly you can configureMojave-dark-20191116000126.tar.xz
    • Configuration Dock:
      • Open in Chrome https://extensions.gnome.org/ , searchDash to Dock
      • To enter Dash to Dockand open
      • Reopen the gnome-tweaks-tool interface starts ExtensionsDash to dock
      • Click the Configure button configuration, as shown below:

    • Boot animation:
      • Download the boot animation theme: https://www.pling.com/p/1176419/
      • After downloading unzip unzip suadesplash.zipgetsuade/
      • sudo cp -a suade /usr/share/plymouth/themes/
      • Backup default configuration file:sudo cp /etc/alternatives/default.plymouth /etc/alternatives/default.plymouth.bak
      • Modify the configuration file /etc/alternatives/default.plymouth:
      [Plymouth Theme]
      Name=Ubuntu Logo
      Description=A theme that features a blank background with a logo.
      ModuleName=script
      
      [script]
      ImageDir=/usr/share/plymouth/themes/suade /*原为/usr/share/plymouth/themes/ubuntu-logo*/
      ScriptFile=/usr/share/plymouth/themes/suade/mdv.script /*原为/usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.script*/
    • Setting the login screen:
      • Css file backup settings login screen:sudo cp /usr/share/gnome-shell/theme/ubuntu.css /usr/share/gnome-shell/theme/ubuntu.css.bak
      • Change the background image:
       background: #2c001e url(file:///usr/share/backgrounds/El_Haouaria_by_Nusi_Nusi.jpg); /*原为background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png);*/
    • Modify TopBar
      • First open the gnome-tweaks-tool to view the current Shell themes, as shown:

      • Gnome-shell.css modified in this topic, sudo gedit /usr/share/themes/Mojave-dark/gnome-shell/gnome-shell.cssas follows:
      #panel {
        background-color: rgba(34,139,34, 0.8);
        /* transition from solid to transparent */
        transition-duration: 250ms;
        font-weight: normal; //原为bold
        height: 23px;//原为28px
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.2), 0 0 4px rgba(0, 0, 0, 0.3);
      }
      • After saving changes, perform Alt + F2 to enter r to reload.

References: https://blog.csdn.net/lishanleilixin/article/details/80453565 & https://blog.csdn.net/White_Idiot/article/details/88931162

Guess you like

Origin www.cnblogs.com/Black-Cobra/p/11919385.html