随记-再临Ubuntu (Ubuntu 16.04)

更换镜像源

  1. 备份
  2. 修改源文件

备份镜像源源文件

sudo mv /etc/apt/sources.list  /etc/apt/sources.list.back

修改源文件(这里使用阿里源)[1] [2]


    echo '
    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    ##測試版源
    #deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    # 源碼
    #deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    #deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    #deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    #deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    ##測試版源
    #deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    # Canonical 合作夥伴和附加
    #deb http://archive.canonical.com/ubuntu/ xenial partner
    #deb http://extras.ubuntu.com/ubuntu/ xenial main
    #deb http://extras.ubuntu.com/ubuntu/ xenial main
    ' > /etc/apt/sources.list
    

备注: 角注较清楚的说明了以上内容,参照可自行修改所需版本。

删除软件

sudo apt-get -y remove --purge libreoffice*
sudo apt-get -y remove unity-webapps-common
sudo apt-get -y remove thunderbird totem rhythmbox empathy brasero simple-scan gnome-mahjongg aisleriot gnome-mines cheese transmission-common gnome-orca webbrowser-app gnome-sudoku landscape-client-ui-install
sudo apt-get -y remove onboard deja-dup

Ubuntu安装Docker-CE [3] [4]

# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce
# 安装指定版本的Docker-CE:
# Step 1: 查找Docker-CE的版本:
# apt-cache madison docker-ce
#   docker-ce | 17.03.1~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
#   docker-ce | 17.03.0~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# Step 2: 安装指定版本的Docker-CE: (VERSION例如上面的17.03.1~ce-0~ubuntu-xenial)
# sudo apt-get -y install docker-ce=[VERSION]

官方镜像加速 [5]

Docker客户端版本大于 1.10.0 的用户

    if [ ! -d "/etc/docker" ]; then
      sudo mkdir -p /etc/docker
    fi
    
    if [ ! -f "/etc/docker/daemon.json" ]; then
      sudo touch "/etc/docker/daemon.json"
    fi
    sudo mkdir -p /etc/docker
    sudo tee /etc/docker/daemon.json <<-'EOF'
    {
      "registry-mirrors": ["https://hgxgi6f6.mirror.aliyuncs.com"]
    }
    EOF
    sudo systemctl daemon-reload
    sudo systemctl restart docker
    ps -aux | grep docker

到此结  DragonFangQy 2018.10.31

  1. 模板:Ubuntu source

  2. Releases Ubuntu History

  3. 安装Docker

  4. docker-ce 区别 docker-ee

  5. Docker镜像加速

    原文作者:DragonFangQy
    原文地址: https://www.jianshu.com/p/607e33663f02
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