1、给root用户设置密码
heihouzi@ubuntu100:~$ sudo passwd root
new passwd ******
new passwd ******
2、修改网络(命令方式)
root@ubuntu100:~# vi /etc/network/interfaces
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
root@ubuntu100:~# /etc/init.d/networking restart
3、修改网络(图形方式)
(1)打开设置
(2)打开网络设置
(3)修改 IPV4 的网络
(4)网络开关关闭后重新打开 -> 重新加载网络
4、安装 vim 编辑器
root@ubuntu100:~t# apt-get update
root@ubuntu100:~# apt-get remove vim-common
root@ubuntu100:~# apt install vim
5、安装 ifconfig
root@ubuntu100:~# apt install net-tools
6、安装 openssh-server
安装ssh服务才可以 xshell远程连接,需要更改国内镜像,和升级软件才能成功
//安装ssh服务才可以 xshell远程连接
root@ubuntu100:~# apt-get install openssh-server
//检查ssh服务开启状态
root@ubuntu100:~# ps -s | grep ssh
root@ubuntu100:~# ps -e | grep ssh
//启动ssh服务
root@ubuntu100:~# /etc/init.d/ssh start
//停止ssh服务
root@ubuntu100:~# /etc/init.d/ssh stop
//重启ssh服务
root@ubuntu100:~# /etc/init.d/ssh restart
7、允许 root 可以远程登陆
root@ubuntu100:~# vim /etc/ssh/sshd_config
Port 22
PermitRootLogin yes
8、修改主机名
root@ubuntu100:~# vim /etc/hostname
ubuntu100
9、修改主机名与IP映射
root@ubuntu100:~# vim /etc/hosts
192.168.2.100 ubuntu100
10、修改国内镜像
heihouzi@ubuntu100:~$ su - root
passwd ******
root@ubuntu100:~# cd /etc/apt/
root@ubuntu100:/etc/apt# cp sources.list sources.list.bb
root@ubuntu100:/etc/apt# vi sources.list
ubuntu-18.04
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
ubuntu-22.04
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
11、软件升级
root@ubuntu100:~# apt update
root@ubuntu100:~# apt upgrade
root@ubuntu100:~# apt-get update
root@ubuntu100:~# apt-get upgrade
12、安装 VMTools工具
安装虚拟工具vmtools,不要用虚拟CD按它自带的
去终端里用apt装open-vm-tools
也可以使用vmware的 linux.iso 镜像安装VMTools工具
//安装虚拟工具
root@ubuntu100:~# apt install open-vm-tools
//双向拖放文件
root@ubuntu100:~# apt install open-vm-tools-desktop
//文件夹共享
root@ubuntu100:~# apt install open-vm-tools-dkms
ubuntu-22.04 共享文件夹
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools-desktop
sudo apt-get install open-vm-tools-dev
sudo reboot
sudo vmhgfs-fuse .host:/ /mnt/hgfs
13、Ubuntu 中英文切换
首先更改系统语言环境为英文
root@ubuntu100:~# export LANG=en_US
然后更改设置
root@ubuntu100:~# xdg-user-dirs-gtk-update
接着更改回中文语言环境
root@ubuntu100:~# export LANG=zh_CN.UTF-8
再次执行
root@ubuntu100:~# xdg-user-dirs-gtk-update
14、安装notepadqq
//安装
root@ubuntu100:~# add-apt-repository ppa:notepadqq-team/notepadqq
root@ubuntu100:~# apt-get install notepadqq
//卸载
root@ubuntu100:~# apt-get remove notepadqq
root@ubuntu100:~# add-apt-repository --remove ppa:notepadqq-team/notepadqq
15、安装 tabby 软件
root@ubuntu100:~# apt install -f ./tabby-1.0.177-linux-x64.deb
16、安装 vscode 软件
root@ubuntu100:/opt/software# dpkg -i code_1.67.2-1652812855_amd64.deb
dpkg 类似于 centos 的 rpm 命令
apt 类似于 centos 的 yum 命令
17、设置终端路径
终端里显示路径名称太长,设置变短
将小写 w 给成大写 W 即可
alex@ubuntu100:~$ vim .bashrc
62 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
alex@ubuntu100:~$ source .bashrc
18、安装vnc
#更新
apt update
#安装桌面环境
sudo apt install xfce4 xfce4-goodies
#安装vncserver
apt install tightvncserver
#启动vncserver
vncserver
#关闭vncserver :1窗口
vncserver -kill :1
#备份原来的配置文件
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
#编辑新的配置文件
vim ~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
chmod +x ~/.vnc/xstartup
19、关机命令
#关机
shutdown -h now
#重启
reboot
shutdown -r now
#n秒后重启
shutdown -r +n
#定时重启
shutdown -r 23:59
#关机
shutdown -h now
#n秒后关机
shutdown -h +n
#定时关机
shutdown -h 23:59