ubuntu开发流程

 1、配置网络

编辑interfaces文件
sudo vi /etc/network/interfaces
在文件中添加以下设置

auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.1.160
netmask 255.255.255.0
gateway 192.168.1.2
dns-nameserver 8.8.8.8

修改完成后保存并退出
刷新配置文件,并重启网卡

sudo ip addr flush ens33
sudo /etc/init.d/networking restart

2、配置dns

cp  /etc/resolv.conf   /etc/resolv.confbak    #备份原有dns配置文件
vi /etc/resolv.conf   #编辑配置文件,添加以下内容
nameserver 8.8.8.8   #设置首选dns
nameserver 8.8.4.4   #设置备用dns
ctrl+o   #保存配置
ctrl+x   #退出

3、配置私服

在Ubuntu 16.04主机上使用apt私服

备份并创建新的apt配置文件

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vi /etc/apt/sources.list

# Software DC APT 私服
# 为了优先使用本地私服, 需确保此配置在其他源配置上方

deb [arch=amd64] http://apt.software.dc/ubuntu/ xenial main restricted universe multiverse
deb [arch=amd64] http://apt.software.dc/ubuntu/ xenial-updates main restricted universe multiverse
deb [arch=amd64] http://apt.software.dc/ubuntu/ xenial-backports main restricted universe multiverse
deb [arch=amd64] http://apt.software.dc/ubuntu/ xenial-security main restricted universe multiverse
# Docker安装源
deb [arch=amd64] http://apt.software.dc/docker-ce/linux/ubuntu xenial stable

# 清华源 APT 镜像
# 若服务器无外网连接, 可自行注释以下配置

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu xenial stable

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

更新系统软件源:

apt-get update
apt-get upgrade

代理配置

若主机上配置了apt代理, 则应将apt.software.dc加入直连名单, 具体步骤如下

sudo vi /etc/apt/apt.conf

# 配置代理
Acquire::http::proxy "http://172.18.8.162:7010/";
Acquire::https::proxy "https://172.18.8.162:7010/";
# 配置本地镜像不使用代理
Acquire::http::Proxy::apt.software.dc DIRECT;

4、开启SSH服务远程登录

安装ssh-server服务

sudo apt-get install openssh-server

 启动:sudo /etc/init.d/ssh start或sudo service ssh start

查看安装的服务:

dpkg -l | grep ssh

然后确认ssh-server是否启动了:

ps -e | grep ssh

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值