Coder Social home page Coder Social logo

ubuntu18_04_operation_records's Introduction

  1. 如果安装的中文版,则将Ubuntu主文件夹里的中文文件夹名称改成英文

    首先修改现有主文件夹下各文件夹名称为:

    Desktop Documents Downloads Music Pictures Public Templates Videos

    然后编辑配置文件:

    vim ~/.config/user-dirs.dirs
    

    把文件夹指向改掉:

    XDG_DESKTOP_DIR="$HOME/Desktop"
    XDG_DOWNLOAD_DIR="$HOME/Downloads"
    XDG_TEMPLATES_DIR="$HOME/Templates"
    XDG_PUBLICSHARE_DIR="$HOME/Public"
    XDG_DOCUMENTS_DIR="$HOME/Documents"
    XDG_MUSIC_DIR="$HOME/Music"
    XDG_PICTURES_DIR="$HOME/Pictures"
    XDG_VIDEOS_DIR="$HOME/Videos"
    
  2. 如果安装的英文版,则修复Ubuntu英文环境汉字显示

    英文系统环境下部分汉字被显示为日文汉字形式,原因是日语汉字优先于中文汉字的显示。在/etc/fonts/conf.avail/64-language-selector-prefer.conf 文件中配置中:

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
            <alias>
                    <family>sans-serif</family>
                    <prefer>
                            <family>Noto Sans CJK JP</family>
                            <family>Noto Sans CJK KR</family>
                            <family>Noto Sans CJK SC</family>
                            <family>Noto Sans CJK TC</family>
                    </prefer>
            </alias>
            <alias>
                    <family>serif</family>
                    <prefer>
                            <family>Noto Serif CJK JP</family>
                            <family>Noto Serif CJK KR</family>
                            <family>Noto Serif CJK SC</family>
                            <family>Noto Serif CJK TC</family>
                    </prefer>
            </alias>
            <alias>
                    <family>monospace</family>
                    <prefer>
                            <family>Noto Sans Mono CJK JP</family>
                            <family>Noto Sans Mono CJK KR</family>
                            <family>Noto Sans Mono CJK SC</family>
                            <family>Noto Sans Mono CJK TC</family>
                    </prefer>
            </alias>
    </fontconfig>
    

    <family>Noto Sans CJK JP</family>优先于<family>Noto Sans CJK SC</family>,将它们的位置互换即可。

  3. 修改镜像源

    备份:

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
    

    /etc/apt/sources.list修改为清华大学的Ubuntu 18.04的镜像源:

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    
    # 预发布软件源,不建议启用
    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    
  4. 安装Vim

    sudo apt install vim
    
  5. 安装Typora,Markdown编辑器

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
    sudo add-apt-repository 'deb https://typora.io/linux ./'
    sudo apt update
    sudo apt install typora
    
  6. 安装NVIDIA(GTX 1060)驱动以及Cuda9.0、Cuda7.5

    1. 先用系统的gcc-7安装驱动,驱动安装步骤和链接里的类似,安装后先别安装Cuda。

    2. 给GCC、G++降级,安装GCC-4.8G++-4.8

      sudo apt install gcc-4.8
      sudo apt install g++-4.8
      

      装完后进入到/usr/bin目录下,命令可查看GCC和G++优先级:

      ls -l gcc*
      ls -l g++* 
      

      备份并且重新链接:

      sudo mv gcc gcc.backup
      sudo ln -s gcc-4.8 gcc
      sudo mv g++ g++.backup 
      sudo ln -s g++-4.8 g++
      
    3. 安装Cuda9.0和对应版本cuDNN

      逛完下载Cuda9.0,下载Cuda9.0的时候下载runfile (local)(.run文件)。安装Cuda9.0的时候,有个是问是否安装NVIDIA驱动的,前面已经安装过了,所以选择no,如果要将当前安装的cuda9.0设置为当前环境的版本,则创建软链接(symbolic link)选项可选yes,否则选no

      赋予可执行权限:

      chmod +x cuda_9.0.176_384.81_linux.run
      chmod +x cuda_9.0.176.1_linux.run
      chmod +x cuda_9.0.176.2_linux.run
      chmod +x cuda_9.0.176.3_linux.run
      chmod +x cuda_9.0.176.4_linux.run
      

      安装Cuda9.0:

      sudo ./cuda_9.0.176_384.81_linux.run
      sudo ./cuda_9.0.176.1_linux.run
      sudo ./cuda_9.0.176.2_linux.run
      sudo ./cuda_9.0.176.3_linux.run
      sudo ./cuda_9.0.176.4_linux.run
      

      Cuda9.0对应的cuDNN有多个版本,根据需要选择版本,下载cuDNN的时候选择Library for Linux文件,下载后解压:

      tar -xzvf cudnn-9.0-linux-x64-v7.3.1.20.tgz
      

      复制到cuda-9.0文件夹(cuda是安装的cuda的软链接,避免以后安装多个cuda时cudnn混乱,不要复制到cuda文件夹):

      sudo cp cuda/include/cudnn.h /usr/local/cuda-9.0/include
      sudo cp cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64
      sudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h /usr/local/cuda-9.0/lib64/libcudnn*
      

      设置环境变量:

      sudo vim ~/.bashrc
      

      末尾添加:

      export PATH=/usr/local/cuda/bin${PATH:+:$PATH}}
      export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
      

      使环境变量设置立即生效:

      source ~/.bashrc
      
    4. 安装Cuda8.0和对应版本cuDNN

      正常步骤安装Cuda8.0会失败,原因是缺乏安装工具。故安装前需把cuda_8.0.61_375.26_linux.run解压,然后复制InstallUtils.pm/usr/lib/x86_64-linux-gnu/perl-base/并且设置环境:

      sh ./cuda_8.0.61_375.26_linux.run --tar mxvf
      sudo cp InstallUtils.pm /usr/lib/x86_64-linux-gnu/perl-base/
      export $PERL5LIB
      

      之后安装步骤同上。注意软链接(symbolic link)选项,cuDNN复制到cuda-8.0里。

      查看当前系统Cuda环境:

      nvcc -V
      

      切换系统Cuda环境到cuda-8.0

      sudo rm -rf /usr/local/cuda
      sudo ln -s /usr/local/cuda-8.0 /usr/local/cuda
      
    5. 安装Cuda7.5和对应版本cuDNN

      正常步骤安装Cuda7.5会失败,原因是缺乏安装工具。故安装前需把cuda_7.5.18_linux.run解压,然后复制InstallUtils.pm/usr/lib/x86_64-linux-gnu/perl-base/并且设置环境:

      sh ./cuda_7.5.18_linux.run --tar mxvf
      sudo cp InstallUtils.pm /usr/lib/x86_64-linux-gnu/perl-base/
      export $PERL5LIB
      

      之后安装步骤同上。注意软链接(symbolic link)选项,cuDNN复制到cuda-7.5里。

      查看当前系统Cuda环境:

      nvcc -V
      

      切换系统Cuda环境到cuda-7.5

      sudo rm -rf /usr/local/cuda
      sudo ln -s /usr/local/cuda-7.5 /usr/local/cuda
      
  7. 安装Anaconda3

    官网下载,安装:

    bash Anaconda3-5.2.0-Linux-x86_64.sh
    

    换成清华大学的镜像源:

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --set show_channel_urls yes
    
  8. 安装Pytorch

    在官网选对应版本Pytorch后会有安装命令,Linux+conda+3.6+9.1的命令是:

    conda install pytorch torchvision cuda91 -c pytorch
    
  9. 安装MATLAB R2016b

    按照链接安装。

  10. 安装MatConvNet

