Linux安裝軟件方法總結

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"相比於windows系統,Linux安裝程序就比較複雜了,很多需要root用戶才能安裝。常見的有以下幾種安裝方法"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"源碼安裝"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"rpm包安裝"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"yum安裝 (RedHat、CentOS)"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"apt-get安裝 (debian,ubuntu)"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"源碼安裝"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"以安裝gcc爲例,登陸https://gcc.gnu.org/,下載自己想要的版本的gcc安裝包 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"上傳gcc-4.1.2.tar.gz到Linux服務器任意目錄,解壓 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"解壓目錄執行shell命令"}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":"./configuration "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"解壓目錄執行shell命令"}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":"make install "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"優點是安裝目錄,軟件版本等可以隨心所欲的配置。同一個安裝包可以在任意版本的Linux進行安裝。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"缺點是安裝的門檻較高,配置複雜,不同軟件配置項目不同。安裝容易失敗。安裝成功有時也會對原系統有破壞。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"rpm包安裝"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"常用命令參數 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" - 查看 rpm -qa "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" - 安裝 rpm -ivh 包名 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" - 卸載 rpm -e 包名 "}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"下載rpm"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"http://rpm.pbone.net/是一個搜索rpm包的網站,搜索框裏查找"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/75/75cde52049b1fd29a159cceeabf978a9.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"出現搜索結果 "}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/31/319ca32443a816e317112c5e9f6f0fde.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"點擊第一個結果進入詳情界面,可以看到rpm包的具體信息,包括依賴以及包裏內容 "}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/cf/cff99f2b86f4ed18c17f2c8b91c5106e.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"優點是安裝時無需配置,可以選擇版本。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"缺點是安裝包的依賴關係需要人工維護,安裝A發現依賴B,安裝B發現依賴C,。。很考驗耐心。 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"安裝gdb爲例 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"確定依賴關係gcc -> g++ -> gdb,gdb依賴g++,g++依賴gcc "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"gcc順序安裝下列包 "}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":" rpm -ivh cpp-4.1.2-42.el5.i386.rpm \n rpm -ivh kernel-headers-2.6.18-92.el5.i386.rpm \n rpm -ivh glibc-headers-2.5-24.i386.rpm \n rpm -ivh glibc-devel-2.5-24.i386.rpm \n rpm -ivh libgomp-4.1.2-42.el5.i386.rpm \n rpm -ivh gcc-4.1.2-42.el5.i386.rpm "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"g++順序安裝下列包 "}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":" rpm -ivh libstdc++-devel-4.1.2-48.el5.i386.rpm \n rpm -ivh gcc-c++-4.1.2-48.el5.i386.rpm "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"gdb順序安裝下列包 "}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":" rpm -ivh gdb-7.0.1-23.el5.i386.rpm "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"按順序安裝完上面眼花繚亂的包後,纔算安裝完成。 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"rpm包命名規則"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"gcc-c++-4.1.2-48.el5.i386.rpm是按照下面的格式命名的 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"name-version -arch(.src).rpm"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"name: 軟件包名稱 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"version: 帶有主、次和修訂的軟件包版本 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"arch: 發行商版本,fc、el、mga、tr……硬件平臺,硬件平臺包括了:i386、i486、i586、i686、x86_64、ppc、sparc、alpha "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"src: 源代碼包 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"YUM"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於RPM包管理,能夠從指定的服務器自動下載RPM包並且安裝,可以自動處理依賴性關係,並且一次安裝所有依賴的軟件。 "}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":"yum install gdb "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"優點是自動管理依賴關係。 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"缺點是需要連接公共網絡,安裝的是指定服務器上的最新版本。 "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"apt-get"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"apt-get是一條linux命令,適用於deb包管理式的操作系統,主要用於自動從互聯網的軟件倉庫中搜索、安裝、升級、卸載軟件或操作系統。 "}]},{"type":"codeblock","attrs":{"lang":""},"content":[{"type":"text","text":"apt-get install gdb "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章