debian包管理
常用的包管理工具有:apt、apt-get、apt-cache、apt-file、aptitude、dpkg等。功能有重复的,挑顺手的即可。
1、apt
# apt --help
list - list packages based on package names
search - search in package descriptions
show - show package details
update - update list of available packages
install - install packages
remove - remove packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
# apt search docker
Sorting... Done
Full Text Search... Done
docker/stable 1.5-1 amd64
System tray for KDE3/GNOME2 docklet applications
docker-ce/jessie,now 17.03.1~ce-0~debian-jessie amd64 [installed]
Docker: the open-source application container engine
karbon/stable 1:2.8.5+dfsg-1+b2 amd64
vector graphics application for the Calligra Suite
kdocker/stable 4.6-2 amd64
lets you dock any application into the system tray
python-docker/stable 0.5.3-1 all
Python wrapper to access docker.io's control socket
python3-docker/stable 0.5.3-1 all
Python 3 wrapper to access docker.io's control socket
ruby-docker-api/stable 1.10.10-1 all
Ruby gem to interact with docker.io remote API
vim-syntax-docker/now 1.6.2~dfsg1-1~bpo8+1 all [installed,local]
Docker container engine - Vim highlighting syntax files
# apt list docker
Listing... Done
docker/stable 1.5-1 amd64
# apt list docker-ce -a
Listing... Done
docker-ce/jessie,now 17.03.1~ce-0~debian-jessie amd64 [installed]
docker-ce/jessie 17.03.0~ce-0~debian-jessie amd64
2、apt-get
# apt-get --help
apt-get is a simple command line interface for downloading and installing packages.
The most frequently used commands are update and install.
update - Retrieve new lists of packages
upgrade - Perform an upgrade
install - Install new packages (pkg is libc6 not libc6.deb)
remove - Remove packages
autoremove - Remove automatically all unused packages
purge - Remove packages and config files
source - Download source archives
build-dep - Configure build-dependencies for source packages
dist-upgrade - Distribution upgrade, see apt-get(8)
dselect-upgrade - Follow dselect selections
clean - Erase downloaded archive files
autoclean - Erase old downloaded archive files
check - Verify that there are no broken dependencies
changelog - Download and display the changelog for the given package
download - Download the binary package into the current directory
-d Download only - do NOT install or unpack archives
-s No-act. Perform ordering simulation
-y Assume Yes to all queries and do not prompt
-f Attempt to correct a system with broken dependencies in place
3、apt-cache
# apt-cache --help
apt-cache is a low-level tool used to query information from APT's binary cache files
search - Search the package list for a regex pattern
show - Show a readable record for the package
# apt-cache search docker
karbon - vector graphics application for the Calligra Suite
docker - System tray for KDE3/GNOME2 docklet applications
kdocker - lets you dock any application into the system tray
python-docker - Python wrapper to access docker.io's control socket
python3-docker - Python 3 wrapper to access docker.io's control socket
ruby-docker-api - Ruby gem to interact with docker.io remote API
docker-ce - Docker: the open-source application container engine
vim-syntax-docker - Docker container engine - Vim highlighting syntax files
4、apt-file
# apt-file --help
update Fetch Contents files from apt-sources.
search|find <pattern> Search files in packages
list|show <pattern> List files in packages
purge Remove cache files
--ignore-case -i Ignore case distinctions
--package-only -l Only display packages name
--sources-list -s <file> sources.list location
查找命令或文件来自哪个package(包括已安装的和未安装的),dpkg -S 只会搜索已安装的package。
这里跟yum provides相比体验还是差了不少,这里匹配正则pattern,会列出所有包含关键字的文件,列出众多文件之后还需要过滤,而yum provides会直接列出包含文件的package。
# aptitude install apt-file 安装apt-file,默认没有安装
# apt-file update 更新索引
# apt-file find docker | grep docker$
ansible: /usr/share/ansible/cloud/docker
docker: /usr/bin/wmdocker
docker: /usr/share/menu/docker
docker-ce: /etc/bash_completion.d/docker
docker-ce: /etc/default/docker
docker-ce: /etc/init.d/docker
docker-ce: /usr/bin/docker
docker-ce: /usr/share/zsh/vendor-completions/_docker
kdocker: /etc/bash_completion.d/kdocker
kdocker: /usr/bin/kdocker
kdocker: /usr/share/menu/kdocker
zsh-common: /usr/share/zsh/functions/Completion/Linux/_docker
# apt-file find docker | grep dockerd$
docker-ce: /usr/bin/dockerd
5、aptitude
# aptitude --help
install - Install/upgrade packages.
remove - Remove packages.
purge - Remove packages and their configuration files.
forbid-version - Forbid aptitude from upgrading to a specific package version.
update - Download lists of new/upgradable packages.
safe-upgrade - Perform a safe upgrade.
full-upgrade - Perform an upgrade, possibly installing and removing packages.
search - Search for a package by name and/or expression.
show - Display detailed information about a package.
versions - Displays the versions of specified packages.
clean - Erase downloaded package files.
autoclean - Erase old downloaded package files.
changelog - View a package's changelog.
download - Download the .deb file for a package.
reinstall - Download and (possibly) reinstall a currently installed package.
-s Simulate actions, but do not actually perform them.
-d Only download packages, do not install or remove anything.
-P Always prompt for confirmation of actions.
-y Assume that the answer to simple yes/no questions is 'yes'.
-V Show which versions of packages are to be installed.
-v Display extra information. (may be supplied multiple times).
# aptitude search docker
p docker - System tray for KDE3/GNOME2 docklet applications
i docker-ce - Docker: the open-source application container engine
p kdocker - lets you dock any application into the system tray
p python-docker - Python wrapper to access docker.io's control socket
p python3-docker - Python 3 wrapper to access docker.io's control socket
p ruby-docker-api - Ruby gem to interact with docker.io remote API
i vim-syntax-docker - Docker container engine - Vim highlighting syntax files
# aptitude show docker-ce
Package: docker-ce
New: yes
State: installed
Automatically installed: no
Version: 17.03.1~ce-0~debian-jessie
Priority: optional
Section: admin
Maintainer: Docker <support@docker.com>
Architecture: amd64
Uncompressed Size: 87.8 M
Depends: iptables, init-system-helpers (>= 1.18~), libapparmor1 (>= 2.6~devel), libc6 (>= 2.17), libdevmapper1.02.1 (>= 2:1.02.90), libltdl7 (>= 2.4.2), libsystemd0
Recommends: aufs-tools, ca-certificates, cgroupfs-mount | cgroup-lite, git, xz-utils
Conflicts: docker (< 1.5~), docker-ee, docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
Replaces: docker-engine
Description: Docker: the open-source application container engine
Docker is an open source project to build, ship and run any application as a lightweight container
Docker containers are both hardware-agnostic and platform-agnostic. This means they can run anywhere, from your laptop to the largest EC2 compute instance and everything in
between - and they don't require you to use a particular language, framework or packaging system. That makes them great building blocks for deploying and scaling web apps,
databases, and backend services without depending on a particular stack or provider.
Homepage: https://dockerproject.org
6、dpkg
# dpkg --help
-i|--install <.deb file name>
--unpack <.deb file name>
--configure <package>
--get-selections [<pattern> ...] Get list of selections to stdout.
-r|--remove <package> ...
-P|--purge <package> ...
-s|--status <package> ... Display package status details.
-p|--print-avail <package> ... Display available version details.
-L|--listfiles <package> ... List files `owned' by package(s).
-l|--list [<pattern> ...] List packages concisely. 列出所有已安装的软件包。
-S|--search <pattern> ... Find package(s) owning file(s).
--print-architecture Print dpkg architecture.
查看package包含的文件:
# dpkg -L tree
/.
/usr
/usr/bin
/usr/bin/tree
/usr/share
/usr/share/doc
/usr/share/doc/tree
/usr/share/doc/tree/copyright
/usr/share/doc/tree/TODO
/usr/share/doc/tree/changelog.Debian.gz
/usr/share/doc/tree/changelog.gz
/usr/share/doc/tree/README.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/tree.1.gz
查看package的详细信息,类似aptitude show和apt-cahce show。
# dpkg -s docker-ce
Package: docker-ce
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 85769
Maintainer: Docker <support@docker.com>
Architecture: amd64
Version: 17.03.1~ce-0~debian-jessie
Replaces: docker-engine
Depends: iptables, init-system-helpers (>= 1.18~), libapparmor1 (>= 2.6~devel), libc6 (>= 2.17), libdevmapper1.02.1 (>= 2:1.02.90), libltdl7 (>= 2.4.2), libsystemd0
Recommends: aufs-tools, ca-certificates, cgroupfs-mount | cgroup-lite, git, xz-utils
Conflicts: docker (<< 1.5~), docker-ee, docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
Conffiles:
/etc/bash_completion.d/docker d005b0a5ba32208960d3baced35931d5
/etc/default/docker 82d6a44e99db1a3b74f7835e4f5e1b01
/etc/init.d/docker 4622ff202fe959c98f4fd993822424ab
/etc/init/docker.conf 123f7e2b4078fa11b4eecc4c4f9bdc25
Description: Docker: the open-source application container engine
Docker is an open source project to build, ship and run any application as a
lightweight container
.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest EC2 compute instance and
everything in between - and they don't require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
Homepage: https://dockerproject.org
7、dpkg-reconfigure 更改指定包的配置
更改时区:
# dpkg-reconfigure tzdata #这里会跳出图形框,选择相应的时区即可
Current default time zone: 'Asia/Shanghai'
Local time is now: Sun Jun 18 11:29:19 CST 2017.
Universal Time is now: Sun Jun 18 03:29:19 UTC 2017.
8、debconf-show 查看指定包的当前配置
# debconf-show tzdata
* tzdata/Zones/Asia: Shanghai
tzdata/Zones/Australia:
tzdata/Zones/Pacific:
tzdata/Zones/Arctic:
tzdata/Zones/Europe:
tzdata/Zones/SystemV:
tzdata/Zones/Indian:
tzdata/Zones/Africa:
tzdata/Zones/US:
tzdata/Zones/Antarctica:
tzdata/Zones/Atlantic:
* tzdata/Zones/Etc: UTC
tzdata/Zones/America:
* tzdata/Areas: Asia
9、apt的配置文件
# apt-config --help
apt-config is a simple tool to read the APT config file.
用法:
apt-config [options] command
shell - Shell mode
dump - Show the configuration
查看当前配置
# apt-config dump
APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
......
可以在 /etc/apt/apt.conf 中设置新的默认选项。
debian包管理的更多相关文章
- debian、ubuntu:使用apt包管理器可能存在的问题! 让新手望而却步!
apt包管理器说好真好,说不好真不好. 最近在debian9.ubuntu18.04上安装oracle 10g 玩. 怎么都准备不好安装环境.原因就是i386构架体系的deb包总安装不正确! baid ...
- debian系统包管理工具aptitude
注意:aptitude与 apt-get 一样,是 Debian 及其衍生系统中功能极其强大的包管理工具.与 apt-get 不同的是,aptitude在处理依赖问题上更佳一些.举例来说,aptitu ...
- debian系统的另一个包管理器aptitude
最近在玩OPI的时候遇到了一个包因为各种依赖问题死活装不上.苦搜很久找到这个aptitude包管理器. 基于debain衍生的各种操作系统比较常用包管理器是apt,不过apt在遇到依赖问题的时候处理得 ...
- Node.js包管理器Yarn的入门介绍与安装
FAST, RELIABLE, AND SECURE DEPENDENCY MANAGEMENT. 就在昨天, Facebook 发布了新的 node.js 包管理器 Yarn 用以替代 npm .咱 ...
- Cygwin的包管理器:apt-cyg
参考<Cygwin的包管理器:apt-cyg> cygwin下安装每次需要启动set_up,比较蛋疼,还是debian的apt方便,在网上看到应该cygwin 下的apt,觉得不错. 从h ...
- [转]Ubuntu上的包管理:dpkg,apt和aptitude
一直以来对于ubuntu的包管理的概念就是apt-get,偶尔手动装个包就是dpkg -i,现在觉得是要系统地了解一下这几个包管理的命令. 原文转自: http://zhouliang.pro/201 ...
- linux 各种发行版及包管理器的关系
linux 各种发行版及包管理器的关系 Linux发行版列表 基于Kpkg(Debian 系) Debian GNU / Linux 及其派生发行版使用deb软件包格式,并使用dpkg及其前端作为包管 ...
- Ubuntu包管理命令 dpkg、apt和aptitude
起初GNU/Linux系统中仅仅有.tar.gz.用户 必须自己编译他们想使用的每个程序.在Debian出现之後,人们觉得有必要在系统 中加入一种机 制用来管理 安装在计算机上的软件包.人们将这套系统 ...
- 怎样安装pip--python的包管理工具
pip是python的包管理工具,使用它来安装python的模块很方便. pip支持的操作系统:Unix/Linux, OS X, and Windows. 支持的python版本号:2.6, 2.7 ...
随机推荐
- [C++]模板类和模板函数
参考: C++ 中模板使用详解 C++模板详解 概念 为了避免因重载函数定义不全面而带来的调用错误,引入了模板机制 定义 模板是C++支持参数化多态的工具,使用模板可以使用户为类或者函数声明一种一般模 ...
- Netty源码分析第5章(ByteBuf)---->第1节: AbstractByteBuf
Netty源码分析第五章: ByteBuf 概述: 熟悉Nio的小伙伴应该对jdk底层byteBuffer不会陌生, 也就是字节缓冲区, 主要用于对网络底层io进行读写, 当channel中有数据时, ...
- 使用NNI的scikit-learn以及Tensorflow分析
一.NNI简介 NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包. 它通过多种调优的算法来搜索最好的神经网络结构和(或)超参,并支持单机.本地 ...
- CentOS 7 Docker基本特性
Docker是一个开源的应用容器引擎,开发人员可以非常容易地打包已经开发好的应用,同时将应用相关的依赖包也打包到这样一个可移植的容器中,然后发布到任意的Linux主机系统上.Docker是基于Linu ...
- Python函数初识二
一.变量的作用域LEGB 1.1.变量的作用域 在Python中,程序的变量并不是在哪个位置都可以访问的,访问权限决定于这个变量是在哪里赋值的.变量的作用域决定了在哪一部分程序可以访问哪个特定的变量名 ...
- java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ObjectMapper
RabbitMq配置时常见错误 java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ObjectMapper <de ...
- ftp部署及使用
常用软件安装及使用目录 http://www.jb51.net/article/106604.htm ftp部署 本篇文章主要介绍了CentOS7.0下安装FTP服务的方法,小编觉得挺不错的,现在 ...
- js中模拟a标签的点击事件
var a = document.createElement('a'); a.target = "_blank"; a.href = "personal"; a ...
- Task 6.1 校友聊之NABCD模型分析
我们团队开发的一款软件是“校友聊”--一个在局域网内免流量进行文字.语音.视频聊天的软件.下面将对此进行NABCD的模型分析. N(Need需求):现如今,随着网络的迅速普及,手机和电脑已经成为每个大 ...
- 重学 以太网的mac协议的CSMA/CD
之前上课一直模糊的CSMA/CD进行系统性整理. CSMA/CD (Carrier Sense Multiple Acess/Collision Detect)应用在OSI的 数据链路层 在以太网中, ...