mikuQ / miku

miku
GNU General Public License v3.0
2 stars 1 forks source link

dpkg&apt-Debian系/ubuntu/Kali/Deepin #64

Open mikuQ opened 2 months ago

mikuQ commented 2 months ago

dpkg

dpkg -i *.deb   #安装
dpkg -r <包名>    #卸载
dpkg -P <包名>    #卸载(包括配置文件)
dpkg -s <包名>    #查看软件是否已经安装
dpkg --info *.deb   #查看deb包信息

dpkg -l #列出所有已安装的软件
dpkg -L <包名>    #列出已安装的软件包含的文件
dpkg -S <文件>    #反查找文件所属的软件包

apt

apt install <软件包>   #安装软件包
apt remove <软件包>    #删除软件包
apt purge <软件包> #删除软件包及配置文件

apt search ^vim #搜索软件包
apt show <软件包>  #查看软件包详细信息

apt update  #更新软件包列表:/var/lib/apt/lists/
apt upgrade #升级所有软件包/不解决依赖
apt full-upgrade    #升级所有软件包/强制解决依赖
apt autoremove  #自动删除未被依赖的软件包

apt list    #列出所有软件包(包含仓库中未安装)/可配合wc统计软件包数量apt list | wc -l
apt list --installed    #仅列出已安装软件包
apt list --upgradable   #可升级软件包

Debian配置软件源

mikuQ commented 2 months ago

ubuntu的软件源文件/etc/apt/sources.list.d/ubuntu.sources

root@ubuntu:~# cat /etc/apt/sources.list.d/ubuntu.sources
Types: deb deb-src
URIs: http://cn.archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb deb-src
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
root@ubuntu:~#
mikuQ commented 2 months ago

apt反查命令由哪个软件包提供(未安装情况下)

root@ubuntu:~# apt-file search find | grep "bin/find$" findutils: /usr/bin/find

root@ubuntu:~# apt-file search wc | grep "bin/wc$" coreutils: /usr/bin/wc

root@ubuntu:~# apt-file search ip | grep "bin/ip$" iproute2: /bin/ip iproute2: /sbin/ip

root@ubuntu:~# apt-file search nmcli | grep "bin/nmcli$" network-manager: /usr/bin/nmcli

mikuQ commented 2 months ago

ubuntu-配置在线源