pactool-linuxutils 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,402 @@
1
+ Metadata-Version: 2.4
2
+ Name: pactool-linuxutils
3
+ Version: 1.0.0
4
+ Summary: A versatile and powerful package management helper for Arch Linux and Debian-based distributions.
5
+ Home-page: https://github.com/LinuxUtils/pactool
6
+ Author: LinuxUtils
7
+ Author-email: thelinuxutils@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: requests
15
+ Requires-Dist: colorama
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ ![PACTOOL BANNER](https://github.com/LinuxUtils/paktool/blob/main/graphics/PACTOOL_BANNER.png?raw=true)
28
+
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/LinuxUtils/pactool/blob/main/LICENSE)
30
+ [![Latest Commit](https://img.shields.io/github/last-commit/LinuxUtils/pactool?color=blue&label=Last%20Commit)](https://github.com/LinuxUtils/pactool/commits/main)
31
+ [![Release](https://img.shields.io/github/v/release/LinuxUtils/pactool?color=green&label=Latest%20Release)](https://github.com/LinuxUtils/pactool/releases)
32
+ [![Issues](https://img.shields.io/github/issues/LinuxUtils/pactool?color=red&label=Open%20Issues)](https://github.com/LinuxUtils/pactool/issues)
33
+ [![Pull Requests](https://img.shields.io/github/issues-pr/LinuxUtils/pactool?label=Pull%20Requests)](https://github.com/LinuxUtils/pactool/pulls)
34
+ [![Repo Size](https://img.shields.io/github/repo-size/LinuxUtils/pactool?label=Repo%20Size)](https://github.com/LinuxUtils/pactool)
35
+ [![Code Size](https://img.shields.io/github/languages/code-size/LinuxUtils/pactool?label=Code%20Size)](https://github.com/LinuxUtils/pactool)
36
+ [![Top Language](https://img.shields.io/github/languages/top/LinuxUtils/pactool?color=yellow)](https://github.com/LinuxUtils/pactool)
37
+ [![Contributors](https://img.shields.io/github/contributors/LinuxUtils/pactool)](https://github.com/LinuxUtils/pactool/graphs/contributors)
38
+ [![Forks](https://img.shields.io/github/forks/LinuxUtils/pactool?style=social)](https://github.com/LinuxUtils/pactool/network/members)
39
+ [![Stars](https://img.shields.io/github/stars/LinuxUtils/pactool?style=social)](https://github.com/LinuxUtils/pactool/stargazers)
40
+ [![Watchers](https://img.shields.io/github/watchers/LinuxUtils/pactool?style=social)](https://github.com/LinuxUtils/pactool/watchers)
41
+ [![Downloads](https://img.shields.io/github/downloads/LinuxUtils/pactool/total?color=purple&label=Downloads)](https://github.com/LinuxUtils/pactool/releases)
42
+ [![Python Version](https://img.shields.io/badge/Python-3.8+-blue?logo=python)](https://www.python.org/)
43
+ [![OS](https://img.shields.io/badge/Supported-Arch%20%7C%20Debian%20%7C%20Ubuntu-orange)](https://github.com/LinuxUtils/pactool)
44
+
45
+
46
+ # What is Pactool?
47
+ #### PacTool is a versatile, simple, and powerful package management helper designed for **Arch Linux** and **Debian-based distributions**. It provides a clear and modern overview of all installed packages, their sizes, and dependencies, and offers various tools to optimize and maintain your system efficiently.
48
+
49
+ ---
50
+
51
+ ## **Features**
52
+ - **Cross-distro support** for Arch Linux, Manjaro, Debian, Ubuntu, and other derivatives.
53
+ - **Advanced package listing** with pagination, sorting (name, size, type), and filtering (user/system packages).
54
+ - Full **search, install, uninstall, update, and upgrade** commands.
55
+ - **Mirror management** with support for automatic backups and restores:
56
+ - Show current mirrors with latency checks and timestamps.
57
+ - Auto-update mirrors to the fastest available servers.
58
+ - Backup and revert mirrors using timestamped snapshots.
59
+ - **Dependency & reverse dependency tree** analysis via `--why PACKAGE`.
60
+ - **File ownership**: list all files installed by a package with `--files PACKAGE`.
61
+ - **Cache cleaning** with safe prompts.
62
+ - **Kernel utilities**:
63
+ - `--cleanup-kernels` for removing outdated kernels safely.
64
+ - `--backup-kernel` to backup the current kernel and initramfs.
65
+ - **Color-coded, human-friendly output** for better readability.
66
+ - Detailed **statistics** with `--stats` to understand package count, disk usage, and outdated software.
67
+ - **Interactive confirmations** for critical actions like upgrades, removals, or mirror changes.
68
+
69
+ ---
70
+
71
+ ## **Installation & Setup**
72
+
73
+ ### Run Directly
74
+ ```bash
75
+ python3 pactool.py --help
76
+ ```
77
+
78
+ ### Add Pactool to PATH (Global Install)
79
+ ```bash
80
+ sudo cp pactool.py /usr/local/bin/pactool
81
+ sudo chmod +x /usr/local/bin/pactool
82
+ ```
83
+
84
+ ### Requirements
85
+ - **Python 3.8+**
86
+ - `reflector` (Arch Linux) or `netselect-apt` (Debian/Ubuntu) for mirror management.
87
+ - Core package manager tools (`dpkg`, `apt`, or `pacman`) depending on your distro.
88
+ - `sudo` permissions for kernel or mirror-related operations.
89
+
90
+ ---
91
+
92
+ ## **Basic Usage**
93
+ ```bash
94
+ python3 pactool.py [COMMANDS] [OPTIONS]
95
+ ```
96
+
97
+ ### **Examples**
98
+ ```bash
99
+ # Show all installed packages
100
+ python3 pactool.py --list
101
+
102
+ # Show only 20 packages
103
+ python3 pactool.py --list -n 20
104
+
105
+ # Search for 'firefox'
106
+ python3 pactool.py --search firefox
107
+
108
+ # Install VLC
109
+ python3 pactool.py --install vlc
110
+
111
+ # Uninstall VLC
112
+ python3 pactool.py --uninstall vlc
113
+
114
+ # Update all packages
115
+ python3 pactool.py --update
116
+
117
+ # Upgrade system
118
+ python3 pactool.py --upgrade
119
+ ```
120
+
121
+ ---
122
+
123
+ ## **Package Management**
124
+
125
+ ### **List Packages**
126
+ Display installed packages with pagination and sorting:
127
+ ```bash
128
+ python3 pactool.py --list -n 30
129
+ ```
130
+ Sort by name:
131
+ ```bash
132
+ python3 pactool.py --list --sort name
133
+ ```
134
+ Reverse sort by size:
135
+ ```bash
136
+ python3 pactool.py --list --rsort size
137
+ ```
138
+
139
+ ### **Search Packages**
140
+ ```bash
141
+ python3 pactool.py --search vlc
142
+ ```
143
+
144
+ ### **Show Package Info**
145
+ ```bash
146
+ python3 pactool.py --info vlc
147
+ ```
148
+
149
+ ### **Check for Outdated Packages**
150
+ ```bash
151
+ python3 pactool.py --outdated
152
+ ```
153
+
154
+ ---
155
+
156
+ ## **Mirror Management**
157
+
158
+ ### **Show Current Mirrors**
159
+ Displays active mirrors with **response time** and **last updated**:
160
+ ```bash
161
+ python3 pactool.py --show-mirrors
162
+ ```
163
+ **Sample Output:**
164
+ ```
165
+ [✔] https://mirror.osbeck.com/archlinux/$repo/os/$arch 124.42 ms (Last Updated: Fri, 18 Jul 2025 14:38:24 GMT)
166
+ [✔] https://mirror.cyberbits.eu/archlinux/$repo/os/$arch 738.60 ms (Last Updated: Fri, 18 Jul 2025 13:30:26 GMT)
167
+ [✔] https://mirror.ubrco.de/archlinux/$repo/os/$arch 949.06 ms (Last Updated: N/A)
168
+ ```
169
+
170
+ ### **Update to Fastest Mirrors**
171
+ ```bash
172
+ python3 pactool.py --update-mirrors
173
+ ```
174
+
175
+ ### **Backup Mirrors**
176
+ ```bash
177
+ python3 pactool.py --backup-mirrors
178
+ ```
179
+ Backups stored in:
180
+ ```
181
+ ~/.cache/pactool/mirrors/
182
+ ```
183
+
184
+ ### **Revert Mirrors**
185
+ ```bash
186
+ python3 pactool.py --revert-mirrors
187
+ ```
188
+ **Example:**
189
+ ```
190
+ Available backups:
191
+ (1) Friday, 18 July 2025 at 05:42:54
192
+ (2) Friday, 18 July 2025 at 05:44:15
193
+
194
+ Which backup would you like? (ID) > 2
195
+ Reverted mirrors to 2025-07-18_05-44-15
196
+ ```
197
+
198
+ ---
199
+
200
+ ## **Kernel Management**
201
+ Pactool simplifies kernel management on Arch and Debian systems.
202
+
203
+ ### **Cleanup Old Kernels**
204
+ ```bash
205
+ python3 pactool.py --cleanup-kernels
206
+ ```
207
+ This removes outdated kernels while keeping the current version intact.
208
+
209
+ ### **Backup Current Kernel**
210
+ ```bash
211
+ python3 pactool.py --backup-kernel
212
+ ```
213
+ Backs up `vmlinuz`, `initramfs`, and optionally `System.map` to:
214
+ ```
215
+ /boot/pactool/backup/
216
+ ```
217
+
218
+ ---
219
+
220
+ ## **Advanced Commands**
221
+
222
+ ### **Reverse Dependency Tree**
223
+ ```bash
224
+ python3 pactool.py --why firefox
225
+ ```
226
+ **Output:**
227
+ ```
228
+ Reverse dependency tree for 'firefox':
229
+
230
+ firefox
231
+ └─ gnome-browser
232
+ └─ gnome-desktop
233
+ ```
234
+
235
+ ### **List Files Installed by a Package**
236
+ ```bash
237
+ python3 pactool.py --files vlc
238
+ ```
239
+ **Example:**
240
+ ```
241
+ Files installed by 'vlc':
242
+ /usr/bin/vlc
243
+ /usr/share/applications/vlc.desktop
244
+ /usr/share/icons/hicolor/48x48/apps/vlc.png
245
+ ```
246
+
247
+ ### **Clean Cache**
248
+ ```bash
249
+ python3 pactool.py --clean
250
+ ```
251
+ Cleans package cache and prompts before deleting.
252
+
253
+
254
+
255
+ ## **Security Management**
256
+
257
+ PacTool offers built-in tools to manage and check for security vulnerabilities.
258
+
259
+ ### **View Security Packages**
260
+ Check for installed security-related packages on Debian/Ubuntu or run a security audit on Arch Linux:
261
+ ```bash
262
+ python3 pactool.py --view-security-packages
263
+ ```
264
+ **Debian/Ubuntu Example Output:**
265
+ ```
266
+ Security Packages Installed (Debian/Ubuntu):
267
+ libssl1.1
268
+ libgnutls30
269
+ ```
270
+ **Arch Linux Example Output:**
271
+ ```
272
+ grub [High Risk] Affected by multiple issues.
273
+ libxml2 [High Risk] Affected by denial of service.
274
+ ```
275
+ Packages are **color-coded**:
276
+ - **Blue**: System packages.
277
+ - **Magenta**: User-installed packages.
278
+
279
+ ### **Upgrade Security Packages**
280
+ On Debian/Ubuntu systems, upgrade only security-related packages:
281
+ ```bash
282
+ python3 pactool.py --upgrade-security
283
+ ```
284
+ This ensures only security-related updates are applied.
285
+
286
+ ### **Check Security Vulnerabilities**
287
+ You can run a vulnerability check for any package using:
288
+ ```bash
289
+ python3 pactool.py --vuln-check PACKAGE
290
+ ```
291
+ Example:
292
+ ```
293
+ python3 pactool.py --vuln-check openssl
294
+ ```
295
+ This will list all known CVEs, paginate results, and allow keyword searching within CVEs.
296
+ \
297
+ \
298
+ You can also perform a deep search on a package
299
+ ```
300
+ python3 pactool.py --vuln-check feh --deep-search
301
+ ```
302
+
303
+ ---
304
+
305
+ ## **Command Overview**
306
+ ```
307
+ GENERAL COMMANDS:
308
+ --version Show Pactool version and exit
309
+ --about Display detailed information about Pactool
310
+
311
+ PACKAGE COMMANDS:
312
+ --list List installed packages (paged by default)
313
+ -n N Number of packages to show (0 = all)
314
+ --stats Show statistics about packages
315
+ --files PACKAGE List all files installed by a package
316
+ --search SEARCH Search for a package by name
317
+ --why PACKAGE Show reverse dependencies of a package
318
+ --uninstall PACKAGE Uninstall a package by name
319
+ --install PACKAGE Install a package by name
320
+ --update Update all installed packages
321
+ --upgrade Upgrade all installed packages
322
+ --clean Clean cached or unused package files
323
+ --sort CRITERIA name/size/install-date/update-date/type
324
+ --rsort CRITERIA Reverse sort by the same criteria
325
+ --user Show only user-installed packages
326
+ --system Show only system packages
327
+ --info PACKAGE Show detailed information about a package
328
+ --bloat Find unused optional dependencies (bloat)
329
+ --unused Find unused or orphaned packages
330
+ --outdated List all outdated packages
331
+
332
+ SERVICE COMMANDS:
333
+ --services Show status of services related to packages
334
+ --service-info SERVICE Show detailed info about a service
335
+ --service-logs SERVICE Show logs of a service
336
+
337
+ MIRROR COMMANDS:
338
+ --show-mirrors Show current mirrors with ping & last update
339
+ --update-mirrors Update to fastest mirrors
340
+ --revert-mirrors Revert mirrors to previous backup
341
+ --backup-mirrors Create a manual backup of the current mirror list
342
+
343
+ KERNEL COMMANDS:
344
+ --cleanup-kernels Automatically remove old kernels
345
+ --backup-kernel Backup the current running kernel to /boot/pactool/backup
346
+
347
+ SECURITY COMMANDS:
348
+ --upgrade-security Upgrade only security-related packages (Debian/Ubuntu)
349
+ --vuln-check PACKAGE Check known CVEs (vulnerabilities) for a package
350
+ --deep-search Use with --vuln-check for detailed exploit tree and history
351
+ --view-security-packages View all installed security packages with details
352
+ ```
353
+
354
+ ---
355
+
356
+ ## **Tips and Tricks**
357
+ - Use `--user` to list only user-installed packages.
358
+ - Combine `--list` with `--sort` for quick overviews of package size and type.
359
+ - Backup mirrors before performing major upgrades.
360
+ - Use `--why` to track down unnecessary package dependencies.
361
+ - Create a shell alias:
362
+ ```bash
363
+ alias pt='python3 /path/to/pactool.py'
364
+ ```
365
+
366
+ ---
367
+
368
+ ## **Troubleshooting**
369
+ **Q:** Pactool says `reflector` is missing.
370
+ **A:** Install it with:
371
+ ```bash
372
+ sudo pacman -S reflector
373
+ ```
374
+ For Debian-based systems, use:
375
+ ```bash
376
+ sudo apt install netselect-apt
377
+ ```
378
+
379
+ **Q:** Permission errors on mirror updates?
380
+ **A:** Run with `sudo` or `sudo -E`.
381
+
382
+ **Q:** Kernel backup fails with missing `vmlinuz`?
383
+ **A:** Ensure the kernel image path matches `/boot/vmlinuz-*`. Adjust `kernals.py` if needed.
384
+
385
+ ---
386
+
387
+ ## **Contributing**
388
+ We welcome contributions from developers, testers, and Linux enthusiasts. Steps:
389
+ 1. Fork this repository.
390
+ 2. Create a feature branch.
391
+ 3. Commit your changes.
392
+ 4. Submit a Pull Request.
393
+
394
+ **Ideas for contributions:**
395
+ - Add support for other package managers (e.g., zypper, dnf).
396
+ - Improve mirror ranking algorithms.
397
+ - Write tests for advanced features.
398
+
399
+ ---
400
+
401
+ ## **License**
402
+ MIT License - see LICENSE file.
@@ -0,0 +1,6 @@
1
+ pactool_linuxutils-1.0.0.dist-info/licenses/LICENSE,sha256=lqTU4ihezwR6-Fo3cFXjvtNgY2OAHS9NnGUtO1Wzzr4,1068
2
+ pactool_linuxutils-1.0.0.dist-info/METADATA,sha256=FRTQ-sfc433_VItmNqVP3TY5uxzQt8u6D039PZGyiD0,12892
3
+ pactool_linuxutils-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ pactool_linuxutils-1.0.0.dist-info/entry_points.txt,sha256=z5zsYB5kHvHRc5AO8uBGadceajh6J3FgPcT-aq9cB6Q,41
5
+ pactool_linuxutils-1.0.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
+ pactool_linuxutils-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pactool = pactool:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Linux Utils
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.