- فرض کنید یک بسته را مد نظر دارید. مثلا rdesktop
- نمیدونید که این بسته بر روی سیستم نصب است یا نه و می خواهید این موضوع را متوجه شوید.
- همچنین می خواهید بدانید که چه نسخه ای از این بسته بر روی سیستم نصب است.
- برای این منظور :
# apt list rdesktop -a
- نکته: ممکن است از یک بسته، نسخههای مختلف درون مخزن موجود باشد. با استفاده از سویچ a- تمام نسخهها را مشاهده میکنیم. خروجی مشابه :
Listing... Done
rdesktop/stable,now 1.8.6-2 amd64 [installed]
- نکته: در دستور بالا میتوان از کارکتر ستاره نیز استفاده کرد. (در صورتی که نام کامل بسته را ندانیم)
- راهکار دیگر استفاده از سویچ show میباشد.
- این کار باعث میشود جزییات بیشتری از بسته نمایش داده شود.
- به عنوان مثال :
root@Buster:~# apt show lshw
Package: lshw
Version: 02.18.85-0.1
Priority: optional
Section: utils
Maintainer: Ghe Rivero <ghe@debian.org>
Installed-Size: 781 kB
Depends: libc6 (>= 2.27), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2)
Recommends: pciutils, usbutils
Homepage: https://github.com/lyonel/lshw
Tag: admin::hardware, hardware::detection, implemented-in::c++,
interface::commandline, interface::graphical, interface::x11,
role::program, scope::utility, use::viewing, works-with-format::html,
works-with-format::xml, works-with::text, x11::application
Download-Size: 254 kB
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian buster/main amd64 Packages
Description: information about hardware configuration
A small tool to provide detailed information on the hardware
configuration of the machine. It can report exact memory
configuration, firmware version, mainboard configuration, CPU version
and speed, cache configuration, bus speed, etc. on DMI-capable x86
systems, on some PowerPC machines (PowerMac G4 is known to work) and AMD64.
.
Information can be output in plain text, HTML or XML.
- نکته: به متن قرمز خروجی بالا توجه کنید. در صورتی که بسته بر روی سیستم نصب باشد، ظاهر میشود.
- نکته: همانند دستور قبل ، میتوان از سویچ a- استفاده نمود.
- راه کار بعدی استفاده از ابزار apt-cache به شکل زیر میباشد :
root@Buster:~# apt-cache policy rdesktop
rdesktop:
Installed: 1.8.6-2
Candidate: 1.8.6-2
Version table:
*** 1.8.6-2 500
500 http://deb.debian.org/debian buster/main amd64 Packages
100 /var/lib/dpkg/status
- تست شده بر روی ubuntu 18.04