虚拟机系统安装指南:VirtualBox 安装 Ubuntu 20.04 - 简书
里面设置共享文件夹的教程有点问题,设置好以后需要重启系统。
挂载指令为:
sudo mount -t vboxsf common /home/xjh/common/
#字段解释:
#sudo mount -t vboxsf 共享文件夹名称(在设置界面设置的) 挂载的目录
查询海康公司内镜像地址:
先去一休平台(https://yixiu.hikvision.com.cn/)上搜索“ubuntu镜像”拿到镜像信息地址:
http://mirrors.hikvision.com.cn/help/ubuntu.html
找到本次要安装的版本信息(Ubuntu 22.04),有两种方式:
方式1:使用脚本自动覆盖掉
sudo mv /etc/apt/sources.list /etc/apt/sources.list.backup
wget -O /etc/apt/sources.list http://mirrors.hikvision.com.cn/help/ubuntu/apt/jammy.list
方式2:手动将以下内容拷贝进去
deb http://mirrors.hikvision.com.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ jammy-backports main restricted universe multiverse
修改镜像的指令:
vi /etc/apt/sources.list
Ubuntu 16.04LTS的默认镜像:
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
Ubuntu 16.04LTS的阿里云镜像,阿里云的镜像地址说明:
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
Ubuntu 16.04LTS的公司镜像:
deb http://mirrors.hikvision.com.cn/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-backports main restricted universe multiverse
Ubuntu 18.04LTS的默认镜像:
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-security main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-security universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-security multiverse
Ubuntu 18.04LTS的公司镜像:
deb http://mirrors.hikvision.com.cn/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ bionic-backports main restricted universe multiverse
ubuntu 20.4的公司镜像:
deb http://mirrors.hikvision.com.cn/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.hikvision.com.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.hikvision.com.cn/ubuntu/ focal-backports main restricted universe multiverse
系统初始化脚本:
################################################################################
#系统更新
sudo apt update
#软件升级
apt list --upgradable
#安装ViritulBox的增强工具
sudo apt-get install build-essential gcc make perl dkms
################################################################################
#以下是开发相关
#安装编译器
sudo apt install cmake
sudo apt install valgrind
################################################################################
查看系统版本:
##
#如果显示i686,则表示安装了32位操作系统
#如果显示 x86_64,则表示安装了64位操作系统
#sudo uname --s 显示内核名字
#sudo uname --r 显示内核版本
#sudo uname --n 显示网络主机名
#sudo uname --p 显示cpu
##
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ sudo uname
Linux
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ sudo uname --m
x86_64
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ sudo uname --s
Linux
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ sudo uname --r
4.18.0-15-generic
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ sudo uname --n
xjh-VirtualBox
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ sudo uname --p
x86_64
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ lsb_release -cs
bionic
xjh@xjh-VirtualBox:~/common/DomainDevSDK/v2.13.0$ cat /proc/version
Linux version 4.18.0-15-generic (buildd@lcy01-amd64-029) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #16~18.04.1-Ubuntu SMP Thu Feb 7 14:06:04 UTC 2019