目录
一、下载ssh
1.sudo apt install openssh-server
2.sudo service ssh restart
换源
sudo gedit /etc/apt/source.list
更新源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
sudo apt update
sudo apt upgrade
二、安装zsh和oh my zsh
sudo apt-get install zsh
sudo apt-get install git
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
bash install.sh
修改主题
sudo gedit ~/.zshrc
注释掉默认的主题,添加如下
ZSH_THEME=“ys”
刷新
source ~/.zshrc
四、分区
1.找到硬盘位置:
sudo gdisk /dev/nvme0n1
n新加一个分区
第一块磁盘大小为501M
第一块类型为ef00
第二块为8300
1name:classesp
2:classroot
磁盘格式化
sudo mkfs.vfat -F32 /dev/nvme0n1p1
sudo mkfs.ext4 /dev/nvme0n1p2
五、磁盘挂载
1.创建目录
sudo mkdir /mnt/usb
sudo mkdir -p /mnt/usb/boot/efi
2.进行挂载
sudo mount /dev/nvme0n1p2 /mnt/usb
sudo mount /dev/nvme0n1p1 /mnt/usb/boot/efi
五、在a系统中安装b系统
1.下载根文件系统
sudo apt install debootstrap
sudo debootstrap --arch=amd64 jammy /mnt/usb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
sudo cp /etc/fstab /mnt/usb/etc/fstab
vim /mnt/usb/etc/fstab
i 插入模式 按esc :wq 保存退出
fstab:
/#etc/fstab: static file system information.
#Use 'blkid' to print the universally unique identifier for a
#device; this may be used with UUID= as a more robust way to name devices
#that works even if disks are added and removed. See fstab(5).
#
#/ was on /dev/sda2 during installation
/dev/nvme0n1p2 / ext4 errors=remount-ro 0 1
#/boot/efi was on /dev/sda1 during installation
/dev/nvme0n1p1 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
sudo cp /etc/apt/sources.list /mnt/usb/etc/apt/sources.list
sudo mount -o bind /dev /mnt/usb/dev
sudo mount -o bind /sys /mnt/usb/sys
sudo mount -o bind /proc /mnt/usb/proc
sudo chroot /mnt/usb
六、b系统创建用户
1.安装内核
apt install linux-image-generic
2.为root设置密码
passwd
3.添加用户
adduser yao
可以用vim
apt install nano
让普通用户可以越权
usermod -aG sudo yao
apt install efibootmgr grub-efi-amd64
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
grub-install -v --target=x86_64-efi --recheck /dev/nvme0n1
nano /etc/default/grub
注释倒数第二行
$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
update-grub
在a系统 为b系统安装配置网络工具
apt install net-tools
apt install network-manager
七、b系统下配置网络
1.更改使用者 shell 设定为bash
chsh -s /bin/bash
sudo dhclient ens33
修改networkmanaer
sudo nano /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
,except:type:ethernet或者注释
下载ssh
systemctl restart NetworkManager
sudo apt install openssh-server
修改b系统主题
sudo apt-get install zsh
sudo apt-get install git
直接执行安装
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
bash install.sh
sudo nano ~/.zshrc
八、下载图像化界面
先在a系统下换源
挂载
sudo mount /dev/nvme0n1p2 /mnt/usb
sudo gedit /mnt/usb/etc/apt/s
换源 跟新源 跟新否则无法用sudo 下载firefox 先下firefox再安装界面快
deb Index of /ubuntu/ jammy main restricted universe multiverse
deb-src Index of /ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src Index of /ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb Index of /ubuntu/ jammy main restricted universe multiverse
deb Index of /ubuntu/ jammy-security main restricted universe multiverse
deb Index of /ubuntu/ jammy-updates main restricted universe multiverse
deb Index of /ubuntu/ jammy-proposed main restricted universe multiverse
deb Index of /ubuntu/ jammy-backports main restricted universe multiverse
b系统下
sudo apt update
sudo apt install firefox
sudo apt install tasksel
sudo tasksel
选gnow 空格 回车
等待下载完重启即可
九、下载搜狗输入法
sudo apt install fcitx
将语言选择为fcit
sudo cp /usr/share/applications/fcitx.desktop /etc/xdg/autostart/
删除ibus
sudo apt purge ibus
官网下载搜狗
sudo dpkg -i 安装包名
下载依赖
sudo apt install libqt5qml5 libqt5quick5 libqt5quickwidgets5 qml-module-qtquick2
sudo apt install libgsettings-qt1
十、sbma下载
sudo apt-get install samba samba-common
创建一个没有家目录的用户 用useradd
sudo useradd share
sudo smbpasswd -a share
创建共享目录
sudo mkdir /data
sudo gedit /etc/samba/smb.conf
[share]
comment=This is the share foler of user share
path=/data
writable = yes
valid users = share
public = no
sudo chown share:share /data
防止权限不够
sudo chmod 777 /data
配置文件
十一、下载wps
sudo dpkg -i
解决字体不全下载fonts
http://web.tecxz.com:9080/
unzip wps-fonts.zip
sudo mv wps-fonts-master/wps/* /usr/share/fonts/wps-office
执行以下命令,生成字体的索引信息
sudo mkfontscale
sudo mkfontdir
运行fc-cache命令更新字体缓存
sudo fc-cache
十二、
安装xrdp
sudo apt install xrdp
将xrdp添加到ssl-cert用户组中
sudo adduser xrdp ssl-cert
sudo vim /etc/X11/Xwrapper.config
allowed_users=anybody
sudo vim /etc/xrdp/startwm.sh
黑屏解决
Unset XDG_RUNTIME_DIR
unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR