1.修改软件源
修改/etc/apt/sources.list
即可,更换软件源后应使用apt-get update
命令更新软件列表。
常用软件源:阿里巴巴开源镜像站 、 清华大学开源软件镜像站
2.安装软件
sudo apt-get install <软件包名>
软件包名一般为软件名,也可使用sudo apt-cache search <关键字>
模糊搜索。
若提示“
不能理解命令行选项g来自get与其他选项的搭配
”,可以尝试将apt -get
替换为apt
3.查看apt
帮助信息apt-get --help
# 删除软件及其配置文件
apt-get --purge remove <package>
# 删除没用的依赖包
apt-get autoremove <package>
# 此时dpkg的列表中有“rc”状态的软件包,可以执行如下命令做最后清理:
dpkg -l | grep ^rc | awk '{print $2}' | sudo xargs dpkg -P
apt 2.0.6 (amd64)
Usage: apt-get [options] command
apt-get [options] install|remove pkg1 [pkg2 ...]
apt-get [options] source pkg1 [pkg2 ...]
apt-get is a command line interface for retrieval of packages
and information about them from authenticated sources and
for installation, upgrade and removal of packages together
with their dependencies.
Most used commands:
update - Retrieve new lists of packages
upgrade - Perform an upgrade
install - Install new packages (pkg is libc6 not libc6.deb)
reinstall - Reinstall packages (pkg is libc6 not libc6.deb)
remove - Remove packages
purge - Remove packages and config files
autoremove - Remove automatically all unused packages
dist-upgrade - Distribution upgrade, see apt-get(8)
dselect-upgrade - Follow dselect selections
build-dep - Configure build-dependencies for source packages
satisfy - Satisfy dependency strings
clean - Erase downloaded archive files
autoclean - Erase old downloaded archive files
check - Verify that there are no broken dependencies
source - Download source archives
download - Download the binary package into the current directory
changelog - Download and display the changelog for the given package
See apt-get(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
This APT has Super Cow Powers.