安裝最新版 devtoolset-8
工具就是生產力
為了更好的debug,在測試環境中安裝了比較新的linux kernel 4.16,但是安裝完畢後,很多常用的debug工具都不能很好的適配最新版的核心。沒辦法,又得研究如何更新這些工具們。
轉了一圈,發現從原始碼安裝的難度不低,故放棄了。隨後轉向了devtoolset
For certain applications, more recent versions of some software components are often needed in order to use their latest new features. Red Hat Software Collections is a Red Hat offering that provides a set of dynamic programming languages, database servers, and various related packages that are either more recent than their equivalent versions included in the base Red Hat Enterprise Linux system, or are available for this system for the first time.
簡單說,RedHat 推出Software Collections
的目的就是為了解決想在RedHat
系統下能使用新版本的工具,讓同一個工具(如gcc)的不同版本能在系統中共存,在需要的時候切換到對應的版本中,類似 pyenv(python)、rvm(ruby) 或者 nvm(node)。RedHat
與CentOS
師出同源,一樣可以使用。
如何安裝和使用devtoolset
,可以參考ofollow,noindex" target="_blank">官方指導文件
。在看裝前,我們可以先到3609" rel="nofollow,noindex" target="_blank">Information for build
搜尋自己需要的package對應的原始碼版本,看devtoolset
中的安裝包對應的原始碼版本是多少,是否滿足自身的需求。
比如linux kernel 4.16對應的systemtap的原始碼版本要求systemtap-3.3以上。在devtoolset-7
的安裝包中devtoolset-7-systemtap-3.1-4s.el7
對應的原始碼版本只有systemtap-3.1。所以只能尋求更高版本的支援。因此在該網站上找到了devtoolset-8-systemtap-3.3-1.el6
。但是devtoolset-8
還沒有正式發行,無法從yum上進行安裝。其具體的安裝方法是:
-
到
sclo7-devtoolset-8-rh-candidate
現在全部RPM包(這裡偷懶下載全部包,這樣就不用處理他們之間複雜的相互依賴關係) -
下載完成後,在RPM包的目錄中執行
yum install *.rpm
,安裝全部 -
然後執行
scl enable devtoolset-8 bash
切換環境。
> stap -V # 我們可以執行這個命令進行驗證,我們得到了Systemtap-3.3,支援linux kernel 2.6.28-4.18 Systemtap translator/driver (version 3.3/0.173, rpm 3.3-1.el7) Copyright (C) 2005-2018 Red Hat, Inc. and others This is free software; see the source for copying conditions. tested kernel versions: 2.6.18 ... 4.18-rc0 enabled features: AVAHI BOOST_STRING_REF DYNINST LIBRPM LIBSQLITE3 NLS NSS READLINE