apt-get apt-cache,kotlinlambda表达式成员引用

  1. Replaces: mail-transport-agent

  2. Provides:default-mta, mail-transport-agent

示例:4 列出包的依赖
  1. linuxidc@localhost:~$ apt-cache depends postfix

  2. postfix

  3. Depends: libc6

  4. Depends: libdb5.3

  5. Depends: libsasl2-2

  6. Depends: libsqlite3-0

  7. Depends: libssl1.0.0

  8. |Depends: debconf

  9. Depends:<debconf-2.0>

  10. cdebconf

  11. debconf

  12. Depends: netbase

  13. Depends: adduser

  14. Depends: dpkg

示例:5 使用apt-cache显示缓存统计
  1. linuxidc@localhost:~$ apt-cache stats

  2. Totalpackage names:60877(1,218 k)

  3. Totalpackage structures:102824(5,758 k)

  4. Normal packages:71285

  5. Purevirtual packages:1102

  6. Singlevirtual packages:9151

  7. Mixedvirtual pa

《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》

【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享

ckages:1827

  1. Missing:19459

  2. Total distinct versions:74913(5,394 k)

  3. Total distinct descriptions:93792(2,251 k)

  4. Total dependencies:573443(16.1 M)

  5. Total ver/file relations:78007(1,872 k)

  6. TotalDesc/File relations:93792(2,251 k)

  7. TotalProvides mappings:16583(332 k)

  8. Total globbed strings:171(2,263)

  9. Total dependency version space:2,665 k

  10. Total slack space:37.3 k

  11. Total space accounted for:29.5 M

示例:6 使用 “apt-get update” 更新仓库

使用命令“apt-get update”, 我们可以重新从源仓库中同步文件索引。包的索引从“/etc/apt/sources.list”中检索。

  1. linuxidc@localhost:~$ sudo apt-get update

  2. Ign http://extras.ubuntu.com utopic InRelease

  3. Hit http://extras.ubuntu.com utopic Release.gpg

  4. Hit http://extras.ubuntu.com utopic Release

  5. Hit http://extras.ubuntu.com utopic/main Sources

  6. Hit http://extras.ubuntu.com utopic/main amd64 Packages

  7. Hit http://extras.ubuntu.com utopic/main i386 Packages

  8. Ign http://in.archive.ubuntu.com utopic InRelease

  9. Ign http://in.archive.ubuntu.com utopic-updates InRelease

  10. Ign http://in.archive.ubuntu.com utopic-backports InRelease

示例:7 使用apt-get安装包
  1. linuxidc@localhost:~$ sudo apt-get install icinga

上面的命令会安装叫“icinga”的包。

示例:8 升级所有已安装的包
  1. linuxidc@localhost:~$ sudo apt-get upgrade
示例:9 更新特定的包

在apt-get命令中的“install”选项后面接上“-only-upgrade”用来更新一个特定的包,如下所示:

  1. linuxidc@localhost:~$ sudo apt-get install filezilla --only-upgrade
示例:10 使用apt-get卸载包
  1. linuxidc@localhost:~$ sudo apt-get remove skype

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

  1. linuxidc@localhost:~$ sudo apt-get purge skype

我们可以结合使用上面的两个命令:

  1. linuxidc@localhost:~$ sudo apt-get remove --purge skype
示例:11 在当前的目录中下载包
  1. linuxidc@localhost:~$ sudo apt-get download icinga

  2. Get:1 http://in.archive.ubuntu.com/ubuntu/ utopic/universe icinga amd64 1.11.6-1build1 [1,474 B]

  3. Fetched1,474 B in1s(1,363 B/s)

上面的目录会把icinga包下载到你的当前工作目录。

示例:12 清理本地包占用的磁盘空间
  1. linuxidc@localhost:~$ sudo apt-get clean

上面的命令会清空apt-get所下载的包占用的磁盘空间。

我们也可以使用“autoclean”选项来代替“clean”,两者之间主要的区别是autoclean清理不再使用且没用的下载。

  1. linuxidc@localhost:~$ sudo apt-get autoclean

  2. Readingpackage lists…Done

  3. Building dependency tree

  4. Reading state information…Done

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

当在apt-get命令中使用“autoremove”时,它会删除为了满足依赖而安装且现在没用的包。

  1. linuxidc@localhost:~$ sudo apt-get autoremove icinga
示例:14 显示包的更新日志
  1. linuxidc@localhost:~$ sudo apt-get changelog apache2

  2. Get:1Changelogfor apache2 (http://changelogs.ubuntu.com/changelogs/pool/main/a/apache2/apache2_2.4.10-1ubuntu1/changelog) [195 kB]

  3. Fetched195 kB in3s(60.9 kB/s)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值