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 2. 琐碎知识点 安装Ubuntu时创建的用户是在sudo组下的,所以,具有sudo权限
例如,安装时,我的用户名是xw,则xw用户的primary group是xw,次要组有很多,其中包含sudo
用useradd或adduser创建的用户若不指定组gid,是不包含在sudo组下的,所以,需要在visudo中添加该用户的sudo权限,更一般的做法则是在/etc/sudoers.d目录下添加文件 visudo中用户权限说明
xw ALL=(ALL:ALL)ALL
xw : 用户名
第一个ALL : 是从任何主机登录
第二个ALL : 是以任何用户的身份
第三个ALL : 是以任何用户组的身份
第四个ALL : 是可以执行任何指令
综述: xw用户可以从任何主机登录,用任何用户或用户组的身份执行任何指令
server中开启多个shell:ctrl + alt + F5
apt-get update : 从软件源(sourses.list)对应的软件仓库中将包列表get下来
apt-get upgrade : 升级软件,将对应的包名称到软件仓库中寻找,找到仓库中对应的包,将其下载下来进行安装
可将所需的包均从仓库中下载下来,做成镜像文件,即自己的软件仓库,挂在到mnt下,再将sources.list中的目录名称改成挂载的目录,就可以获取相应的包并进行安装
sources.list 的修改: 将http网址改成 deb file:/mnt/cdrom(自定义) ./
ctrl + alt + F6 // 切换到文本模式
ctrl + alt + F7 // 切换到界面模式 设置静态ip[VM中的虚拟机为例]
修改 /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# auto eth0
# iface eth0 inet dhcp
auto eht0
iface eth0 inet static // 设置静态ip
address 192.168.157.134 // 设置ip地址,到DHCP设置里查看IP地址段
netmask 255.255.255.0 // 设置子网掩码
gateway 192.168.157.2 // 设置网关,到NAT设置中查看
dns-nameservers 192.168.157.2 // 设置dns
使静态IP生效