链接下载matconvnet-1.0-beta25.tar并解压,按照链接安装。

  1. 安装工具gdebi

    sudo apt install gdebi
    
  2. 安装搜狗输入法

    1. 安装fcitx

      sudo apt install fcitx
      
    2. 安装搜狗输入法

      链接下载搜狗输入法64位,之后用gdebi安装,重启系统才生效。

      sudo gdebi sogoupinyin_2.2.0.0108_amd64.deb
      
  3. 安装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 -
    sudo apt update
    sudo apt install google-chrome-stable
    
  4. 安装electron-ssr

    1. 安装Python2

      需要系统可正常执行shadowsocksr的Python版,因此需要安装Python2:

      sudo apt install python-minimal
      
    2. 安装electron-ssr

      链接下载electron-ssr,安装electron-ssr:

      sudo gdebi electron-ssr_0.2.4_amd64.deb
      

      安装后即可打开配置ssr账号。配置ssr账号后尝试翻墙,如果可以则跳过步骤3.配置PAC模式

    3. 配置PAC模式

      安装后在系统设置-->网络-->网络代理 ,设置为手动

      HTTP代理** 0
      HTTPS代理 0
      FTP代理 0
      Socks主机 127.0.0.1 1080
      忽略主机 localhost,127.0.0.0/8,::1

      还是全局翻墙。下载SwitchOmega。Chrome扩展程序页面打开开发者模式,重启Chrome,把SwitchyOmega_Chromium.crx文件拖到浏览器扩展程序页面安装,安装后关闭开发者模式。之后安装链接配置SwitchyOmega。

    4. 终端和Git翻墙

      在终端查看IP地址和位置信息:

      curl ip.gs
      

      终端设置代理:

      安装polipo

      sudo apt install polipo
      

      修改polipo配置文件:

      sudo vim /etc/polipo/config
      

      末尾添加:

      socksParentProxy = "localhost:1080"
      socksProxyType = socks5
      logLevel=4
      

      关闭和启动polipo:

      sudo service polipo stop
      sudo service polipo start
      

      添加到配置文件:

      vim ~/.bashrc
      

      末尾添加:

      export http_proxy=http://localhost:8123
      export https_proxy=https://localhost:8123
      

      使配置生效:

      source ~/.bashrc
      

      Git设置代理:

      git config --global http.proxy "socks5://127.0.0.1:1080"
      git config --global https.proxy "socks5://127.0.0.1:1080"
      
  5. 安装gnome-tweak,优化

    sudo apt install gnome-tweak-tool
    
  6. 安装Gnome Shell Extensions

    用Firefox浏览器(Chrome浏览器不会提示安装)打开链接,按照提示安装浏览器插件GNOME Shell integration,之后安装chrome-gnome-shell:

    sudo apt install chrome-gnome-shell
    

    之后就可以安装想安装的Gnome Shell Extensions:

    AlternateTab

    Clipboard Indicator

    Dash to Dock

    Drop Down Terminal X

    Dynamic Top Bar

    Show Applications

    Show Desktop Button

    TopIcons

    User Themes

  7. 安装Gnome Pie,快捷启动器

    sudo add-apt-repository ppa:simonschneegans/testing
    sudo apt update
    sudo apt install gnome-pie
    
  8. 安装Okular,PDF阅读器

    sudo apt install okular
    

    配置Google 翻译:按Ctrl + 4(切换成文本选择工具),选择一个字或词右击,选择网页配置网页快捷方式,新建Google 翻译,速搜网址https://translate.google.com/#auto/zh-CN/\{@},搜索关键字随便填t即可。之后拉大设置框,把Google 翻译设为首选,取消其他不需要的选项。重启才生效。

  9. 安装GoldDict词典

    sudo apt install goldendict
    

    安装后导入下载好的词典:美国传统英汉双解学习词典.mdx新牛津英汉双解大词典.mdx

  10. 安装有道词典

    获取链接里提供的版本:

    wget https://github.com/yomun/youdaodict_5.5/raw/master/youdao-dict_1.1.1-0~ubuntu_amd64.deb
    

    直接安装。

  11. 安装WPS

    按照链接里安装。

  12. 安装PyCharm

    用教育邮箱在官网申请学生礼包,下载、解压,按照Install-Linux-tar.txt安装即可,在设置里勾选Create desktop entry

  13. 安装Git

    sudo apt install git
    
  14. 安装Visual Studio Code

    官网下载安装即可。

  15. 安装Sublime Text 3

    按照链接安装,安装后不能输入中文解决办法:

    git clone https://github.com/lyfeyaj/sublime-text-imfix.git
    cd sublime-text-imfix && ./sublime-imfix
    
  16. 安装网易云音乐

    按照链接的方法安装。

    安装后桌面歌词会乱码,按链接安装Qt5.8和修改netease-cloud-music.desktop.desktop文件:

    wget http://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run
    chmod +x qt-opensource-linux-x64-5.8.0.run
    sudo ./qt-opensource-linux-x64-5.8.0.run
    

    然后弹出安装界面,一直默认,最后:

    sudo vim /usr/share/applications/netease-cloud-music.desktop
    

    Exec行改为:

    Exec=env LD_LIBRARY_PATH=/opt/Qt5.8.0/5.8/gcc_64/lib netease-cloud-music %U --no-sandbox
    
  17. 安装Teamviewer

    官网下载安装。

  18. 安装QQ、WeChat、Tim

    按照链接安装。

  19. 安装VLC视频播放器

    从应用商店Ubuntu 软件搜索VLC下载安装。

  20. 安装Persepolis,下载工具

    sudo add-apt-repository ppa:persepolis/ppa
    sudo apt update
    sudo apt install persepolis
    

    Chrome安装扩展程序:Persepolis Download Manager Integration

  21. 安装curl

    sudo apt install curl
    
  22. VirtualBox虚拟机安装Windows 10

    参考ubuntu虚拟机安装win10图文详解

  23. 系统备份

    参照链接,用root用户和切换到根目录。

    不包括/home/boot的备份:

    tar -cvpzf /media/ubuntu_backup_`date +%Y%m%d`.tar.gz --exclude=/proc --exclude=/tmp --exclude=/boot --exclude=/home --exclude=/lost+found --exclude=/media --exclude=/mnt --exclude=/run /
    

    /boot备份:

    tar -cvpzf /media/ubuntu_boot_backup_`date +%Y%m%d`.tar.gz /boot
    

    /home备份:

    tar -cvpzf /media/ubuntu_home_backup_`date +%Y%m%d`.tar.gz /home
    

    有可能备份到最后系统会提示”tar: 由于前次错误,将以上次的错误状态退出”,这个警告可以忽略,没什么影响的。

ubuntu18_04_operation_records's People

Contributors

zeduchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.