国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

Linux|Centos|Ubuntu|系統(tǒng)進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務(wù)器之家 - 服務(wù)器系統(tǒng) - Ubuntu - Linux中apt-get和apt-cache命令使用詳解

Linux中apt-get和apt-cache命令使用詳解

2019-10-14 15:50開源中文社區(qū) Ubuntu

這篇文章主要介紹了Linux中apt-get和apt-cache命令使用詳解,作為包管理中最常用的命令,需要的朋友可以參考下

apt-get和apt-cache是Ubuntu Linux中的命令行下的包管理工具。 apt-get的GUI版本是Synaptic包管理器。本篇中我們會展示apt-get和apt-cache命令的15個不同例子。
示例:1 列出所有可用包

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ apt-cache pkgnames
account-plugin-yahoojp
ceph-fuse
dvd+rw-tools
e3
gnome-commander-data
grub-gfxpayload-lists
gweled
.......................................

 

示例:2 用關(guān)鍵字搜索包

這個命令在你不確定包名時很有用,只要在apt-cache(LCTT 譯注:這里原文是apt-get,應(yīng)為筆誤)后面輸入與包相關(guān)的關(guān)鍵字即可。

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ apt-cache search "web server"
apache2 - Apache HTTP Server
apache2-bin - Apache HTTP Server (binary files and modules)
apache2-data - Apache HTTP Server (common files)
apache2-dbg - Apache debugging symbols
apache2-dev - Apache HTTP Server (development headers)
apache2-doc - Apache HTTP Server (on-site documentation)
apache2-utils - Apache HTTP Server (utility programs for web servers)
......................................................................

 

注意: 如果你安裝了“apt-file”包,我們就可以像下面那樣用配置文件搜索包。

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ apt-file search nagios.cfg
ganglia-nagios-bridge: /usr/share/doc/ganglia-nagios-bridge/nagios.cfg
nagios3-common: /etc/nagios3/nagios.cfg
nagios3-common: /usr/share/doc/nagios3-common/examples/nagios.cfg.gz
pnp4nagios-bin: /etc/pnp4nagios/nagios.cfg
pnp4nagios-bin: /usr/share/doc/pnp4nagios/examples/nagios.cfg

 

示例:3 顯示特定包的基本信息

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ apt-cache show postfix
Package: postfix
Priority: optional
Section: mail
Installed-Size: 3524
Maintainer: LaMont Jones <lamont@debian.org>
Architecture: amd64
Version: 2.11.1-1
Replaces: mail-transport-agent
Provides: default-mta, mail-transport-agent
.....................................................

 

示例:4 列出包的依賴

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ apt-cache depends postfix
postfix
Depends: libc6
Depends: libdb5.3
Depends: libsasl2-2
Depends: libsqlite3-0
Depends: libssl1.0.0
|Depends: debconf
Depends: <debconf-2.0>
cdebconf
debconf
Depends: netbase
Depends: adduser
Depends: dpkg
............................................

 

示例:5 使用apt-cache顯示緩存統(tǒng)計

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ apt-cache stats 
Total package names: 60877 (1,218 k)
Total package structures: 102824 (5,758 k)
Normal packages: 71285
Pure virtual packages: 1102
Single virtual packages: 9151
Mixed virtual packages: 1827
Missing: 19459
Total distinct versions: 74913 (5,394 k)
Total distinct descriptions: 93792 (2,251 k)
Total dependencies: 573443 (16.1 M)
Total ver/file relations: 78007 (1,872 k)
Total Desc/File relations: 93792 (2,251 k)
Total Provides mappings: 16583 (332 k)
Total globbed strings: 171 (2,263 )
Total dependency version space: 2,665 k
Total slack space: 37.3 k
Total space accounted for: 29.5 M

 

示例:6 使用 “apt-get update” 更新倉庫

