기본 콘텐츠로 건너뛰기

Ubuntu 패키지 관리자

  • dpkg
    • 아래 툴들의 기반 툴
  • apt
    • apt-get
    • apt-file
  •  synaptic
    • GUI 툴

GUI 툴은 직관적으로 사용가능.

 

패키지 설치


apt-get install 패키지 이름


  • 파일 설치 시에 임시로 다운받은 .deb 파일들은  /var/cache/apt/archives에  저장된다.


dpkg -i deb 파일

 

설치된 파일로 패키지 이름 찾기


apt-file search /path/to/file

apt-file search 는 /path/to/file문자열이 포함된 모든 패키지를 찾는다.

예) apt-file search /bin/ls

base: /usr/lib/plan9/bin/ls
arb: /usr/lib/arb/bin/lsadt
bilibop-rules: /bin/lsbilibop
canna-utils: /usr/bin/lsdic
cgroup-bin: /usr/bin/lscgroup
cgroup-bin: /usr/bin/lssubsys
cmtk: /usr/lib/cmtk/bin/lsba

coreutils: /bin/ls

...

정확히 /bin/ls가 포함된 패키지 만을 찾으려면

 apt-file -F search /path/to/file

위와 같이 -F옵션을 사용한다.

dpkg -S /path/to/file

설치된 파일로 패키지가 설치한 파일 목록보기


 apt-file -F search `which ls` | awk -F':' '{print $1}' | xargs apt-file -F list

 dpkg -S `which ls` | awk -F':' '{print $1}' | xargs dpkg -L


댓글

이 블로그의 인기 게시물

Example of java class transform with java agent and BCI

Dynamic transform   예제 시나리오 원하는 작업  DB에 요청하는 모든 쿼리를 출력 작업 순서 Agent 작성 ClassFileTransformer 구현 Agent 작성 Java Agent 구성도 Manifest 파일 Manifest-Version: 1.0 Premain-Class: sample.bci.Agent Agent-Class: sample.bci.Agent Can-Redefine-Classes: True must be end with new line - http://docs.oracle.com/javase/tutorial/deployment/jar/modman.html Agent.java /** * example for bci with java agent */ package sample.bci; import java.lang.instrument.Instrumentation; /** * @author k * */ public class Agent { public static void premain(String args, Instrumentation inst) { inst.addTransformer(new JdbcQueryTransformer()); } public static void agentmain(String args, Instrumentation inst) { inst.addTransformer(new JdbcQueryTransformer()); } } JdbcQueryTransformer. java /** * example for bci with java agent */ package sample.bci; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.IllegalClassFormatException; impor...

ubuntu 에서 원격 JMX(Java Management Extensions) 모니터링 가능하게 하기

원격 JMX 모니터링 가능하게 하기   정리  설정 파일 수정 관련 파일 $JAVA_HOME/jre/lib/management/management.properties  내용추가 com.sun.management.jmxremote.port=8991 com.sun.management.jmxremote.ssl=false 톰캣 설정 수정 관련 파일 /etc/default/tomcat7 JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Dcom.sun.management.jmxremote   password 파일 소유자 및 권한 수정 sudo chown tomcat7.tomcat7 /etc/java-7-openjdk/management/jmxremote.password sudo chmod 600 /etc/java-7-openjdk/management/jmxremote.password    원격 JMX 모니터링 시 설정 설정이 필요한 파일 $JAVA_HOME/jre/lib/management/jmxremote.access $JAVA_HOME/jre/lib/management/jmxremote.password 두 파일이 필요하다는데. Ubuntu 14.04 Java Home Directory 에서 JAVA_HOME은 /usr/lib/jvm/default-java임을알아냈다. 물론, /usr/lib/jvm/default-java/jre/lib/management/jmxremote.access와 같은 직접적인 접근도 가능하다. linux의 주 설정파일 들이 모여있는 디렉토리는 /etc이며, 위의 파일 또한 실제로는 /etc/java-7-openjdk/management/jmxremote.access라는 실제 파일에 ...

[android] RecyclerView with Cursor

RecyclerView is new in Android 5.0 (Lollipop) . To use with support library add compile 'com.android.support:recyclerview-v7:21.0.0' in build.gradle file dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.0' compile 'com.android.support:recyclerview-v7:21.0.0' } and import import android.support.v7.widget.RecyclerView; Get from layout xml RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycle_list); Plug in LayoutManager recyclerView.setLayoutManager(layoutManager); Create Adapter NameRecyclerAdapter mAdapter; ... mAdapter = new NameRecyclerAdapter(); Plug in Adapter recyclerView.setAdapter(mAdapter); NameRecyclerViewAdapter.java import android.database.Cursor; import android.support.v7.widget.RecyclerView; import android.view.ViewGroup; import android.widget.TextView; /** * * Recycler Adapter for TestDB...