Apt

来自姬鸿昌的知识库
跳到导航 跳到搜索

https://wiki.debian.org/zh_CN/Apt

Advanced package tool, or APT, is a free-software user interface that works with core libraries to handle the installation and removal of software on Debian, and Debian-based Linux distributions.

APT is a management system for software packages. Originally written for Debian and the deb package format, APT was ported and became APT-RPM to manage the rpm(8) package format. APT-RPM can be used by any RPM-based distribution, such as Conectiva, Red Hat, SUSE, ALT-Linux, etc.


apt 是一个命令行包管理器,用来搜索和管理以及查询有关包的信息。

它提供与专用 APT 工具(apt-get 和 apt-cache)相同的功能,但更好用

更新可用软件包列表

root@aade5ae73079:/var/www/html# apt update

配置 APT 源 镜像

备份旧的源配置文件

root@5033aa3ffae0:/etc/apt# cp sources.list sources.list.bak
root@5033aa3ffae0:/etc/apt# rm sources.list
root@5033aa3ffae0:/etc/apt# vim sources.list

替换默认的 archive.ubuntu.com 为 mirrors.aliyun.com

参考 Ubuntu 配置镜像

只能在网上搜目标命令在哪个 package 里,然后安装

root@5033aa3ffae0:/apache-zookeeper-3.8.0-bin# lsb_release -a
bash: lsb_release: command not found
root@5033aa3ffae0:/apache-zookeeper-3.8.0-bin# apt search lsb-core
Sorting... Done
Full Text Search... Done
lsb-core/jammy 11.1.0ubuntu4 amd64
  Linux Standard Base core support package

root@5033aa3ffae0:/apache-zookeeper-3.8.0-bin# apt -y install lsb-core
......
root@5033aa3ffae0:/apache-zookeeper-3.8.0-bin# lsb_release -a
LSB Version:	core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy
root@5033aa3ffae0:/apache-zookeeper-3.8.0-bin#