apt 常用操作命令

Posted 志波同学

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apt 常用操作命令相关的知识,希望对你有一定的参考价值。

一、常用命令

1、更新 apt

root@fad4c851e732:/# apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu eoan InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu eoan-updates InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu eoan-backports InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu eoan-security InRelease
Reading package lists... Done

2、查找软件

root@fad4c851e732:/# apt-cache search jdk 
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jdk-headless - Standard Java or Java compatible Development Kit (headless)
openjdk-11-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-11-doc - OpenJDK Development Kit (JDK) documentation
openjdk-11-jdk - OpenJDK Development Kit (JDK)
openjdk-11-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-11-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-11-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-11-source - OpenJDK Development Kit (JDK) source files
golang-github-jdkato-prose-dev - Golang library for text processing
golang-github-jdkato-syllables-dev - Go syllable counter
jtreg - Regression Test Harness for the OpenJDK platform
libanimal-sniffer-java - JDK/API verification tools
libhtsjdk-java - Java API for high-throughput sequencing data (HTS) formats
libhtsjdk-java-doc - Documentation for the java HTSJDK library
libmodulator-java - Java small shim library that wraps Java 9 APIs and exposes them to recent JDKs
libunsafe-mock-java - Java library providing backported sun.misc.Unsafe class from JDK 8
openjdk-11-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-11-jre-dcevm - Alternative VM for OpenJDK 11 with enhanced class redefinition
openjdk-11-jre-zero - Alternative JVM for OpenJDK, using Zero
openjdk-13-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-13-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-13-doc - OpenJDK Development Kit (JDK) documentation
openjdk-13-jdk - OpenJDK Development Kit (JDK)

3、安装软件

apt-get install openjdk-8-jdk
......
......
Setting up libgail18:amd64 (2.24.32-4ubuntu1) ...
Setting up libgtk2.0-bin (2.24.32-4ubuntu1) ...
Setting up openjdk-8-jdk:amd64 (8u232-b09-0ubuntu1) ...
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
Setting up libgail-common:amd64 (2.24.32-4ubuntu1) ...
Setting up ubuntu-mono (19.04-0ubuntu1) ...
Processing triggers for mime-support (3.63ubuntu1) ...
Processing triggers for libc-bin (2.30-0ubuntu2) ...
Processing triggers for ca-certificates (20190110) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

done.
done.
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-1build1) ...

二、更换 apt镜像源

更换阿里云镜像源参考资料:请点击

以上是关于apt 常用操作命令的主要内容,如果未能解决你的问题,请参考以下文章

Linux里面apt是啥?

apt-get 常用命令总结

ubuntu 常用的APT命令参数

apt常用命令

APT常用命令

Linux常用命令