apt-get 常用命令列表(Ubuntu / Debian 适用)

Kevin 教程 2,113 次浏览 53条评论

Ubuntu、Debian 下管理软件通过 apt-get 包管理器(命令也可用 apt),本文罗列那些常用命令。

apt-get 用法示例

apt-get [选项] [命令] [软件包]

譬如用apt-get -y install wget安装软件,apt-get 是包管理器名称,-y 是选项参数,install 是命令动作,wget 是软件包名(多个用空格隔开)。

apt-get 选项参数

  • -y 对所有选择提示选择是
  • -u 显示更新软件包的列表
  • -s 不安装,模拟执行命令
  • -d 仅下载,不安装或解压归档文件
  • -m 如果归档无法定位,尝试继续
  • -q 输出到日志,无进展指示
  • -qq 不输出信息,错误除外
  • -f 尝试修复系统依赖损坏
  • -b 获取源码包后编译
  • -V 显示详细版本号
  • -h 查看帮助信息

apt-get 命令动作

  • update 更新软件包索引
  • upgrade 运行系统和软件包更新
  • install 安装指定软件包
  • purge 移除软件包及其配置文件
  • remove 移除指定软件包
  • autoremove 自动判断移除不使用软件包
  • clean 清除 apt-get 缓存
  • autoclean 清除旧的已下载归档文件
  • check 检验是否有损坏的依赖
  • source 下载源码档案
  • build-dep 为源码包配置编译依赖
  • dist-upgrade 发行版升级, 详见 apt-get(8)
  • dselect-upgrade 依照 dselect 的选择更新

apt-get 常用命令

命令 作用
sudo apt-get update && apt-get upgrade  更新源索引和更新软件
 sudo apt-get dist-upgrade  更新系统
sudo apt-get install 软件包名  安装指定软件包
sudo apt-get install 软件包名 –reinstall  重新安装软件包
 apt-cache search 软件包名  搜索软件包
apt-cache show 软件包名  查看软件包信息
apt-cache depends 软件包名  查询软件包依赖项
apt-cache rdepends 软件包名  查看软件包被哪些包依赖
sudo apt-get check  检查是否有损坏依赖
sudo apt-get -f install  修复安装依赖
sudo apt-get purge 软件包名  删除软件包及其配置文件
sudo apt-get remove 软件包名  删除软件包
sudo apt-get clean  清除缓存
sudo apt-get autoremove  清除不使用的软件包
 apt-get source 软件包名 下载软件包的源代码
sudo apt-get build-dep 软件包名 安装相关的编译环境

如果要查看系统中已安装的软件包列表可以用dpkg -l命令(dpkg -L可查看软件包位置)。

