|
|
@ -49,11 +49,38 @@ apt-get install -y vim-nox build-essential gdb u-boot-tools rsync \ |
|
|
|
socat jq tcpdump ifupdown minicom i2c-tools lrzsz tftp-hpa \ |
|
|
|
net-tools dosfstools pciutils memtool ethtool unzip python3-pip \ |
|
|
|
parted usbutils command-not-found gdisk |
|
|
|
apt-get install locales tzdata |
|
|
|
\end{minted} |
|
|
|
\item 安装图形界面 (可选): |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
apt-get install ubuntu-desktop # 其他可选xubuntu-desktop lubuntu-desktop等 |
|
|
|
\end{minted} |
|
|
|
提示选择桌面管理器时,可以选 gdm。 |
|
|
|
\item 安装中英文语言包与输入法(可选): |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
# 英文环境 |
|
|
|
apt-get install language-pack-en-base |
|
|
|
apt-get install language-pack-gnome-en-base |
|
|
|
|
|
|
|
# 中文环境 |
|
|
|
apt-get install language-pack-zh-hans-base |
|
|
|
apt install language-pack-gnome-zh-hans-base |
|
|
|
|
|
|
|
# 中文输入法 |
|
|
|
apt-get install ibus-table-wubi ibus-pinyin ibus-sunpinyin |
|
|
|
\end{minted} |
|
|
|
\item 设置开机默认切换到图形界面,执行如下命令(可选): |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
systemctl set-default graphical.target |
|
|
|
\end{minted} |
|
|
|
\item 设置 root 密码: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
passwd root |
|
|
|
\end{minted} |
|
|
|
\item 添加用户: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
useradd -s '/bin/bash' -m -G adm,sudo,video,plugdev,dialout ubuntu |
|
|
|
\end{minted} |
|
|
|
\item 设置时区: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
@ -73,6 +100,20 @@ dpkg-reconfigure dash |
|
|
|
dpkg-reconfigure locales |
|
|
|
\end{minted} |
|
|
|
至少选择 en\_US.UTF-8 和 zh\_CN.UTF-8。 |
|
|
|
\item 修改开机检测网络时间,避免开机卡住,执行如下命令: |
|
|
|
|
|
|
|
修改下面这个文件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
vim /lib/systemd/system/networking.service |
|
|
|
# 将里面的TimeoutStartSec=5min修改为 |
|
|
|
TimeoutStartSec=1sec |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
vim /lib/systemd/system/NetworkManager-wait-online.service |
|
|
|
# 将里面的 timeout=30 修改为 |
|
|
|
ExecStart=/usr/bin/nm-online -s -q --timeout=1 |
|
|
|
\end{minted} |
|
|
|
\item 配置/etc/fstab,例如: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
# <file system> <mount pt> <type> <options> <dump> <pass> |
|
|
@ -103,6 +144,17 @@ Type=idle |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{ini} |
|
|
|
systemctl enable serial-getty@ttyFIQ0.service |
|
|
|
\end{minted} |
|
|
|
\item 设置图形界面的自动登录(可选): |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{ini} |
|
|
|
vim /etc/gdm3/custom.conf |
|
|
|
# 修改下面的内容,ubuntu即账户名 |
|
|
|
[daemon] |
|
|
|
AutomaticLoginEnable=true |
|
|
|
AutomaticLogin=ubuntu |
|
|
|
TimedLoginEnable=true |
|
|
|
TimedLogin=ubuntu |
|
|
|
TimedLoginDelay=10 |
|
|
|
\end{minted} |
|
|
|
\item 设置网络参数/etc/network/interfaces.d/eth0 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{ini} |
|
|
|
auto eth0 |
|
|
|