25个有用的apt包管理命令
来源:互联网 发布:oracle数据库安装成功 编辑:程序博客网 时间:2024/05/22 14:20
原文地址:http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/
APT-CACHE – 5个基础命令
1 : 列出所有有效包名
$ apt-cache pkgnames
esseract-ocr-epopipenightdreams...apt-cache pkgnames |grep ext3 查找关键字ext3的包名 (精确到包名) == apt-cache pkgnames ext3
2 : 根据包名或详细查找软件
$ apt-cache search vsftpd
vsftpd - lightweight, efficient FTP server written for securityccze - A robust, modular log coloriseryasat - simple stupid audit tool...3 : 查看包详细信息
apt-cache show netcat
Package: netcatPriority: optionalSection: universe/net...4 : 查看包依赖
apt-cache showpkg vsftpd
Package: vsftpdVersions: 2.3.5-3ubuntu1 (/var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_binary-i386_Packages)...5 : 查看统计信息
apt-cache stats
Total package names: 51868 (1,037 k)Total package structures: 51868 (2,490 k)...
APT-GET – 20个基础命令
1 : 更新系统包
sudo apt-get update
[sudo] password for tecmint: Ign http://security.ubuntu.com quantal-security InRelease Get:1 http://security.ubuntu.com quantal-security Release.gpg [933 B] ...
2 : 升级软件包
sudo apt-get upgrade
Reading package lists... DoneBuilding dependency tree Reading state information... Done...然而,如果你想升级,不关心是否软件包将被添加或删除满足依赖关系,使用“系统升级”子命令。
sudo apt-get dist-upgrade
3 : 安装或升级的具体的包
sudo apt-get install netcat
Reading package lists... DoneBuilding dependency tree Reading state information... Done4 : 同时安装多个软件包
sudo apt-get install nethogs goaccess
Reading package lists... DoneBuilding dependency tree Reading state information... Done5 : 安装包时使用通配符
sudo apt-get install '*name*'
Wildcard Matches * 零个或者更多字符 ? 恰好一个字符[abcde] 恰好列举中的一个字符 [a-e] 恰好在所给范围中的一个字符[!abcde] 任何字符都不在列举中[!a-e] 任何字符都不在所给的范围中{debian,linux} 恰好在所给选项中的一整个单词
6 : 安装包时不升级
sudo apt-get install packageName --no-upgrade
Reading package lists... DoneBuilding dependency tree Reading state information... DoneSkipping vsftpd, it is already installed and upgrade is not set.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.7 : 更新特定包
sudo apt-get install packageName --only-upgrade
Reading package lists... DoneBuilding dependency tree Reading state information... Donevsftpd is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.8 : 安装特定版本包(使用=)
sudo apt-get install vsftpd=2.3.5-3ubuntu1
Reading package lists... DoneBuilding dependency tree Reading state information... Donevsftpd is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.9 : 删除包(不删除配置文件)
sudo apt-get remove vsftpd
[sudo] password for tecmint: Reading package lists... DoneBuilding dependency tree10 : 完全删除包(删除配置文件)
sudo apt-get purge vsftpd
Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages will be REMOVED:或者 同时使用
sudo apt-get remove --purge vsftpd11 : 释放空间,清除下载包
sudo apt-get clean12 : 下载只有源代码的包
sudo apt-get --download-only source vsftpd
Reading package lists... DoneBuilding dependency tree Reading state information... Done13 : 下载并解压源代码包
sudo apt-get source vsftpd
Reading package lists... DoneBuilding dependency tree Reading state information... DoneNeed to get 220 kB of source archives.14 : 下载 解压 编译包
sudo apt-get --compile source goaccess
[sudo] password for tecmint: Reading package lists... DoneBuilding dependency tree15 : 下载 不安装包
sudo apt-get download nethogs
Get:1 Downloading nethogs 0.8.0-1 [27.1 kB]Fetched 27.1 kB in 3s (7,506 B/s)16 : 查看包更新日志
sudo apt-get changelog vsftpd
vsftpd (2.3.5-3ubuntu1) quantal; urgency=low * Merge from Debian testing (LP: #1003644). Remaining changes: + debian/vsftpd.upstart: migrate vsftpd to upstart. + Add apport hook (LP: #513978):17 : 检查破损的依赖关系
sudo apt-get check
[sudo] password for tecmint: Reading package lists... DoneBuilding dependency tree18 : 搜索建立依赖关系
sudo apt-get build-dep netcat
The following NEW packages will be installed: debhelper dh-apparmor html2text po-debconf quilt0 upgraded, 5 newly installed, 0 to remove and 328 not upgraded.Need to get 1,219 kB of archives.19 : 自动清楚apt-get缓存
sudo apt-get autoclean
Reading package lists... DoneBuilding dependency tree Reading state information... Done20 : 自动删除安装包
sudo apt-get autoremove vsftpd
Reading package lists... DoneBuilding dependency tree Reading state information... Done
0 0
- 25个有用的apt包管理命令
- 25个有用的基础命令apt-get/apt-cache
- ubuntu包管理命令apt
- 管理Websphere的10个有用命令
- 管理Websphere的10个有用命令
- debian源码包管理的几个有用的命令
- apt-get 相关的几个有用命令
- debian包管理 apt dpkg命令
- debian包管理命令dpkg apt-get apt-cache aptitude
- 管理Websphere的10个很有用的命令
- 比起Fedora来Ubuntu的apt(dpkg)包管理就是个垃圾
- Yum\Apt\Emerge和PortsLinux包管理系统的命令对照
- Ubuntu/Debian包管理命令大全(apt & dpkg)
- [转载]Ubuntu/Debian包管理命令大全(apt & dpkg)
- Ubuntu包管理命令 dpkg、apt和aptitude
- 转载 sudo apt-get 和 dpkg 包管理命令总结
- Ubuntu包管理命令 dpkg、apt和aptitude
- ubuntu包管理命令apt和dpkg总结
- 使用C#格式化字符串
- POJ - 3667 Hotel(线段树)
- Android实现ListView过滤功能,继承于BaseAdapter,非ArrayAdapter。
- android 广播
- 通过itunes store向iOS设备安装测试版(未上线)的程序
- 25个有用的apt包管理命令
- 13周课后自主-项目一-(3)还是基本的数组
- iterator标签
- Python 列表
- [C++]C++ 第一章
- UFLDL Exercise:Softmax Regression
- 一个很难很难解决的问题:在linux下编译arm嵌入式的qt时加入opengl es1 选项就会编译不过
- 尝试读取或写入受保护的内存。这通常指示其他内存已损坏 ,新中二代身份证读取 Syn_ReadMsg,Syn_R
- 深度学习 Deep LearningUFLDL 最新Tutorial 学习笔记 2:Logistic Regression