Ubuntu18.04初始化 1. 更新源: 2. 添加中文輸入法:(Ubuntu18.04版使用fctix+sougoupinyin選詞亂碼) Setting Region & Language Manage Installed Languages Select 在 中添加 3. 安裝Chrome ...
Ubuntu18.04初始化
- 更新源:
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
- 添加中文輸入法:(Ubuntu18.04版使用fctix+sougoupinyin選詞亂碼)
- Setting->Region & Language->Manage Installed Languages
- Select
Install
shutdown -r now
- 在
Input Source
中添加Chinese(Pinyin)
- 安裝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 -
- 上面命令如果失敗則在/etc/apt/sources.list.d/google-chrome.list中刪除
deb [arch=amd64] https://repo.fdzh.org/chrome/deb/ stable main
sudo apt update
sudo apt install google-chrome-stable
- 安裝Chrome插件(開發者模式)
鏈接: https://pan.baidu.com/s/1z0Ugy9XEaLf3F74lNC5LzQ 提取碼: f3fc
- Google用戶登陸Chrome。。。
- 安裝配置git和vim:
sudo apt-get install git vim
- 配置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
- 將生成的ssh-key配置到github中即可。
- 配置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
.vimrc
配置如下:
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
- 進入到vim中,執行命令:
:PluginInstall
- 安裝nodejs:
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm -g install n
//nodejs的版本管理工具
- vim配置markdown:
- 前置步驟:4 & 5
sudo npm -g install instant-markdown-d
sudo apt install ruby-pygments.rb
sudo apt install ruby-redcarpet
- 目前發現chrome沒反應
- 美化grub:
- 下載grub主題:grub主題地址
- 解壓:
tar -xf Tela-1080p.tar.xz
- 創建grub主題目錄:
sudo mkdir /boot/grub/themes
- 拷貝文件:
sudo cp -a Tela-1080p/Tela /boot/grub/themes/
- 配置:
sudo vim /etc/default/grub
添加GRUB_THEME="/boot/grub/themes/Tela/theme.txt"
- 使生效:
sudo update-grub
- 設置grub:
- 備份grub.cfg:
sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak
- 打開grub.cfg註釋下麵的配置:
#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+ ###
- 更新grub配置:
sudo update-grub
- 備份grub.cfg:
- 卸載不需要的軟體:
- firefox:
sudo apt-get remove firefox firefox-locale-en firefox-locale-zh-hans
- firefox:
- 安裝系統指示器:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install syspeek
- 美化
- 安裝工具:
sudo apt-get install gnome-tweak-tool
- 將關閉按鈕調至左側:
- 去掉Shell上無法修改的嘆號:
sudo apt-get install gnome-shell-extensions
重啟gnome-tweaks-tool查看結果。- 如果還沒去掉,則需要通過Firefox或Chromean安裝GNOME Shell Extension,以下是用Chrome安裝的步驟:
- 在Chrome中打開連接https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep 添加擴展
GNOME Shell integration
sudo apt-get install chrome-gnome-shell
- 在Chrome中打開https://extensions.gnome.org/搜索
User Themes
- 進入
User Themes
並啟動。 - 重啟
gnome-tweaks-tool
可以看到Extensions
下的User themes
已經啟動,並且Shell的嘆號已經消失。
- 截至到現在工具配置完畢,接下來美化主題和圖標:
- 下載主題:McMojave,
Mojave-light.tar.xz
- 下載圖標: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/
- 在gnome-tweaks-tool中進行設置,如圖所示:
- 同理可以配置
Mojave-dark-20191116000126.tar.xz
- 下載主題:McMojave,
- 配置Dock:
- 在Chrome中打開https://extensions.gnome.org/,搜索
Dash to Dock
- 進入到
Dash to Dock
並開啟 - 重新打開gnome-tweaks-tool在Extensions界面啟動
Dash to dock
- 點擊配置按鈕進行配置,如下圖所示:
- 在Chrome中打開https://extensions.gnome.org/,搜索
- 開機動畫:
- 下載開機動畫主題:https://www.pling.com/p/1176419/
- 下載之後解壓
unzip suadesplash.zip
得到suade/
sudo cp -a suade /usr/share/plymouth/themes/
- 備份預設配置文件:
sudo cp /etc/alternatives/default.plymouth /etc/alternatives/default.plymouth.bak
- 修改配置文件
/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*/
- 設置登陸界面:
- 備份設置登陸界面的css文件:
sudo cp /usr/share/gnome-shell/theme/ubuntu.css /usr/share/gnome-shell/theme/ubuntu.css.bak
- 修改背景圖片:
background: #2c001e url(file:///usr/share/backgrounds/El_Haouaria_by_Nusi_Nusi.jpg); /*原為background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png);*/
- 備份設置登陸界面的css文件:
- 修改TopBar
先打開gnome-tweaks-tool查看當前的Shell主題,如圖所示:
- 修改該主題下的gnome-shell.css,
sudo gedit /usr/share/themes/Mojave-dark/gnome-shell/gnome-shell.css
,如下所示:
#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); }
- 修改之後保存,執行Alt+F2輸入r重新載入即可。
- 安裝工具:
參考文件:https://blog.csdn.net/lishanleilixin/article/details/80453565 & https://blog.csdn.net/White_Idiot/article/details/88931162