-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathdpkg.txt
158 lines (126 loc) · 3.45 KB
/
dpkg.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/sh
# Purpose : Testing script for dpkg support
# Author : Ky-Anh Huynh
# License : MIT
# FIXME: debian:squeeze It's unable to run `pacman -Sy`
im ubuntu:14.04 ubuntu:16.04 ubuntu:18.04 ubuntu:20.04 ubuntu
im debian:jessie debian:stretch debian:buster debian:bullseye
im debian_bash3
# Remove `docker-clean` because we need *.deb files under /var/cache
in ! rm -fv /etc/apt/apt.conf.d/docker-clean
ou ^removed .*docker-clean
in ! PACAPT_DEBUG=auto pacman
in ! if bash --version | grep -qs 'version 3'; then echo "Bash3-no-switching"; fi
ou (debug.*Switching to Bash shell)|(Bash3-no-switching)
in -P
ou available operations:.*( [Q][ ilos])+
# Update package databases
in -Sy
ou ^Get
ou ^Fetched
in -Sy --quiet --quiet
ou empty
in -Sy -qq
ou empty
# Simple query that lists all packages
in -Qq
ou ^apt$
# Listing with version and package name
in -Q
# ou ^ii +apt +.+ubuntu
ou ^ii +apt +
# List explicitly installed packages
in ! if [ "$(cat /etc/*-release | grep -E ^VERSION_CODENAME= | cut -d'=' -f2)" = "bullseye" ]; then pacman -S --noconfirm iproute2; fi
in -Qe
ou ^(iproute2|adduser)$
# Information of `apt`
in -Qi apt
ou ^Package: apt$
ou ^Status: install ok installed$
ou ^Priority: (important|required)$
# File listing for `apt`
in -Ql apt
ou ^/usr/bin/apt-key
# File listing (all packages)
# FIXME: Debian-squeeze doesn't have /usr/bin/apt
in -Ql
ou ^apt /usr/bin/apt-key$
# File listing (all packages), files only
in -Qql
ou ^/usr/bin/apt-key$
# Look up package name
in -Qo /bin/bash
ou ^bash: /bin/bash$
# On ubuntu:20.04, /usr/bin/bash is not part of the `bash` package
# (maybe it's a symlink/file created by installation process)
# hence the looking up would fail
in -Qo bash
ou ^bash: /bin/bash$
# Search for pattern in installed package (names + descriptions)
in -Qs bash
ou ^bash.+Bourne
in -Qs bourne
ou ^bash.+Bourne
in -Qs screen
ou empty
in -Qs 'Bourne Again'
ou ^bash.+Bourne
# Install and Deinstall a package
# Download without installation
in -Sw --noconfirm screen
in ! command -v screen || echo 'command not found'
ou command not found
# Display remote package information
in -Si screen
ou ^Package: screen
in -Sii screen
ou ^Reverse Depends:
# Get package changelog
in -Qc apt
ou ^(Get|Err).+ apt
# Now installation
# From ubuntu:20.04 it becomes /bin/screen =))
in -S --noconfirm screen
in ! command -v screen
ou ^(/usr)?/bin/screen
# Now remove the package
in -R --noconfirm screen
in -Qi screen
ou ^Status: deinstall
# Verify package files
in -Qk apt
ou requires 'debsums' but the tool is not found\.$
in -S --noconfirm debsums
in -Qk apt
ou /usr/bin/apt.+OK
ou /usr/bin/apt-get.+OK
in -Qk
ou /usr/bin/apt.+OK
in -R --noconfirm debsums
# Package groups
in -Sg
ou requires 'tasksel' but the tool is not found\.$
in -S --noconfirm tasksel
in -Sg
# debian*? -> web-server
# ubuntu(:(18.04|20.04))? -> ubuntu-desktop
# ubuntu:(14.04|16.04) -> manual
ou ^u (web-server|ubuntu-desktop|manual)
in ! if [ "$(cat /etc/*-release | grep -E ^ID= | cut -d'=' -f2)" = "ubuntu" ]; then pacman -Sg ubuntu-desktop; else pacman -Sg web-server; fi
ou ^(task-web-server|ubuntu-desktop)
in -R --noconfirm tasksel
# Query information from a .deb package
in ! export DEB_FILE=`find /var/cache/apt/ -type f -iname "screen*.deb"`
in -Qp $DEB_FILE
ou ^ Package: screen
# Clean up package databases
in -Sc
in clear
in -sS tmux
ou package/tmux
ou terminal multiplexer
# Strong cleaning up
in -Sccc
in clear
in -sS tmux
ou empty