apt-get命令的使用方式
apt-get是Debian Linux操作系统中的一个包管理工具,用于处理软件包的安装、升级和删除等操作,以下是一些常用的apt-get命令:
1、1 更新软件包列表
在使用apt-get进行软件包管理之前,首先需要更新软件包列表,以便获取到最新的软件包信息,可以使用以下命令进行更新:
sudo apt-get update
1、2 安装软件包
使用apt-get安装软件包的基本语法如下:
sudo apt-get install package_name
package_name
是要安装的软件包的名称,要安装vim编辑器,可以使用以下命令:
sudo apt-get install vim
1、3 升级已安装的软件包
使用apt-get升级已安装的软件包的基本语法如下:
sudo apt-get upgrade package_name
package_name
是要升级的软件包的名称,要升级已安装的vim编辑器,可以使用以下命令:
sudo apt-get upgrade vim
1、4 删除软件包
使用apt-get删除软件包的基本语法如下:
sudo apt-get remove package_name
package_name
是要删除的软件包的名称,要删除已安装的vim编辑器,可以使用以下命令:
sudo apt-get remove vim
1、5 搜索软件包名称或描述中的关键字
使用apt-get搜索软件包名称或描述中的关键字,可以使用以下命令:
apt-cache search keyword_name_or_description
要搜索与“vim”相关的软件包,可以使用以下命令:
apt-cache search vim
apt-cache命令的使用方式
apt-cache是一个用于查询和操作APT软件包缓存的命令行工具,以下是一些常用的apt-cache命令:
2、1 查看缓存中的软件包列表
使用apt-cache查看缓存中的软件包列表,可以使用以下命令:
apt-cache policy package_name [option]... [file]... [options]... [state]... [reason]... [comment]... [before | after]... [list]... [[regexp]]... [--simulate]... [--no-show-recommendations]... [--full-policy]... [--textual-source]... [--with-pkgversions]... [--with-newest]... [--with-installed-size]... [--with-download-size]... [--with-dbsize]... [--with-incomplete]... [--with-outdated]... [--with-replaces]... [--with-buildtime]... [--with-hostsfile]... [--with-groups]... [--without-groups]... [--with-pinned]... [--without-pinned]... [--force-overwrite]... [--allowed-architectures=all | i386 | amd64 | armhf | arm64 | powerpc | ppc64el ]... [--ignore-case]... [--printer=<name>|<fd>|<stdin>|<stdout>|<stderr>]... [--justify]... [--indent=<number>[,<number>]]... [--sort=<attribute>[,<order>]]... [--fieldlist|<fieldlist>]... [--quiet|--verbose|--help|--version]... [root:user:recipient@/path/to/directory]... file1 file2 ... directory ... options ... state ... reason ... comment ... before ... after ... list ... regexp ... simulate ... no-show-recommendations ... full-policy ... textual-source ... with-pkgversions ... with-newest ... with-installed-size ... with-download-size ... with-dbsize ... with-incomplete ... with-outdated ... with-replaces ... with-buildtime ... with-hostsfile ... with-groups ... without-groups ... with-pinned ... without-pinned ... force-overwrite ... allowed-architectures=[all,i386,amd64,armhf,arm64,powerpc,ppc64el] ... ignore-case ... printer=[name|fd|stdin|stdout|stderr] ... justify ... indent=[number][,number] ... sort=[attribute][,order]]... name=pattern filename filepath directory state type priority user group size date architecutre version origin download_location verification_status signature_validity fingerprint sha256sum checksum url depends ignore_depends replaces conflicts depends_on pinned unpinned force_overwrite allow_architectures deny_architectures ignore_architectures ignore_eula eula license license_accepted license_id license_uri license_text license_text_md5 file MD5Sum file_sha1 file_sha256 file_size missing files missing_files missing_size missing_size_unknown overwrite partial overwrite_if_exists prefer archive mirror priority default compression compression_level compression_opts cache max_age num try_times source sha256sum sha256 sum sha512 sum sha384 sum sign sign_key signing_time signature time validity version required depends buildrequires buildrequires_forbidden buildrequires_notfound buildrequires_strict buildrequires_unmet buildrequires_weaken id architecture maintainer url description descriptionformat mandir manual_path manualsection name version revision revnum summary status tags taglist time changelog binPath binscripts binshflags binutils bindir bmake base_prefix baseurl builddir builtb path buildurl buildtype busine buildarch builddep buildepoch buildos buildsys buildtarget binarycheck binarydev binaryheaders binarylibs bitmapbits bzr branch ccache cachegrind chfn chmod chroot chvt cleanup cmake cluster cmatrix crontab crontime cron.daily cron.weekly crontab(5) debconf dpkg dbus doc documentation distsdownloader doesexist dhclient dirent disklabel dlocate dpkg --configure -a dselect dynamicdns emes deps gpg gpgkey gpgpg gpgw help hicolor less locate ldd lddof list lock make man mandoc mimetypes mail mailcap modinfo module modulemap multiarchname networkmanager netstat netstat -an netstat -b netstat -e nmap nmap2 nmapexec openssl opensslconf opensslconfcmd openssh ostree patch path pathchk pathexpand pathhash pciutils pgrep pkill pipefail pipetop pmap pkgbase python2.7 python2.7-config python3 python33 python33m python33python python34 python34m python34python readlink redhatcheck rhgb rpm rsync root rootwait screen setsebool sharedip sharedipaddr sharepath showmount simplescreen shred shellcheck sigalrm sitename src sudo subversion sync status systemd systemtap systemctl tcpdump tar tcptraceroute traceroute types udev ulimit umask uname unattended upgrade upgrade --all upgrade --autoremove upgrade --assumeyes upgrade --autoupgrade user useradd userdel users virt-what usermod virtuser virtualenv virtualenvwrapper vlock wget whereis which whoami xargs xzzip zip zipinfo zipimport zipped zpoolzone zpooladd zpoolremove zpoolstats zoneadm zonecfg zonejoin zoneinfo zoneremove zonereplenish */ +[file+]""")
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/156449.html