Advanced Package Tool,又名apt-get,是一款适用于Unix和Linux系统的应用程序管理器。最初于1998年发布,用于检索应用程序并将其加载到Debian Linux系统。Apt-get成名的原因之一在于其出色的解决软件依赖关系的能力。其通常使用.deb-formatted文件,但经过修改后可以使用apt-rpm处理红帽的Package Manager(RPM)文件。
使用apt-get的主流Linux系统包括Debian和Ubuntu变异版本。大多数情况下,从命令行运行该工具。桌面上有几个图形前端可以使用,包括Synaptic Package Manager、Ubuntu Software Center、Aptitude和Kpackage。Raspberry Pi和Beaglebone Black nanoLinux版用户可以很容易地使用apt-get加载程序,因为这些系统通常来自Ubuntu或Debian代码。是debian,ubuntu发行版的包管理工具,与红帽中的yum工具非常类似。
root@ubuntuvm:~# apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease
Get:2 http://mirrors.aliyun.com/ubuntu focal-updates InRelease [114 kB]
…
Get:31 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 c-n-f Metadata [9,600 B]
Fetched 6,298 kB in 3s (2,121 kB/s)
Reading package lists… Done
root@ubuntuvm:~# apt-get install vim -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
Suggested packages:
ctags vim-doc vim-scripts
The following NEW packages will be installed:
vim
0 upgraded, 1 newly installed, 0 to remove and 239 not upgraded.
Need to get 1,238 kB of archives.
After this operation, 3,111 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu focal/main amd64 vim amd64 2:8.1.2269-1ubuntu5 [1,238 kB]
Fetched 1,238 kB in 1s (2,347 kB/s)
Selecting previously unselected package vim.
(Reading database … 189778 files and directories currently installed.)
Preparing to unpack …/vim_2%3a8.1.2269-1ubuntu5_amd64.deb …
Unpacking vim (2:8.1.2269-1ubuntu5) …
Setting up vim (2:8.1.2269-1ubuntu5) …
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
root@ubuntuvm:~# apt-get remove vim
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following package was automatically installed and is no longer required:
vim-runtime
Use ‘apt autoremove’ to remove it.
The following packages will be REMOVED:
vim
0 upgraded, 0 newly installed, 1 to remove and 239 not upgraded.
After this operation, 3,111 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 189787 files and directories currently installed.)
Removing vim (2:8.1.2269-1ubuntu5) …
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/rview (rview) in auto mode
root@ubuntuvm:~# apt-get install vim --reinstall
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 239 not upgraded.
Need to get 0 B/1,238 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database … 189787 files and directories currently installed.)
Preparing to unpack …/vim_2%3a8.1.2269-1ubuntu5_amd64.deb …
Unpacking vim (2:8.1.2269-1ubuntu5) over (2:8.1.2269-1ubuntu5) …
Setting up vim (2:8.1.2269-1ubuntu5) …
root@ubuntuvm:~# apt-get --purge remove vim
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream nginx-common nginx-core vim-runtime
Use ‘apt autoremove’ to remove them.
The following packages will be REMOVED:
vim*
0 upgraded, 0 newly installed, 1 to remove and 239 not upgraded.
After this operation, 3,111 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 189862 files and directories currently installed.)
Removing vim (2:8.1.2269-1ubuntu5) …
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/rview (rview) in auto mode
(Reading database … 189853 files and directories currently installed.)
Purging configuration files for vim (2:8.1.2269-1ubuntu5) …
root@ubuntuvm:~# apt-cache depends vim
vim
Depends: vim-common
Depends: vim-runtime
Depends: libacl1
Depends: libc6
Depends: libcanberra0
Depends: libgpm2
Depends: libpython3.8
Depends: libselinux1
Depends: libtinfo6
Suggests:
exuberant-ctags
Suggests: vim-doc
Suggests: vim-scripts
root@ubuntuvm:~# apt-cache rdepends vim-doc
vim-doc
Reverse Depends:
vim
vim-nox
vim-gtk3
vim-athena
root@ubuntuvm:~# apt-cache search vim-doc
vim-doc - Vi IMproved - HTML documentation
libghc-yi-keymap-vim-doc - Vim keymap for Yi editor; documentation
root@ubuntuvm:~# apt-cache show vim
Package: vim
Architecture: amd64
Version: 2:8.1.2269-1ubuntu5
Priority: optional
Section: editors
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian Vim Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3038
Provides: editor
Depends: vim-common (= 2:8.1.2269-1ubuntu5), vim-runtime (= 2:8.1.2269-1ubuntu5), libacl1 (>= 2.2.23), libc6 (>= 2.29), libcanberra0 (>= 0.2), libgpm2 (>= 1.20.7), libpython3.8 (>= 3.8.2), libselinux1 (>= 1.32), libtinfo6 (>= 6)
Suggests: ctags, vim-doc, vim-scripts
Filename: pool/main/v/vim/vim_8.1.2269-1ubuntu5_amd64.deb
Size: 1237624
MD5sum: 198ccbb07a9fc8ebe67a213eab6a3e96
SHA1: 796c962d044f99a81b187211e6ce9a0a44b8d5d1
SHA256: 1e38f267bf4c06e424b166e8d666ffd6ce25c657012892d099651bee18a2c834
Homepage: https://www.vim.org/
Description-en: Vi IMproved - enhanced vi editor
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a version of vim compiled with a rather
standard set of features. This package does not provide a GUI
version of Vim. See the other vim-* packages if you need more
(or less).
Description-md5: 59e8b8f7757db8b53566d5d119872de8
Task: server, cloud-image, lubuntu-desktop
root@ubuntuvm:~# apt-get clean
root@ubuntuvm:~# apt-get autoclean
Reading package lists… Done
Building dependency tree
Reading state information… Done
root@ubuntuvm:~# apt-get check
Reading package lists… Done
Building dependency tree
Reading state information… Done
update-检索包的新列表
upgrade-执行升级
install-安装新软件包(pkg是libc6而不是libc6.deb)
reinstall-重新安装包(pkg是libc6而不是libc6.deb)
remove-卸载包
purge-删除包和配置文件
autoremove-自动删除所有未使用的包
dist-upgrade-分发升级,见apt get(8)
dselect-upgrade-遵循dselect选择
build dep-配置安装包相关的编译环境
satisfy-满足依赖字符串
clean-删除下载的存档文件
autoclean-删除旧下载的存档文件
check-确认没有断开的依赖项
source-下载源文件
download-将二进制软件包下载到当前目录中
changelog-下载并显示给定包的changelog