sh ubuntu中的APT(高级软件包工具)命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh ubuntu中的APT(高级软件包工具)命令相关的知识,希望对你有一定的参考价值。

# list all installed packages
apt list --installed

# list all available packages
apt-cache pkgnames

# find package name and description
apt-cache search PACKAGE_NAME
apt-cache pkgnames START_OF_PACKAGE_NAME

# check package information
apt-cache show PACKAGE_NAME

# check package dependency
apt-cache showpkg PACKAGE_NAME

# show statistic about the cache
apt-cache stats

# resynchronize package index files
apt-get update

# upgrade currently installed packages 
apt-get upgrade       # doesn't satisfy upgrade dependencies
apt-get dist-upgrade  # satisfy upgrade dependencies

# install package
apt-get install PACKAGE_NAME
apt-get install PACKAGE_NAME --no-upgrade     # prevent upgrade

# remove package 
apt-get remove PACKAGE_NAME           # without removing its config files
apt-get purge PACKAGE_NAME            # remove its config files
apt-get remove --purge PACKAGE_NAME   # combine the two above

# remove .deb files from local repo
apt-get clean

# download and unpack source code
apt-get source PACKAGE_NAME
apt-get --compile source goaccess  # and compile

# download without installing
apt-get download PACKAGE_NAME

# check change log of package
apt-get changelog PACKAGE_NAME

# update package cashe and check for broken dependencies
apt-get check

# install build dependecies for package
apt-get build-deb PACKAGE_NAME

# deletes all .deb files from /var/cache/apt/archives
apt-get autoclean

# remove package and packages that were automatically installed to satisfy dependencies
apt-get autoremove PACKAGE_NAME

以上是关于sh ubuntu中的APT(高级软件包工具)命令的主要内容,如果未能解决你的问题,请参考以下文章

apt-get命令

apt-get 常用命令总结

在阿里云的Ubuntu ECS instance 使用Apt-get安装git

ubuntu包管理命令apt和dpkg的用法

Ubuntu的软件管理工具

高级软件包工具APT 2.0 发布