ubuntu系统初始化 |
配置APT源 输入命令 cd /etc/apt/ 进入改目录后执行ls命令,会列出所以文件目录,把sources.list就是你要编辑配置的源文件,先复制一份,然后重新编辑一份 然后就是删掉sourceslist里面所以的东西,换成下面的内容 deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse 保存后,执行apt-get update命令,更新。
安装软件的时候出现了Package has no installation candidate的问题,如: # apt-get install <packagename> Reading package lists... Done Building dependency tree... Done Package aptitude is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package <packagename> has no installation candidate 解决方法如下: apt-get update apt-get upgrade apt-get install <packagename> 这样就可以正常使用apt-get了~ |
Docker-compose: 是一个用于定义和运行多容器Docker应用程序的工具 安装Docker 1. 安装yum-utils, 这样就能使用yum-config-manager工具设置yum源 yum install -y yum-utils 2. 添加docker的yum源 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 3. 安装docker-ce yum install docker-ce 4. 验证docker信息 docker --version 5. 配置docker镜像加速器,由于国内网络限制,dockerhub上面的镜像经常会有拉取失败的问题。 我们使用的是DaoCloud加速器,也可以使用阿里云加速器 进入DaoCloud官网,注册帐号,即可在控制台找到加速器配置,复制执行即可 6. 启动docker systemctl start docker 安装Docker-compose 1. 安装docker-compose, 执行下面的命令,可通过https://docs.docker.com/compose/install/#install-compose, 找到docker-compose linux安装方法。 sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose 2. 添加目录权限 sudo chmod +x /usr/local/bin/docker-compose 3. 验证docker-compose安装是否成功 docker-compose --version |