1 Install
source | url |
---|---|
163 | http://mirrors.163.com/.help/ubuntu.html |
aliyun | http://mirrors.aliyun.com/ubuntu/ |
dde | https://www.deepin.org/original/deepin-boot-maker |
2 Config
sudo passwd root
# /etc/ssh/sshd_cofig
# PermitRootLogin yes
apt -y autoremove clean
Optimize-VHD -Path E:\_vhd\ubt1.vhdx -Mode Full
# 更改主机名
# /etc/hostname
# /etc/hosts
# 查看硬盘
fdisk -l
# 创建新分区 n w
gdisk /dev/sdb
# 格式化新分区
mkfs.xfs /dev/sdb1
# 挂载 /etc/fstab
# 查看uuid
blkid
# UUID=f1abf791-fe61-4dab-858f-632acb7d1d8f /data ext4 defaults 0 0
3 Reference
# https://netplan.io/examples
# /etc/netplan/xxx.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 192.168.2.202/24
dhcp4: no
dhcp6: no
gateway4: 192.168.2.1
nameservers:
addresses:
- 192.168.2.1
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# sudo bash <(wget -q -O - https://linianhui.github.io/linux/ubuntu/init.sh)
set -x
apt update \
&& apt -y install curl wget unzip tcpdump net-tools iproute2 vim jq coreutils tini gdisk\
&& apt -y autoremove \
&& apt -y clean
# 禁用防火墙
# ubuntu
ufw disable
# centos
systemctl stop firewalld
systemctl disable firewalld
# 禁用swap
sudo swapoff -a
# 永久禁用swap
cat /etc/fstab
cat /etc/fstab | grep -v swap > /etc/fstab
cat /etc/fstab
# 永久禁用SELINUX
tee <<-EOF /etc/selinux/config
SELINUX=disabled
EOF
# 禁用snap
# umount /snap/core* -lf
# snap remove core
# snap remove core18
# snap remove core20
# snap remove snapd
# snap remove snapd
# apt remove snapd --purge -y
# mount disk
# fdisk -l
# mount -l
# fdisk /dev/sdb
# mkfs.ext4 -G 4096 /dev/sdb1
# 挂载 /etc/fstab
# 查看uuid blkid
# UUID=f1abf791-fe61-4dab-858f-632acb7d1d8f /data ext4 defaults 0 0