当需要从网上下载安装某个软件包但又不确定具体软件包的名称时,可以按如下步骤进行:
以安装JDK为例子:
(1) #sudo apt-cache search jdk
cacao-source - Source for CACAO, a Java virtual machine
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-builddep - Standard Java or Java compatible build dependencies
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
gcj-jdk - gcj and classpath development tools for Java(TM)
libcommons-lang-java - Extension of the java.lang package
libcommons-lang-java-doc - Extension of the java.lang package
libpg-java - Java database (JDBC) driver for PostgreSQL
libslf4j-java - Simple Logging Facade for Java
mauve - free test suite for the Java Class libraries
fakeroot-ng - Gives a fake root environment
freemind - Java Program for creating and viewing Mindmaps
japitools - Java API compatibility testing tools
java3ds-fileloader - Java3D 3DS FileLoader
libcommons-launcher-java - cross platform. java application launcher
libcommons-math-java - Java lightweight mathematics and statistics components
libcommons-math-java-doc - Java lightweight mathematics and statistics components - documentation
libhibernate-annotations-java - Hibernate Annotations
libhibernate-commons-annotations-java - Hibernate Commons Annotations
libicu4j-java - Library for unicode support and internalisation
libitext1-java - Java Library to generate PDF on the Fly
libjboss-aop-java - JBoss Aspect Oriented Programming (AOP) framework
libjboss-common-java - The JBoss Common Project
libjboss-marshalling-java - alternative serialization API
libjxp-java - Java template engine/script. processor
libnb-javaparser-java - Parser for the Java language which is good for use in tools
libpicocontainer-java - Java library implementing the Dependency Injection pattern
librxtx-java - Full Java CommAPI implementation
libtrove-java - high performance collections for java
libtrove-java-doc - high performance collections for java
libwagon-java - tools to manage Maven artifacts and deployment
mmake - Makefile generator for Java programs
substance - cross-platform. look & feel for Swing applications
substance-doc - cross-platform. look & feel for Swing applications - documentation
testng - testing framework for Java
usepackage - utility to manage environment variables from within dotfiles
jde - JDEE, Java Development Environment for Emacs(en)
gcj-4.4-jdk - gcj and classpath development tools for Java(TM)
icedtea-6-jre-cacao - Alternative JVM for OpenJDK, using Cacao
icedtea6-plugin - web browser plugin based on OpenJDK and IcedTea to execute Java applets
openjdk-6-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-6-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-6-doc - OpenJDK Development Kit (JDK) documentation
openjdk-6-jdk - OpenJDK Development Kit (JDK)
openjdk-6-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-6-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-6-jre-lib - OpenJDK Java runtime (architecture independent libraries)
openjdk-6-source - OpenJDK Development Kit (JDK) source files
openoffice.org-gcj - office productivity suite -- Java libraries for GIJ
openjdk-6-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
openoffice.org - office productivity suite
visualvm - All-in-One Java Troubleshooting Tool
选择一个软件包下载安装
(2) #sudo apt-get install openjdk-6-jdk
下面 是 apt-get 相关命令列表
以安装JDK为例子:
(1) #sudo apt-cache search jdk
cacao-source - Source for CACAO, a Java virtual machine
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-builddep - Standard Java or Java compatible build dependencies
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
gcj-jdk - gcj and classpath development tools for Java(TM)
libcommons-lang-java - Extension of the java.lang package
libcommons-lang-java-doc - Extension of the java.lang package
libpg-java - Java database (JDBC) driver for PostgreSQL
libslf4j-java - Simple Logging Facade for Java
mauve - free test suite for the Java Class libraries
fakeroot-ng - Gives a fake root environment
freemind - Java Program for creating and viewing Mindmaps
japitools - Java API compatibility testing tools
java3ds-fileloader - Java3D 3DS FileLoader
libcommons-launcher-java - cross platform. java application launcher
libcommons-math-java - Java lightweight mathematics and statistics components
libcommons-math-java-doc - Java lightweight mathematics and statistics components - documentation
libhibernate-annotations-java - Hibernate Annotations
libhibernate-commons-annotations-java - Hibernate Commons Annotations
libicu4j-java - Library for unicode support and internalisation
libitext1-java - Java Library to generate PDF on the Fly
libjboss-aop-java - JBoss Aspect Oriented Programming (AOP) framework
libjboss-common-java - The JBoss Common Project
libjboss-marshalling-java - alternative serialization API
libjxp-java - Java template engine/script. processor
libnb-javaparser-java - Parser for the Java language which is good for use in tools
libpicocontainer-java - Java library implementing the Dependency Injection pattern
librxtx-java - Full Java CommAPI implementation
libtrove-java - high performance collections for java
libtrove-java-doc - high performance collections for java
libwagon-java - tools to manage Maven artifacts and deployment
mmake - Makefile generator for Java programs
substance - cross-platform. look & feel for Swing applications
substance-doc - cross-platform. look & feel for Swing applications - documentation
testng - testing framework for Java
usepackage - utility to manage environment variables from within dotfiles
jde - JDEE, Java Development Environment for Emacs(en)
gcj-4.4-jdk - gcj and classpath development tools for Java(TM)
icedtea-6-jre-cacao - Alternative JVM for OpenJDK, using Cacao
icedtea6-plugin - web browser plugin based on OpenJDK and IcedTea to execute Java applets
openjdk-6-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-6-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-6-doc - OpenJDK Development Kit (JDK) documentation
openjdk-6-jdk - OpenJDK Development Kit (JDK)
openjdk-6-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-6-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-6-jre-lib - OpenJDK Java runtime (architecture independent libraries)
openjdk-6-source - OpenJDK Development Kit (JDK) source files
openoffice.org-gcj - office productivity suite -- Java libraries for GIJ
openjdk-6-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
openoffice.org - office productivity suite
visualvm - All-in-One Java Troubleshooting Tool
选择一个软件包下载安装
(2) #sudo apt-get install openjdk-6-jdk
下面 是 apt-get 相关命令列表
apt-get install packagename
安装一个新软件包(参见下文的 aptitude)apt-get remove packagename
卸载一个已安装的软件包(保留配置文档)apt-get --purge remove packagename
卸载一个已安装的软件包(删除配置文档)dpkg --force-all --purge packagename
有些软件很难卸载,而且还阻止了别的软件的应用,就能够用这个,但是有点冒险。apt-get autoclean apt
会把已装或已卸的软件都备份在硬盘上,所以假如需要空间的话,能够让这个命令来删除您已删掉的软件apt-get clean
这个命令会把安装的软件的备份也删除,但是这样不会影响软件的使用。apt-get upgrade
更新任何已安装的软件包apt-get dist-upgrade
将系统升级到新版本apt-cache search string
在软件包列表中搜索字符串dpkg -l package-name-pattern
列出任何和模式相匹配的软件包。假如您不知道软件包的全名,您能够使用“*package-name-pattern*”。aptitude
周详查看已安装或可用的软件包。和apt-get类似,aptitude能够通过命令行方式调用,但仅限于某些命令——最常见的有安装和卸载命令。由于 aptitude比apt-get了解更多信息,能够说他更适合用来进行安装和卸载。apt-cache showpkg pkg
显示软件包信息。apt-cache dumpavail
打印可用软件包列表。apt-cache show pkg
显示软件包记录,类似于dpkg –print-avail。apt-cache pkgname
打印软件包列表中任何软件包的名称。dpkg -S file
这个文档属于哪个已安装软件包。dpkg -L package
列出软件包中的任何文档。apt-file search filename
查 找包含特定文档的软件包(不一定是已安装的),这些文档的文档名中含有指定的字符串。apt-file是个单独的软件包。您必须先使用apt-get install来安装他,然後运行apt-file update。假如apt-file search filename输出的内容太多,您能够尝试使用apt-file search filename | grep -w filename(只显示指定字符串作为完整的单词出现在其中的那些文档名)或类似方法,例如:apt-file search filename | grep /bin/(只显示位于诸如/bin或/usr/bin这些文档夹中的文档,假如您要查找的是某个特定的执行文档的话,这样做是有帮助的)。* apt-get autoclean
定 期运行这个命令来清除那些已卸载的软件包的.deb文档。通过这种方式,您能够释放大量的磁盘空间。假如您的需求十分迫切,能够使用apt-get clean以释放更多空间。这个命令会将已安装软件包裹的.deb文档一并删除。大多数情况下您不会再用到这些.debs文档,因此假如您为磁盘空间不足 而感到焦头烂额,这个办法也许值得一试。来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14766028/viewspace-702548/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14766028/viewspace-702548/