deepin从开机到配置

199 阅读3分钟

1. 更换镜像源

1、 首先进入 sources.list

对于 /etc/apt/sources.list 最好原文件做个备份。

然后将其修改保存来覆盖原文件。

# 备份原来的source文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改sources.list文件
sudo vim /etc/apt/sources.list 

# 换清华源,删除里面所有内容,加上
deb [by-hash=force] https://mirrors.tuna.tsinghua.edu.cn/deepin panda main contrib non-free

  1. 配置
# 更新源
sudo apt-get update

安装git,zsh
sudo apt-get install -y git zsh curl

更改默认管理器:
gio mime inode/directory dde-file-manager.desktop

# 切换 zsh shell
chsh -s /bin/zsh

# 查看当前shell
echo $SHELL

  1. oh-my-zsh配置

curl 安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

更改主题,sudo vim .zshrc,将 ZSH_THEME 改成如下

ZSH_THEME="agnoster"

然后安装字体Menlo-for-Powerline,不然会乱码

git clone https://github.com/abertsch/Menlo-for-Powerline.git 

cd Menlo-for-Powerline

sudo mv "Menlo for Powerline.ttf" /usr/share/fonts/ 

sudo fc-cache -vf /usr/share/fonts/

插件

自动提示插件****zsh-autosuggestions****
使用以下命令安装

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

语法高亮****zsh-syntax-highlighting****使用以下命令安装

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

sudo vim .zshrc
# 将.zshrc 里面的plugins改成如下

plugins=(git zsh-autosuggestions)

supervisor安装 

sudo apt-get install -y supervisor

# 如果报错,E: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?并提示建议安装:supervisor-doc,则

sudo apt-get install -y supervisor-doc supervisor

配置supervisord

sudo vim /etc/supervisor/supervisord.conf

  加入 

[inet_http_server]
port=0.0.0.0:9001

ps -ef | grep supervisor

# 然后kill 掉该进程,因为supervisor安装完后会直接默认启动

sudo kill -9 进程

# 再重新启动
sudo supervisord -c /etc/supervisor/supervisord.conf

然后访问:127.0.0.1:9001,可以访问页面就成功了

Docker

使用脚本安装 Docker(参考Ubuntu Docker 安装 | 菜鸟教程

1、获取最新版本的 Docker 安装包

wget -qO- https://get.docker.com/ | sh

 

 安装完成后有个提示:

If you would like to use Docker as a non-root user, you should now consider     adding your user to the "docker" group with something like:     sudo usermod -aG docker runoob Remember that you will have to log out and back in for this to take effect! 

当要以非root用户可以直接运行docker时,需要执行 sudo usermod -aG docker 用户名 命令,然后重新登陆,否则会有如下报错

​编辑

2、启动docker 后台服务

sudo service docker start

​编辑

3、测试运行hello-world

docker run hello-world

镜像加速

鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,我们可以需要配置加速器来解决,我使用的是网易的镜像地址:hub-mirror.c.163.com。

新版的 Docker 使用 /etc/docker/daemon.json(Linux) 或者 %programdata%\docker\config\daemon.json(Windows) 来配置 Daemon。

请在该配置文件中加入(没有该文件的话,请先建一个):

{
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
}

安装docker-compose(参考Install | Docker Docs

  1. Run this command to download the current stable release of Docker Compose:

    sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    

    To install a different version of Compose, substitute 1.24.1 with the version of Compose you want to use.

    If you have problems installing with curl, see Alternative Install Options tab above.

  2. Apply executable permissions to the binary:

    sudo chmod +x /usr/local/bin/docker-compose
    

Note: If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.

For example:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

  1. Optionally, install command completion for the bash and zsh shell.

  2. Test the installation.

    $ docker-compose --version
    docker-compose version 1.24.1, build 1110ad01