源碼包的缺點
Ⅰ yum安裝 源碼安裝 哪個好
根做運維的朋友聊天,談到了,yum安裝和源碼安裝哪個好的問題。真沒想到,關於這個問題,分歧還挺大的。有的人認為,不用源碼安裝就不是好的運維,不是好的系統管理員。這帽子扣的有點大了。在此我想說一說我的看法,經常看我博客的,也許知道,前期我寫關於伺服器的文章,基本上都是源碼安裝的,後來基本上是用yum安裝的,除非yum源裡面沒有,我才會源碼安裝。在我看來,yum安裝和源碼安裝,基本上沒區別,最終還是生成系統所需求的文件,有什麼區別呢?一,yum安裝和源碼安裝,方式的不同1,yum安裝是將yum源中的rpm包下載到本地,安裝這個rpm包。這個rpm包是別人編譯安裝好的二進制包。這種方式與其說是安裝不如說是,更新來的更確切一點。2,源碼安裝,下載是源碼包,要進行編譯和安裝,編譯過程,可以進行參數設定。二,yum安裝和源碼安裝,優缺點分析1,yum安裝的優缺點yum安裝的優點,做運維的都很清楚,安裝東西,方便快捷,特別是不用考慮包依賴。yum安裝的缺點,安裝過程,人為無法干預,不能按需,安裝。源裡面有什麼就安裝什麼,安裝的版本也比較低。2,源碼安裝的優缺點源碼安裝的優點,編譯安裝過程,可以設定參數,按照需求,進行安裝,並且安裝的版本,可以自己選擇,靈活性比較大。源碼安裝的缺點,由於安裝包過新或者是其他問題,導致依賴的包沒有,或者版本過低。這個時候就要解決包的依賴問題,linux系統中有的包,一個依賴一個,可能裝一個小東西,就要解決一堆包的依賴問題,花很多時間解決包的依賴問題,得不嘗失。源碼安裝的多了,不敢升級系統,升級系統,可能會導致以前手動裝的東西,不能用。很多做運維的,都認為,源碼安裝比yum安裝的性能要好,根據參數選擇安裝,肯定比yum裝了一大堆要好。這樣認為的運維,我只能說,他不懂配置。根本不了解自已裝的東西。在我看來,同一版yum安裝和源碼安裝完全是一樣的。以apache以例吧,這個東西,非常常見的,用做web最廣泛的工具之一,源碼安裝,./configure時候,可以添加很多參數,來實現訂制。yum安裝也可以,yum安裝裝了很多,apache的模塊,有的模塊根本用不到,無故浪費系統資源和影響性能。但是我們可以配置httpd.conf啊,不需求的模塊,我們可以不LoadMole啊,通過修改配置文件,完全可以實現根源碼安裝一樣的效果。不排除少數軟體,安裝後,不能配置情況,也就是說安裝的時候是多少東西,就是多少東西,沒有配置文件可以配置。我覺得,對於剛接觸linux的人來說,源碼安裝很有必要,這樣你可以知道自己在做什麼,安裝過程中,肯定會遇到很多很多的問題,遇到問題,解決問題。這樣才會成長。不要一直都用yum裝,如果yum安裝出了一點問題,就傻眼了,不知道怎麼解決,這樣很杯具。轉載請註明
作者:海底蒼鷹
Ⅱ 源碼包安裝和二進制包安裝的區別
zip文件如何在linux安裝nux下安裝軟體主要有三種格式,基於包管理機制、二進制、源代碼,包管理機制的安裝是和發行版有關系的,比如fedora的是rpm,ubuntu的是deb,二進制的是.bin,源代碼是tar.gz和tar.bz2,zip格式的包應該是二進制或源代碼的包,可以使用unzipname.zip解壓,然後看是什麼格式的包,如果是二進制的包先看下有沒有執行許可權,沒有就執行chmod755filename.bin,然後./filename.bin安裝,如果是源代碼,執行./configure&&make&&makeintall安裝
Ⅲ 什麼是開源軟體有什麼優缺點
開源軟體即為開放源代碼軟體,它被定義為描述其源碼可以被公眾使用的軟體,並且此軟體的使用,修改和分發也不受許可證的限制。
優點:
1、降低風險
擁有源代碼使顧客們可以控制那些他們的業務所賴以生存的工具。當一個open-source產品的開發者提高價格,增加了難以接收的限制,或者使用了一些使顧客不滿意的方法,另一個不同的組織將使用該源代碼開始開發新的產品以解決原來機構的問題。顧客也能自己維護或找別人改進它以達到自己的要求。
2、質量高
一些研究已經顯示了open-source軟體與別的可比商業軟體具有可靠性上的極大優勢。更加有效的開發模式,更多的獨立同行對代碼和設計的雙重審查,以及大部分作者對自己作品的極大榮譽感,都對其優良的質量有所貢獻。一些公司甚至給予發現Bug者以物質獎勵。
3、透明度高
有軟體有很多「陰暗的死角」,隱藏著許多Bug。源碼對於查錯和理解產品工作原理來說是很重要的。在大的軟體公司,只有極少數人能接觸到源碼,而這些能接觸源碼的人通常用戶都無法直接接觸。能接觸源碼對於修補安全漏洞來說,也是非常重要的。一些開放源碼的產品--包括上面列舉的一些產品--是如此成功,以至於其商業競爭者無法存活。
缺點:
1、安裝open-source軟體有時需要一些更多的技術經驗,例如,可以配置或編譯源代碼的能力。
2、許多的組織已經嚴重的依賴open-source軟體。
3、出了問題,可能沒有人負責,會遭受巨大的經濟損失。
(3)源碼包的缺點擴展閱讀:
開放源碼軟體和免費軟體的區別
歷史上許多人開發過這樣一種軟體(也就是免費軟體基礎)簡稱為「free software」,而媒介一般稱它為「freeware」。不幸的是這兩種術語都被證明是不明確的且含糊的。
對於大多數人來說「free」僅僅用於購買的費用。比這個初始花費更重要的是由於缺乏許可證限制而帶來的費用。這些是幾種有可能是免費的軟體類型,但是明顯不是open-source software,因為它們具有某些限制或是缺乏公開的源碼。
Ⅳ 源碼打包apk使用RecyclerView時遇到的坑
最近在做一個系統通知欄的項目叫MsgCenter。使用Android studio開發的.
使用了腳本拷貝與復制
LIBS="/Users/love/Desktop/moran2/MsgCenter/app/libs"
SRC="/Users/love/Desktop/moran2/MsgCenter/app/src/main/java/*"
RES="/Users/love/Desktop/moran2/MsgCenter/app/src/main/res"
ANDROIDMANIFEST="app/src/main/AndroidManifest.xml"
DES="/Users/love/Desktop/moran2/MsgCenter/MsgCenter"
mkdir -p $DES/src
cp -r LIBS DES
cp -r SRC DES/src
cp -r RES DES
cp -r JNI DES
cp ANDROIDMANIFEST DES
cp ANDROIDMK DES
然後提交到伺服器打包報錯:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: net.imoran.notification.lib, PID: 2630
java.lang.ExceptionInInitializerError
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.getInstance(NotificationWindowManager.java:115)
at net.imoran.notification.lib.service.StarStatusService.onBind(StarStatusService.java:32)
at android.app.ActivityThread.handleBindService(ActivityThread.java:3158)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread H.handleMessage(ActivityThread.java:1582) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5795) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit MethodAndArgsCaller.run(ZygoteInit.java:834)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:724)
Caused by: android.view.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class android.support.v7.widget.RecyclerView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at net.imoran.notification.lib.manager.NotificationManager.initRootView(NotificationManager.java:51)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.initAdapterView(NotificationWindowManager.java:200)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:123)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:34)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager .(NotificationWindowManager.java:111) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.getInstance(NotificationWindowManager.java:115) at net.imoran.notification.lib.service.StarStatusService.onBind(StarStatusService.java:32) at android.app.ActivityThread.handleBindService(ActivityThread.java:3158) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread H.handleMessage(ActivityThread.java:1582)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5795)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit MethodAndArgsCaller.run(ZygoteInit.java:834) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:724) Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class android.support.v7.widget.RecyclerView at android.view.LayoutInflater.createView(LayoutInflater.java:645) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at net.imoran.notification.lib.manager.NotificationManager.initRootView(NotificationManager.java:51) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.initAdapterView(NotificationWindowManager.java:200) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.(NotificationWindowManager.java:123) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.(NotificationWindowManager.java:34) at net.imoran.notification.lib.windowmanager.NotificationWindowManager .<clinit>(NotificationWindowManager.java:111)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.getInstance(NotificationWindowManager.java:115)
at net.imoran.notification.lib.service.StarStatusService.onBind(StarStatusService.java:32)
at android.app.ActivityThread.handleBindService(ActivityThread.java:3158)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread H.handleMessage(ActivityThread.java:1582) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5795) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit MethodAndArgsCaller.run(ZygoteInit.java:834)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:724)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at net.imoran.notification.lib.manager.NotificationManager.initRootView(NotificationManager.java:51)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.initAdapterView(NotificationWindowManager.java:200)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:123)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:34)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager .(NotificationWindowManager.java:111) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.getInstance(NotificationWindowManager.java:115) at net.imoran.notification.lib.service.StarStatusService.onBind(StarStatusService.java:32) at android.app.ActivityThread.handleBindService(ActivityThread.java:3158) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread H.handleMessage(ActivityThread.java:1582)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5795)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit MethodAndArgsCaller.run(ZygoteInit.java:834) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:724) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/recyclerview/R styleable;
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:590)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:551)
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at net.imoran.notification.lib.manager.NotificationManager.initRootView(NotificationManager.java:51)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.initAdapterView(NotificationWindowManager.java:200)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:123)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:34)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager .(NotificationWindowManager.java:111) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.getInstance(NotificationWindowManager.java:115) at net.imoran.notification.lib.service.StarStatusService.onBind(StarStatusService.java:32) at android.app.ActivityThread.handleBindService(ActivityThread.java:3158) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread H.handleMessage(ActivityThread.java:1582)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5795)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit MethodAndArgsCaller.run(ZygoteInit.java:834) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:724) Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.recyclerview.R styleable" on path: DexPathList[[zip file "/flysystem/app/mor-notification.apk"],nativeLibraryDirectories=[/system/lib64/mor-notification, /flysystem/app/mor-notification.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:590)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:551)
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at net.imoran.notification.lib.manager.NotificationManager.initRootView(NotificationManager.java:51)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.initAdapterView(NotificationWindowManager.java:200)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:123)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager.<init>(NotificationWindowManager.java:34)
at net.imoran.notification.lib.windowmanager.NotificationWindowManager .(NotificationWindowManager.java:111) at net.imoran.notification.lib.windowmanager.NotificationWindowManager.getInstance(NotificationWindowManager.java:115) at net.imoran.notification.lib.service.StarStatusService.onBind(StarStatusService.java:32) at android.app.ActivityThread.handleBindService(ActivityThread.java:3158) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread H.handleMessage(ActivityThread.java:1582)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5795)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit MethodAndArgsCaller.run(ZygoteInit.java:834) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:724) Suppressed: java.lang.ClassNotFoundException: android.support.v7.recyclerview.R styleable
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 28 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
07-20 14:14:31.557 2630-2664/net.imoran.notification.lib I/System: FinalizerDaemon: finalize objects = 2695
從log中我們可以看到,
1.Binary XML file line #22: Binary XML file line #39: Error inflating class android.support.v7.widget.RecyclerView
2.同時還有這樣的 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/recyclerview/R$styleable
3.Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.recyclerview.R$styleable"
一開始只注意到了第一點,於是在網路上查呀查:
就發現大家的說法就是 在eclipse或者android studio上 因為sdk的版本不match,等等的。有的人說把android.support.v7.recyclerview.jar這個包換掉,換成match的版本的就好了,但我這邊因為開發方式不一樣,就又斷掉了。但是卻讓我知道了是版本的問題
後來
有的人說是
1.AndroidManifest.xml中的targetSDKVersion不對,fix -> NOK。
2.build.gradle中的某些屬性不對。fix -> NOK
因為App是獨立的apk,就去這5.0,6.0 andorid 的源碼中去找android.support.v7.recyclerview.
同時又注意到了這兩點錯誤
2.同時還有這樣的 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/recyclerview/R$styleable
3.Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.recyclerview.R$styleable"
從Log中我們可以看到
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:440)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:409)
RecyclerView的409 和 440 行出錯
就發現了在 frameworks/support/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java中
使用到了R.styleable.RecyclerView這個屬性,而第2,3點log中出現的就是R$styleable 的錯誤。
明確了:在android6.0版本RecyclerView類中用到了R.styleable.RecyclerView這個資源。而android5.0的版本中的RecyclerView類沒用到R.styleable.RecyclerView
回到frameworks/support/v7/recyclerview/目錄下就會發現
-----------5.0 沒有res/ 文件夾
-----------6.0 則有
那麼現在中場總結一下,因為andorid5.0中的RexyclerView類中沒有使用res資源,而6.0卻使用了。同時6.0的res/資源是存在的。只能說明,我們沒有引用到,或者說是沒有把對應的資源載入,進行編譯。
問題又來了:res/資源是在哪裡載入的?
----------》 Android.mk 文件下有這么一段
發現了android-support-v7-recyclerview的身影
那這內容是什麼意思?
1.LOCAL_STATIC_JAVA_LIBARIES 本地靜態java庫。
2.LOCAL_RESOURCE_DIR 本地資源文件,默認是proct package和device package下面相應的res路徑和$(LOCAL_PATH)/res
3.LOCAL_AAPT_FLAGS += -c ldpi -c mdpi
上面指定了編譯時打包 ldpi 和mdpi 如果系統默認的是hdpi的話,那就是這三種都會裝入包中
在中場總結的時候,已經明確,是因為res資源沒有載入。
所以只需要在LOCAL_RESOURCE_DIR中加上frameworks/support/v7/recyclerview/res就可以了
Android.mk文件內容變成:
再次編譯,正常運行。
======================================================================================================
其實就是因為android的版本升級,RecyclerView 中的創建LayoutManager的方式發生了改變,舊版本里少了個 R.styleable.RecyclerView, 而在新環境下又沒將其編譯進去,故有此錯。
各位少俠也可以在 package 中的res/attrs.xml 下面自己定義一個`````
總體來說將的不是很清楚, 還請大家見諒 。。
Ⅳ 怎麼卸載源碼編譯安裝的軟體
第一,看大家安裝軟體的時候有沒有使用--prefix這個命令,如果有那就把你指定的文件給刪除了就行了,
第二,如果沒有用這個信念指定就麻煩一點了,那就進入到軟體解壓後的目錄,執行sudo make uninstall看能否成功,
第三,如果不行,那就進入用 editor 查看 makefile 文件 看看裡面卸載的命令是什麼如果該源碼包沒有提供
此類方法刪除 就只能手動刪除
第四,手動刪除最無奈的辦法能不能搞干凈也只能看運氣了,使用whereis xxx 找到軟體安裝目錄,rm -rf 把
這些目錄都刪除,應該能刪除干凈,如whereis python,例子如下:
whereis python
python: /usr/bin/python2.6-config /usr/bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/local/bin/python3.3m-config /usr/local/bin/python3.3m /usr/local/bin/python3.3 /usr/local/bin/python3.3-config /usr/local/lib/python3.3 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
rm -rf /usr/bin/python2.6-config
rm -rf /usr/bin/python2.6
rm -rf /usr/bin/python
rm -rf /usr/lib/python2.6
rm -rf /usr/lib64/python2.6
...................等等,,,
好了,文法就這些吧,如果大家有更好的方法可以評論補充,禁止吐糟,加水。
Ⅵ linux中源代碼包安裝的基本步驟是什麼
詳解linux源碼包安裝過程
1. 解壓縮包
可以通過下載或其他方式獲得了一個軟體包,通常它是一個壓縮文件,大部分可能是存檔的和壓縮的,這些文件一般以 .tar .gz為擴展名。
首先拷貝它到一個目錄,然後 untar 和 gunzip 解壓它。 通常這個命令是
tar xzvf filename [filename 是軟體文件名稱]
解壓後的文件一般會在當前目錄下的創建子目錄,並以這個包名來命名。 你也可以用用這個命令預先查看結果 tar tzvf filename,顯示包里有那些解壓文件。
源文件如果是新的 bzip2 (.bz2) 格式,可用
bzip2 -cd filename | tar xvf -,或更簡單的 tar xyvf filename ,這很不錯的tar命令被不斷的完善。
說明:
A:有時候一些文件必須安裝在用戶的 home 目錄下,或更多的是在一個固定的目錄,比如 /, /usr/src, 或 /opt 。所以必須仔細閱讀安裝包的配置信息。當一個軟體包里如果有config 和 Makefiles 文件則最好去編輯它,這里包括了安裝指令和說明。提示:你改變 makefile 會導致不同的結果。大部分軟體包允許用 make install 自動處理安置二進制文件在適當的系統位置。
B:你可能碰到過一些共享文件、shell 存檔文件、尤其是 Internet 上的源碼新聞組。它們保留的原因是具有人性化的可讀性,並且允許新聞組緩沖並通過它們篩選和剔除出不合格的。它們可能用 unshar filename.shar 命令來解壓。
C: 一些源碼存檔文件是用非標準的 DOS,Mac 或其他壓縮的比如:
zip, arc, lha, arj, zoo, rar, and shk.
D: 有時候,你可能需要使用一個 patch 或顯示改變了的 diff 文件來升級或修復存檔的源碼文件。這 doc 文件或者 README 文件將告訴你怎麼去使用。一個很好的命令用標准語法來調用的命令是 patch < patchfile.
2: 關於 rpm 安裝包
一些 Linux 用戶懼怕通過使用源碼來手動安裝軟體包,不過現在有方便的 rpm 和 deb 或 新格式的 slp 包。例如:rpm 安裝運行平穩又快,作為一個軟體安裝在某幾個有名的操作系統。
作為方便的RPM包也存在很多不好的缺點,例如:
A: 要了解軟體中更多更詳細的內容你必須去在二進制中去了解,而不是rpm包。
B: 還有安裝一個 rpm 包如果需要依賴關系那麼安裝就可能會導致失敗。
C: 當 rpm 請求你系統中不同版本的庫,那麼安裝將不能繼續,除非你為錯誤的庫位置創建連接符號到正確的位置。
說明:必須使用root 安裝 rpm 和 deb 。因為它需要必須的寫入許可權。
最簡單的,用命令 rpm -i packagename.rpm 和 dpkg --install packagename.deb 會自動解包和安裝。
3:關於安裝 Linux 包出現的一些問題及解決方案
假設 make 失敗有個鏈接錯誤: -lX11: No such file or directory,正好在 xmkmf 之後已被調用,這可能意味著 Imake 不能被完全建立。檢查第一部分 Makefile 文件的的行是這樣:
· LIB= -L/usr/X11/lib
· INCLUDE= -I/usr/X11/include/X11
· LIBS= -lX11 -lc -lm
這個 -L 和 -I 開關告訴編譯器和鏈接分別在哪裡找到 library 和 include 文件。在這個例子里, X11 庫應該在 /usr/X11/lib 目錄,且 X11 包含文件應該在 /usr/X11/include/X11 目錄里。假如對於你的機器上的這個錯誤,請處理修改 Makefile 並重新再 make。
沒有聲明涉及的數學庫函數,像下列各項:
/tmp/cca011551.o(.text 0x11): undefined reference to `cos'
要修復它,需要明確鏈接到匹配的庫,在 Makefile (看先前的例子) 里增加一個 -lm 到 LIB 或 LIBS 標記 。
用其他方法嘗試
仍然失敗 如果失敗,參考下列腳本:
make -DUseInstalled -I/usr/X386/lib/X11/config
這個直接方式的類別相當於。
在少數例子里,用 root 運行 ldconfig 可能會解決:
# ldconfig 更新共享庫鏈接符號。
一些 Makefiles 使用你系統里未被承認的庫別名。一個例子,構建可能需要 libX11.so.6 ,但是在 /usr/X11R6/lib 不存在文件或鏈接。然而,在那裡是 libX11.so.6.1。解決方法是用 root 運行ln -s /usr/X11R6/lib/libX11.so.6.1 /usr/X11R6/lib/libX11.so.6 ,接著需要運行 ldconfig 。
有一些包需要你安裝一個或更多庫的升級版本。需要拷貝一個或更多的庫到適當的目錄里,刪除舊的庫,重新設置動態鏈接庫。
4:一些其他的問題處理
安裝一個shell 腳本如果出現:No such file or directory 的錯誤消息。這是可以檢查文件許可權確定文件事可執行的,並檢查文件頭確定是否 shell 或程序是腳本在指定的位置被調用。一個例子,這個腳本可能是這樣開始的:
#!/usr/local/bin/EDEN
如EDEN的實際安裝位置是在你的 /usr/bin 目錄,用一個 /usr/local/bin 替代
這個腳本不能運行有兩個方法來糾正!!
A: 文件頭改成 #!/usr/bin/EDEN
B: 或增加一個鏈接符, ln -s /usr/bin/EDEN
5:一個典型的例子 Xloadimage
首先說明下面的例子來源於國外網站的一個技術實例,這里我做了翻譯和整理。
這個例子展現一個簡單的問題。xloadimage 程序對我的圖形工具的調整設置是有用的附加。從源碼目錄拷貝文件,用 tar xzvf 解壓文件,可是在運行 make 的時候出現令人討厭的錯誤並停止了。
gcc -c -O -fstrength-rece -finline-functions -fforce-mem
-fforce-addr -DSYSV -I/usr/X11R6/include
-DSYSPATHFILE=\"/usr/lib/X11/Xloadimage\" mcidas.c
In file included from /usr/include/stdlib.h:32,
from image.h:23,
from xloadimage.h:15,
from mcidas.c:7:
/usr/lib/gcc-lib/i486-linux/2.6.3/include/stddef.h:215:
conflicting types for `wchar_t'
/usr/X11R6/include/X11/Xlib.h:74: previous declaration of
`wchar_t'
make[1]: *** [mcidas.o] Error 1
make[1]: Leaving directory
`/home/thegrendel/tst/xloadimage.4.1'
make: *** [default] Error 2
這個錯誤消息包含了實質的線索:
查看 image.h 文件的 23 行:
#include < stdlib.h>
在源碼的某處對於 xloadimage, wchar_t 已經在指定標准 include 文件重新定義。 告訴我們首先在 image.h 的 23 行嘗試注釋它,或許 stdlib.h include 是不存在的,畢竟不是所有都是必需的。
在這點,構建中的收益來源於所有任何一個致命錯誤。xloadimage 現在功能正常。
6: 安裝 Linux 包的一些總結
堅持自己動手處理所有的安裝出現的問題,不斷總結努力學習,從錯誤里去仔細研究,努力動手排錯,從每個不足甚至失敗的地方得到擴充和提升,可以增強安裝構建軟體的技巧。
Ⅶ rpm包和源碼包安裝的區別
本人比較傾向與源碼安裝,因為源碼安裝,卸載比較容易,只需要把安裝程序的目錄刪除掉即可;
要是用rpm包安裝的話,卸載需要謹慎,因為他在安裝的時候,會安裝各種信賴包,一不小心系統就被搞over了;
總的來說,一些大型的比較占份量的最好使用源碼包安裝,方便管理;而些基於系統底層的包就無所謂了,怎麼方便怎麼安裝;
若你是初學者,強烈建議你使用源碼安裝,因為這個可以增加你對系統的了解,解決處理問題的能力,而rpm包是一些比較懶的安裝方法;
Ⅷ linux下安裝DNS,RPM包好還是源碼包好
看你什麼系統了,redhat/fedora/centos/redflag/suse都是用rpm的,debian/ubuntu/kubuntu都是用deb的,這些包都是事先編譯好的,安裝後直接就可以用,但通用性很差,比如針對fedora11的rpm很有可能在fedora8上不能安裝,因為glibc庫版本不同,用編譯好的東西會不兼容。
源碼包什麼系統都可以用,因為是需要自己編譯的,但麻煩的是由於linux版本太多,更新太快,編譯時經常有很多依賴問題,rpm和deb通過更新自動下載其他依賴包,源碼包就需要一個一個編譯了,比較麻煩。
Ⅸ linux中打包和壓縮有什麼區別
打包就是把若干文件或文件夾放到一個tar文件中,但是不會壓縮文件大小。
壓縮就是在打包的基礎上壓縮文件的大小。
Ⅹ 什麼是源代碼開放有什麼優點
關於開放源代碼的定義(1.7版)
開放源代碼並不僅僅意味著對源代碼的訪問權。開放源代碼軟體的發布條款必須滿足以下條件:
1.自由地再發布
如果被發布的軟體是由不同來源的程序組成的,許可證不得限制任何當事人或組織(party)銷售或贈送作為被發布軟體成分之一的開放源碼軟體。
許可證不得從此項銷售中索取使用費或其它任何費用。(理由)
2.源代碼程序必須包括源代碼,必須允許以源代碼方式發布、還必須允許以編譯後的形式發布。如果產品的某個部分沒有與源代碼一同發布,那麼必須提供通行的、不需要支付合理范圍之外的任何費用的手段以獲得源代碼---從網路上免費下載是一種可取的方式。源代碼必須是程序員對其進行修改的最佳形式。故意地使源代碼變得含混晦澀是不允許的。也不允許給出預處理器或翻譯器處理的中間結果。(理由)
3.派生作品
許可證必須允許修改軟體和派生軟體,並且必須允許它們按照原軟體的許可證的條款進行發布。(理由)
4.作者的源代碼的完整性只有在許可證允許與源代碼一同發布"補丁文件"(該"補丁文件"以在創建時對程序進行修改為目的)時,許可證才能限制對修改形式的源代碼的發布。許可證必須明確地允許發布由修改後的源代碼生成的程序。許可證可以要求派生的作品採用不同的名稱或不同的版本號以區別於原來的軟體。(理由)
5.不得歧視任何個人或團體
許可證不得歧視任何個人或者由多人組成的團體。(理由)
6.不得歧視任何應用領域(fieldsofendeavor)許可證不得限制任何人把程序應用於任何領域。例如,不得規定程序不能應用於商業領域或基因研究領域。(理由)
7.許可證的發布與程序有關的權利必須適用於該程序的任何使用者,並且程序的使用者也不需要為了使用該程序而獲得其它許可證的許可。(理由)
8.許可證不能針對於一個產品與程序有關的權利不能由該程序是否作為某個軟體產品的一部分來決定。
如果程序從那個發布中被抽出來,並且按照程序的許可證的條款進行使用和發布,那麼得到該程序的當事人或組織將獲得與得到原程序的使用者相同的權利。(理由)
9.許可證不能影響其它軟體許可證不得向與採用它的軟體一同發布的其它軟體提出任何限制。例如,
許可證不能堅持要求在同一媒體上發布的其它程序都是開放源代碼軟體。(理由)
http://www.yesky.com/339/193839.shtml