Debian Logo Image

List Installed Packages on Debian

Read in 3 minutes   last updated 

by Linuxize

 

Apt is a command-line interface for the package management system and combines the most commonly used functionalities from apt-get and apt-cache including option to list installed packages.

To lists all packages installed on your system run the following command:

sudo apt list --installed adduser/stable,now 3.115 all [installed]
apt/stable,now 1.4.8 amd64 [installed]
apt-listchanges/stable,now 3.10 all [installed]
apt-utils/stable,now 1.4.8 amd64 [installed]
autoconf/stable,now 2.69-10 all [installed]
automake/stable,now 1:1.15-6 all [installed]
autotools-dev/stable,now 20161112.1 all [installed,automatic]
base-files/stable,now 9.9+deb9u5 amd64 [installed]
base-passwd/stable,now 3.5.43 amd64 [installed]
bash/stable,now 4.4-5 amd64 [installed]

The command will display a list of all installed packages including information about the packages versions and architecture. The rightmost column in the output shows whether the package was automatically installed as dependency of another package.

Since the packages list is long it is a good idea to pipe the output to the less command to make it easier to read:

sudo apt list --installed | less

To find out whether a specific package is installed use the grep command to filter the output. For example to find whether the tmux package is installed on the system you can use:

sudo apt list --installed | grep tmux tmux/stable,now 2.3-4 amd64 [installed] The output above shows that you have screen tmux 2.3-4 installed on your system.

List Installed Packages with dpkg-query

dpkg-query is a command line that can be used to display information about packages listed in the dpkg database.

To get a list of all installed packages type:

sudo dpkg-query -l | less
Computer architecture

The command will display a list of all installed packages including the packages versions, architecture and short description.

You can filter the dpkg-query -l output using the grep command:

sudo dpkg-query -l | grep package_name_to_search

Create a List of all Installed Packages

The following command will store the list of all installed packages on your Debian system to a file called packages_list.txt:

sudo dpkg-query -f '${binary:Package}n' -W > packages_list.txt

Now that you have the list, you can install the same packages on your new server with:

sudo xargs -a packages_list.txt apt install

Count the Number of Installed Packages

To find out how many packages are installed on your system you can use the same command as when creating a packages list but instead of redirecting the output to a file you can pipe it to the wc command to count the lines:

sudo dpkg-query -f '${binary:Package}n' -W | wc -l

The output will show the number of the installed packages:

466
Read More

Apt-get Add Repository

Debian Apt, Debian Linux, Debian Or Ubuntu, Debian Packages, Debian Ubuntu

Ubuntu

Encrypt USB Drive on Ubuntu

Encryption is the best way to protect your important documents personal info and other credentials. Suppose, you have a USB pen drive and your all important data stored on it. In case you will lose your USB pen drive, all data stored on it will be lost. It will be in hands of some other person which will access your personal information and misuse it. So, the best solution to protect your data is to encrypt your USB pen drive with password.

Requirements

  • Ubuntu 18.04 desktop installed on your system.
  • A non-root user with sudo privileges.

Install Required Tools

First, you will need to install gnome-disk-utility and cryptsetup to your system. Cryptsetup is a utility for setting up encrypted filesystems with the help of Device Mapper and dm-crypt. You can install both tools with the following command:

sudo apt-get install gnome-disk-utility cryptsetup -y

Encrypt USB Drive

IMPORTANT: Before you proceed, back up all data that is on the USB Media as the data on the USB Media gets erased when the partition type is changed to an encrypted partition.

First, plug in your USB flash drive to the system. Next, launch the Disks utility from the Unity Dash. You should see USB drive in the left pane:

Search for disks

Ubuntu Disk Manager

Next, umount the filesystem as shown below:

Unmount the Filesystem

Next, click on the Format button as shown below:

Select Format

Next, select encryption typepartition name and set your password as shown below:

Set Partition type and password

Now, click on the Format button to encrypt the USB drive.

Access USB Drive

Your USB pen drive is now secure with a password. To test it, unplug and plug in USB drive again. You should be asked to input password to get access the partition as shown below:

Enter Password to access USB device

Now, provide the password and click on the Connect button. You can access your USB pen drive.

Encrypted USB drive has been mounted.

 

Read More

 

Easy Encrypt Usb Drive, Easy Way To Encrypt Usb Drive, Encrypt Entire Usb Drive, Encrypt Usb Drive, Encrypt Usb Drive On Linux, Encrypt Usb Drive Ubuntu, How To Encrypt Usb Drive In Ubuntu