VirtualBox下安装Ubuntu基本设置

1.安装 Ubuntu18.0.4

1. 修改为桥接方式

1.在virtualbox配置页面设置为桥接模式

2.修改IP为固定IP

1.修改/etc/network/interfaces 文件

auto enp0s3
iface enp0s3 inet static
address 192.168.1.201
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 223.5.5.5

2.刷新IP

sudo ip addr flush enp0s3
sudo systemctl restart networking.service

3.重启系统

4.修改/etc/NetworkManager/NetworkManager.conf

将“managed=false”修改为“managed=true”

5.重启network manager

sudo service network-manager restart

3.配置虚拟机支持ssh(完成ssh就可以通过xshell等进行连接)

sudo apt-get update
sudo apt-get install openssh-server
sudo ps -e |grep ssh   //出现sshd则说明安装成功
ssh gch@192.168.1.201 进行测试

如果安装openssh-server 报错 请参考
ubuntu安装openssh-server报依赖错误的解决方法

2. 更换下载源

1. 首先备份源列表

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

2. 编辑/etc/apt/sources.list文件, 在文件最前面添加阿里云镜像源

#  阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

然后将文件下面的其他内容都注释掉。

3. 刷新列表

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential

2. 设置python3为默认的python

ln -s /usr/bin/python3 /usr/bin/python
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值