linux yum命令详解


yum命令可以用来安装和更新软件,例如我们想要安装nginx,只需要要在命令行输入如下命令即可安装nginx:

$ sudo yum install nginx

使用apt remove卸载软件:

$ sudo apt remove nginx

apt remove不会删除软件的配置文件,如果想彻底卸载软件,连同软件的配置文件也一起删除,可以使用apt purge:

$ sudo apt purge nginx

卸载软件及其依赖的安装包:

$ sudo apt autoremove nginx

使用apt update更新安装列表,apt upgrade更新系统:

$ sudo apt update
$ sudo apt upgrade

Usage:
apt command [options]
apt help command [options]
Commands:
add-repository - Add entries to apt sources.list
autoclean - Erase old downloaded archive files
autoremove - Remove automatically all unused packages
build - Build binary or source packages from sources
build-dep - Configure build-dependencies for source packages
changelog - View a package's changelog
check - Verify that there are no broken dependencies
clean - Erase downloaded archive files
contains - List packages containing a file
content - List files contained in a package
deb - Install a .deb package
depends - Show raw dependency information for a package
dist-upgrade - Upgrade the system by removing/installing/upgrading packages
download - Download the .deb file for a package
edit-sources - Edit /etc/apt/sources.list with your preferred text editor
dselect-upgrade - Follow dselect selections
full-upgrade - Same as 'dist-upgrade'
held - List all held packages
help - Show help for a command
hold - Hold a package
install - Install/upgrade packages
list - List packages based on package names
policy - Show policy settings
purge - Remove packages and their configuration files
recommends - List missing recommended packages for a particular package
rdepends - Show reverse dependency information for a package
reinstall - Download and (possibly) reinstall a currently installed package
remove - Remove packages
search - Search for a package by name and/or expression
show - Display detailed information about a package
showhold - Same as 'held'
source - Download source archives
sources - Same as 'edit-sources'
unhold - Unhold a package
update - Download lists of new/upgradable packages
upgrade - Perform a safe upgrade
version - Show the installed version of a package

本文由initroot编辑整理,转载请注明www.initroot.com

100次点赞 100次阅读