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 ...
随机推荐
- (转)Django配置数据库读写分离
转:https://blog.csdn.net/Ayhan_huang/article/details/78784486 转:http://www.cnblogs.com/dreamer-fish/p ...
- Scrum Meeting 10.24
成员 已完成任务 下一阶段任务 用时 徐越 阅读后端代码,了解服务器的概念,以及服务器和终端间的通信机制 学习服务器配置 4h 赵庶宏 阅读后端代码,了解服务器的概念,以及服务器和终端间的通信机制 阅 ...
- 20135316王剑桥 linux第四周课实验笔记
第三章 程序的机器级表示 3.1历史观点 Intel处理器的换代:8086——80286——i386——i486——Pentium——PentiumPro——PentiumII——PentiumIII ...
- 2018-2019-20172321 《Java软件结构与数据结构》第八周学习总结
2018-2019-20172321 <Java软件结构与数据结构>第八周学习总结 教材学习内容总结 第12章 优先队列与堆 一.概述 堆 堆的前提就是他首先是一个完全二叉树,其次就是满足 ...
- 奔跑吧DKY——团队Scrum冲刺阶段-Day 3
今日完成任务 各个成员今日完成的任务(如果完成的任务为开发或测试任务,需给出对应的Github代码签入记录截图:如果完成的任务为调研任务,需给出对应的调研总结博客链接:如果完成的任务为学习技术任务,需 ...
- Task 5.1 电梯调度程序需求调研报告
1.任务概述: 1.1任务背景:试想一下,石家庄铁道大学基础教学楼的电梯配置如下:大厦有18层, 4部电梯,很多乘客使用这些电梯的日常(旅客重量:平均70公斤最大120公斤,最小45公斤).其他常量数 ...
- 【搜索】POJ-3009 DFS+回溯
一.题目 Description On Planet MM-21, after their Olympic games this year, curling is getting popular. B ...
- java 对象和基本数据类型 “==”区别
“==”比较的是地址,牢记.1.对象.integer 是对象 Integer i1 = 20; Integer i2 = 20 ; System.out.println(i1 == i2); // t ...
- 二路归并排序java实现
二路归并排序:其核心思想时将问题一分为二,并递归调用一分为二方法,使问题分割到不能再分各的原子问题,然后再归并,从实现原子问题开始,层层向上归并,最终解决整体问题.即所谓“分而治之,万流归一” 二路归 ...
- 8th 对软件工程的理解(读构建之法有感)
对于任何一个学计算机的人来说,软件都不陌生,甚至于一个普通的朝九晚五的上班族,他的每日生活工作也都与软件有着密不可分的关系.然而,程序又是如何从一行行指尖留下的代码,机器存储的数据变成快捷高效的软件的 ...