https://www.virtualbox.org/wiki/Linux_Downloads
https://zhuanlan.zhihu.com/p/80527572
https://blog.csdn.net/M82_A1/article/details/94640748
sudo vi /etc/apt/sources.list
deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian contrib
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian focal contrib
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-6.0
virtualbox-6.0 :
Depends: libqt5core5a (>= 5.12.2) but 5.9.5+dfsg-0ubuntu2.6 is to be installed
Depends: libqt5widgets5 (>= 5.12.2) but 5.9.5+dfsg-0ubuntu2.6 is to be installed
apt-cache show libqt5core5a
Package: libqt5core5a
Architecture: amd64
Version: 5.9.5+dfsg-0ubuntu2.6
sudo apt install libqt5core5a=5.12.8+dfsg-0ubuntu2.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '5.12.8+dfsg-0ubuntu2.1' for 'libqt5core5a' was not found
https://packages.ubuntu.com/focal/amd64/libqt5core5a/download
You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:
deb http://security.ubuntu.com/ubuntu focal-security main universe
sudo vi /etc/apt/sources.list
sudo apt-get update && sudo apt-get install virtualbox-6.0
libqt5core5a : Depends: libdouble-conversion3 (>= 2.0.0) but it is not installable
sudo apt install libdouble-conversion3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libdouble-conversion3 is not available, but is referred to by another package.
https://packages.ubuntu.com/focal/amd64/libdouble-conversion3/download
You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:
deb http://cz.archive.ubuntu.com/ubuntu focal main universe
sudo apt-get update && sudo apt-get install virtualbox-6.0
-安装aptitude 替换apt-get, 使用 aptitude进行自动降级
sudo apt-get install aptitude
but :
Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed
Ubuntu安装软件包
sudo apt search package #搜索包
sudo apt show package #获取包的相关信息,如说明、大小、版本等
sudo apt depends package #了解使用依赖
sudo apt rdepends package #查看该包被哪些包依赖
sudo apt-cache pkgnames #执行pkgnames子命令列出当前所有可用的软件包
sudo apt policy package #使用policy命令显示软件包的安装状态和版本信息。
sudo apt install package #安装包
sudo apt install package=version #安装指定版本的包
sudo apt install package --reinstall #重新安装包
sudo apt -f install #修复安装, "-f = --fix-missing"
sudo apt remove package #删除包
sudo apt purge package #删除包,包括删除配置文件等
sudo apt autoremove #自动卸载所有未使用的软件包
sudo apt source package #下载该包的源代码
sudo apt update #更新apt软件源信息
sudo apt upgrade #更新已安装的包
sudo apt full-upgrade #在升级软件包时自动处理依赖关系
sudo apt dist-upgrade #升级系统
sudo apt dselect-upgrade #使用dselect升级
sudo apt build-dep package #安装相关的编译环境
sudo apt clean && sudo apt autoclean #清理无用的包
sudo apt clean #清理已下载的软件包,实际上是清楚/var/cache/apt/archives目录中的软件包
sudo apt autoclean #删除已经卸载的软件包备份
sudo apt-get check #检查是否有损坏的依赖
sudo aptitude update 更新可用的包列表
sudo aptitude upgrade 升级可用的包
sudo aptitude dist-upgrade 将系统升级到新的发行版
sudo aptitude install pkgname 安装包
sudo aptitude remove pkgname 删除包
sudo aptitude purge pkgname 删除包及其配置文件
sudo aptitude search string 搜索包
sudo aptitude show pkgname 显示包的详细信息
sudo aptitude clean 删除下载的包文件
sudo aptitude autoclean 仅删除过期的包文件
sudo dpkg -i #安装包
sudo dpkg -r #删除包
sudo dpkg -p #彻底删除包(包括配置文件)
dpkg -l #列出当前已安装的包
sudo apt-get update
这个命令,会访问源列表里的每个网址,并读取软件列表,然后保存在本地电脑。
update后,可能需要upgrade一下。
sudo apt-get upgrade
这个命令,会把本地已安装的软件,与刚下载的软件列表里对应软件进行对比,如果发现已安装的软件版本太低,就会提示你更新。如果你的软件都是最新版本,会提示:
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
总而言之,update是更新软件列表,upgrade是更新软件。