评论列表

  1. #1

    Hi, very nice website, cheers!
    ——————————————————
    Need cheap and reliable hosting? Our shared plans start at $10 for an year and VPS plans for $6/Mo.
    ——————————————————
    Check here: https://www.reliable-webhosting.com/

  2. #2

    order careprost eyelash free shipping https://carepro1st.com/

  3. #3

    dapoxetine hydrochloride tablet https://salemeds24.wixsite.com/dapoxetine

  4. #4

    clomid side effects in men https://salemeds24.wixsite.com/clomid

  5. #5

    ivermectin tsc https://ivermectin.webbfenix.com/

  6. #6

    how much viagra cost http://droga5.net/

  7. #7

    inexpensive cialis http://www.lm360.us/

  8. #8

    hydroxychloroquine supply chain https://hydroxychloroquine.mlsmalta.com/

  9. #9

    generic vidalista online https://vidalista.mlsmalta.com/

  10. #10

    ivermectin overdose human https://ivermectin.mlsmalta.com/

  11. #11

    hydroxychloroquine stock prices https://hydroxychloroquine.webbfenix.com/

  12. #12

    how many mg of cialis should i take https://wisig.org/

  13. #13

    cialis better than viagra https://tadalafili.com/

  14. #14

    natural vidalista alternatives that work https://vidalista40mg.mlsmalta.com/

  15. #15

    expired ventolin inhaler side effects https://amstyles.com/

  16. #16

    buy priligy online without a prescription https://ddapoxetine.com/

  17. #17

    can you buy chloroquine over the counter https://hydroxychloroquine.mymvrc.org/

  18. #18

    can you buy chloroquine over the counter https://hydroxychloroquine.grassfed.us/

  19. #19

    is hydroxychloroquine a generic drug https://hydroxychloroquinee.com/

  20. #20

    medicare prescription drug cost calculator https://medpills.bee-rich.com/

  21. #21

    medicare prescription drug cost calculator https://buymeds.mlsmalta.com/

  22. #22

    levitra cialis https://tadalafil365.online/

  23. #23

    levitra cialis https://tadalafil24.online/

  24. #24

    hydroxychloroquine cost at walmart https://hhydroxychloroquine.com/

  25. #25

    Nice read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile Thus let me rephrase that: Thanks for lunch! “No one can wear a mask for very long.” by Seneca.

    http://www.vreyrolinomit.com/

  26. #26

    cialis canada online https://cleckleyfloors.com/

  27. #27

    20 mg cialis dosage https://tadalafil.cleckleyfloors.com/

  28. #28

    discount viagra usa https://zsildenafil.com/

  29. #29

    aurogra tablets aurogra https://aurogra.buszcentrum.com/

  30. #30

    what is better cialis or viagra https://cialzi.com/

  31. #31

    generic cialis for sale http://cialis.anafassia.com/

  32. #32

    generic cialis for sale https://cialis.studiowestinc.com/

  33. #33

    buy tadalafil 20mg https://cialis.lm360.us/

  34. #34

    buy tadalafil 20mg https://cialis.bee-rich.com/

  35. #35

    Thankfulness to my father who informed me on the topic of this
    blog, this web site is truly amazing. https://cialis.grassfed.us/tadalafil

  36. #36

    Hiya! Quick question that’s completely off topic.
    Do you know how to make your site mobile friendly?
    My blog looks weird when browsing from my iphone.
    I’m trying to find a template or plugin that might be able to fix this issue.

    If you have any suggestions, please share. Cheers! http://hydroxychloroquinea.audiovideoninja.com/

  37. #37

    Very nice post. I simply stumbled upon your weblog and wanted to mention that I have really
    loved browsing your blog posts. After all I’ll be subscribing in your rss feed and I am hoping you write again very soon! https://hydroxychloroquinew.webbfenix.com/

  38. #38

    I know this web page provides quality depending posts
    and additional information, is there any other web page which offers these things in quality? http://www.deinformedvoters.org/tadalafil-price

  39. #39

    If some one needs to be updated with most recent technologies therefore he must be visit this web site and be
    up to date daily. http://antiibioticsland.com/Cephalexin.htm

  40. #40

    Its superb as your other articles : D, thankyou for putting up. “You can’t have everything. Where would you put it” by Steven Wright.

    http://www.zortilonrel.com/

  41. #41

    I know this if off topic but I’m looking into starting my own weblog and was curious what all is needed to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web smart so I’m not 100 certain. Any suggestions or advice would be greatly appreciated. Cheers

    https://alansolarshblog.wixsite.com/alan-solarsh

  42. #42

    You completed several fine points there. I did a search on the theme and found nearly all people will have the same opinion with your blog.

    https://www.youtube.com/watch?v=KrEgYrXD9SI

  43. #43

    Hi there are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you require any html coding expertise to make your own blog? Any help would be greatly appreciated!

    https://www.youtube.com/watch?v=pWwPxHlnbU8

  44. #44

    Enjoyed reading through this, very good stuff, thankyou. “A man does not die of love or his liver or even of old age he dies of being a man.” by Percival Arland Ussher.

    http://www.vreyrolinomit.com/

  45. #45

    compare drug prices vidalista http://vidallista.com/

  46. #46

    Very interesting information!Perfect just what I was looking for! “Neurotics build castles in the air, psychotics live in them. My mother cleans them.” by Rita Rudner.

    http://www.zortilonrel.com/

  47. #47

    buy cialis online australia paypal buy generic cialis online us pharmacy
    cialis capsule price http://www.tadalafill.online/

  48. #48

    vidalista medication cost http://viidalista.co/

  49. #49

    Have you ever heard of second life (sl for short). It is essentially a game where you can do anything you want. sl is literally my second life (pun intended lol). If you want to see more you can see these second life websites and blogs

    thegridlive.com/2007/page/40/

  50. #50

    Have you ever heard of second life (sl for short). It is essentially a game where you can do anything you want. sl is literally my second life (pun intended lol). If you would like to see more you can see these second life authors and blogs

    http://www.darcymoore.net/2013/05/24/teaching-shakespeare/

  51. #51

    prednisone for purchase https://bvsinfotech.com/

  52. #52

    Very soon this web page will be famous amid all blog users, due to it’s nice posts https://hydroxychloroquinea.advantagetriseal.com/

  53. #53

    You should be a part of a contest for one of the greatest blogs on the web.

    I am going to recommend this site! http://www.deinformedvoters.org/aurogra-online

发表评论

电邮地址用于 Gravatar 头像显示,不会被公开可见。