使用命令“apt-get update”, 我們可以重新從源倉庫中同步文件索引。包的索引從“/etc/apt/sources.list”中檢索。

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get update
Ign http://extras.ubuntu.com utopic InRelease
Hit http://extras.ubuntu.com utopic Release.gpg
Hit http://extras.ubuntu.com utopic Release
Hit http://extras.ubuntu.com utopic/main Sources
Hit http://extras.ubuntu.com utopic/main amd64 Packages
Hit http://extras.ubuntu.com utopic/main i386 Packages
Ign http://in.archive.ubuntu.com utopic InRelease
Ign http://in.archive.ubuntu.com utopic-updates InRelease
Ign http://in.archive.ubuntu.com utopic-backports InRelease
................................................................

 

示例:7 使用apt-get安裝包

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get install icinga

 

上面的命令會安裝叫“icinga”的包。
示例:8 升級所有已安裝的包

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get upgrade

 

示例:9 更新特定的包

在apt-get命令中的“install”選項后面接上“-only-upgrade”用來更新一個特定的包,如下所示:

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get install filezilla --only-upgrade

 

示例:10 使用apt-get卸載包

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get remove skype

 

上面的命令只會刪除skype包,如果你想要刪除它的配置文件,在apt-get命令中使用“purge”選項。如下所示:

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get purge skype

 

我們可以結(jié)合使用上面的兩個命令:

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get remove --purge skype

 

示例:11 在當(dāng)前的目錄中下載包

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get download icinga
Get:1 http://in.archive.ubuntu.com/ubuntu/ utopic/universe icinga amd64 1.11.6-1build1 [1,474 B]
Fetched 1,474 B in 1s (1,363 B/s)

 

上面的目錄會把icinga包下載到你的當(dāng)前工作目錄。
示例:12 清理本地包占用的磁盤空間

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get clean

 

上面的命令會清空apt-get所下載的包占用的磁盤空間。

我們也可以使用“autoclean”選項來代替“clean”,兩者之間主要的區(qū)別是autoclean清理不再使用且沒用的下載。

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done

 

示例:13 使用“autoremove”刪除包

當(dāng)在apt-get命令中使用“autoremove”時,它會刪除為了滿足依賴而安裝且現(xiàn)在沒用的包。

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get autoremove icinga

 

示例:14 顯示包的更新日志

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get changelog apache2
Get:1 Changelog for apache2 (http://changelogs.ubuntu.com/changelogs/pool/main/a/apache2/apache2_2.4.10-1ubuntu1/changelog) [195 kB]
Fetched 195 kB in 3s (60.9 kB/s)

 

上面的命令會下載apache2的更新日志,并在你屏幕上分頁顯示。
示例:15 使用 “check” 選項顯示損壞的依賴關(guān)系

   

復(fù)制代碼

代碼如下:

linuxtechi@localhost:~$ sudo apt-get check
Reading package lists... Done
Building dependency tree
Reading state information... Done

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 北条麻妃在线一区二区三区 | 日本欧美一区二区 | 亚洲精彩视频 | 日本欧美在线 | 中文字幕www.| 亚洲综合中文 | 中文字幕观看 | 自拍第1页 | 久久久精品亚洲 | 香蕉国产| 久草在线免费资源 | 国产欧美日韩综合精品一区二区 | 午夜精品福利在线观看 | 亚洲成人av一区二区三区 | 国产精品久久久久久久久久免费 | 国产精品久久久久久吹潮 | 午夜激情视频网站 | 国产这里只有精品 | 欧美成人久久 | 国产精品日本欧美一区二区三区 | av免费网站在线观看 | 亚洲欧美激情精品一区二区 | 中国一级黄色毛片视频 | 久久白虎 | 中文字幕一区二区三区四区不卡 | 久久久久久免费精品 | 欧美一区二区三区在线观看 | 欧美激情区 | 依人九九宗合九九九 | 日韩久久精品 | 亚洲三级在线 | 午夜视频播放 | 久久国产亚洲精品 | 91视频导航| 国产精品精品 | 色av网| 国内精品一区二区三区 | 日韩国产高清在线 | 四虎在线视频 | 中文字幕亚洲精品 | 黄色国产一级片 |