5/11/2016

(Ubuntu筆記) sudo apt-get 指令

theGeekStuff
debian/ubuntu linux系統中最常讓人欽佩的是他們將apt-get做的太好了,讓每個人都不容易玩死他(當然還是有一直亂裝亂刪除套件後導致系統掛掉,不過還是比Windows穩定多了)。在這邊稍微筆記在終端器下使用"apt-get"這個指令上的一些參數,詳細的說明可用查詢.
~$ man apt-get
安裝套件:
"sudo apt-get install keyword"



移除套件:
"sudo apt-get remove keyword"

清理套件下載後的檔:
"sudo apt-get clean"

查詢套件的名稱:
"sudo apt-cache search keyword"

清除某套件的相關遺毒:
"sudo apt-get purge keyword"   
 (例如. "sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5" )   在安裝其他database套件時,需要先確定將mysql相關的清除

修正套件相依性:
"sudo apt-get install -f"   

自動清除原先因相依性而安裝的套件,現在卻已不再需要的部份套件:
"sudo apt-get autoremove"   


(以下為部份討論)
So, my advice is that the first two are perfectly safe to use, unless you often end breaking installed packages and need to reinstall them & don't have regular access to Internet conenction. (in which case you proably should be more worried about why you need to reinstall stuff in the first place ). And for autoremove, I'd say it's pretty safe as well, but it's a good idea to glance through what packages it plans to uninstall in case you notice something you know you need.....
....
See how it works? It's not easy to defeat the package manager and break your system, but it is also not difficult. It's a tool intended to protect you from mild negligence only. It's not magic or super-smart or intended to protect you from foolishness. If you tell it to uninstall your kernel and render your system unbootable...it will do that; you are it's master.

延伸閱讀:

沒有留言:

張貼留言

謝謝您的留言, 我會在收到通知後盡快回覆您的.
Thanks for your comment. l may reply once I got notification.