关于Cubic
Cubic(Custom Ubuntu ISO Creator)包含但不限于以下功能:
安装新软件包
删除现有的软件包
安装其他内核
添加更多背景壁纸
添加文件和文件夹
修改现有的ISO
GUI界面
安装
sudo apt-add-repository ppa:cubic-wizard/release
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7579F80E494ED3406A59DF9081525E2B4F1283B
sudo apt update
sudo apt install cubic
选择项目路径
选择好项目路径后点Next
选择源镜像
选择好后,Original ISO一栏不可更改信息,在Custom ISO里面更改信息,更改好后点Next
进入chroot
当上一步完成之后,会进入chroot模式,相当于一个还没有创建用户的模式,所有的自定义都是在这里进行,在这里你可以安装软件、卸载软件或者拖入文件复制到系统内。
开始自定义
以创建ZHUbuntu为例
- 修改源为中科大源
- 安装搜狗拼音
- 安装vim
- 安装zsh等
- 安装vscode
- 安装opencv
修改源为中科大源
sudo vi /etc/apt/sources.list
sudo apt update
sudo apt upgrade
# deb cdrom:[Ubuntu 18.04.5 LTS _Bionic Beaver_ - Release amd64 (20200806.1)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
安装vim
sudo apt vim
在镜像中添加一个root用户
先添加一个普通用户
adduser wmj
然后将这个用户赋予root权限:修改/etc/sudoers文件,找到下面一行,在root下面添加一行“wmj ALL=(ALL) ALL”
以下操作均在wmj用户下执行
安装搜狗拼音
点击左上角按钮,将deb复制到当前目录,然后安装,下文同理
sudo dpkg -i [tab补全]
sudo apt -f install
sudo dpkg -i [tab补全]
安装vscode
sudo dpkg -i [tab补全]
安装zsh等
sudo apt install git curl wget zsh python3-pip autojump net-tools openssh-server cmake gcc python-pip python-wstools
# pip
cp pip/pip.conf /home/wmj/.pip
# fonts
cp -r fonts/ /home/wmj/.fonts
# zsh
cp zsh/zshrc /home/wmj/.zshrc
sudo cp zsh/zshrc_root /root/.zshrc
# oh-my-zsh
【gitee下载oh-my-zsh源码中的tools/install.sh,等修改好install中的REPO和REMOTE的地址(改为gitee仓库的地址),执行完install.sh后再执行以下两条】
cp -r zsh/oh-my-zsh /home/wmj/.oh-my-zsh
sudo cp -r zsh/oh-my-zsh /root/.oh-my-zsh
# 设置zsh为默认shell
chsh -s /usr/bin/zsh
sudo chsh -s /usr/bin/zsh
charactor not in range解决方法
.bashrc 文件底部添加以下两行:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
编译安装opencv3.4.10
安装相机驱动
run完把inc里面的头文件复制到/usr/include
自定义系统设置
跳过
备注
- 进入镜像安装的时候会强制让新建一个用户,要新建一个名称不为事先写入镜像的用户,进入系统后这个新建的用户自然会消失,但是设备名会与新建用户时设定的用户名一致
- 做镜像的时候,封装镜像前记得输入sudo passwd把密码再设置一次,否则进入系统后要重新设置密码
- 事先更换的软件源又被换回去了,必须手动再换一次
- 搜狗输入法要重新安装
- ssh密钥要生成