debian10入门(切换root用户,更改网卡配置,及更新apt源配置)
1、由于debian10系统最小化安装时,有很多命令是没有的,包括sudo命令,这时需要使用su命令切换到到root账户。
2、debian10更改网卡及DNS配置
网卡配置更改
#网卡配置 vim /etc/network/interfaces #网卡配置文件如下: allow-hotplug ens33 iface ens33 inet static address 10.0.0.200 netmask 255.255.255.0 gateway 10.0.0.2 #DNS配置 vim /etc/resolv.conf #DNS配置文件如下: domain localdomain search localdomain nameserver 180.76.76.76 nameserver 114.114.114.114
#重启网卡
systemctl restart networking.service
3、debian10换源
#进入安装源文件 vim /etc/apt/sources.list #将原有的官方源注释掉,加入下面的源 deb http://mirrors.aliyun.com/debian/ buster main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib deb http://mirrors.aliyun.com/debian-security buster/updates main deb-src http://mirrors.aliyun.com/debian-security buster/updates main deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib #更新 apt update
4、debian10配置vim开启右键粘贴
#修改vim的配置文件 vim /usr/share/vim/vim81/defaults.vim #编辑第78行 mouse=a 改为mouse-=a
5、设置ll别名
#编辑/root/.bashrc文件 vim /root/.bashrc #将以下几行取消注释 export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -l' alias l='ls $LS_OPTIONS -lA' #使别名生效 source /root/.bashrc