The dpkg command is a package management tool used to install, remove and update packages on Ubuntu or Debian Linux distributions. It allows for the installation of individual packages from the local repository without requiring an internet connection. To install a deb package in Ubuntu or Debian using the dpkg -i command option:
1. Open your terminal by pressing Ctrl + Alt + T on your keyboard. 2. Navigate to the directory where the .deb file is located (or use sudo apt-get install
# This script uses the dpkg -i command option to install a .deb package on Ubuntu or Debian.
# It assumes that the .deb file is located in the current directory.
# Open the terminal by pressing Ctrl + Alt + T on your keyboard.
# Navigate to the directory where the .deb file is located.
# If you have an internet connection, you can also use sudo apt-get install <package_name> to install the package directly.
# Run the following command in your terminal:
sudo dpkg -i package_name.deb
# The sudo command allows the user to run the following command with root privileges.
# The dpkg command is used to install, remove, and manage Debian packages.
# The -i option specifies that the package should be installed.
# package_name.deb is the name of the .deb file that will be installed.
Replace “package_name” with the name of the .deb file you want to install (without the .deb extension). For example, if you downloaded VLC player from the official website and saved it as vlc-3.0.12-1~deb9u1_amd64.deb in your Downloads folder, run:
# This script installs a .deb file using the dpkg command
# Replace "package_name" with the name of the .deb file you want to install (without the .deb extension)
# For example, if you downloaded VLC player from the official website and saved it as vlc-3.0.12-1~deb9u1_amd64.deb in your Downloads folder, run:
# The following command uses sudo to run dpkg with root privileges, allowing it to install the .deb file
sudo dpkg -i ~/Downloads/vlc-3.0.12-1~deb9u1_amd64.deb
# The -i flag tells dpkg to install the specified .deb file
# The ~/Downloads/ part of the command specifies the path to the .deb file, in this case it is in the Downloads folder in the user's home directory
# The vlc-3.0.12-1~deb9u1_amd64.deb is the name of the .deb file that will be installed
# The sudo command is used to run the dpkg command with root privileges, as installing packages requires administrative permissions
# The tilde (~) symbol is a shortcut for the user's home directory, so ~/Downloads/ is equivalent to /home/username/Downloads/
This will install the VLC player on your system. To uninstall a package using the dpkg command, run:
# This line uses the sudo command to run the following command as a superuser, allowing for system changes.
sudo dpkg -r package_name # This line uses the dpkg command to remove a package from the system.
# The -r flag specifies that the package should be removed.
# package_name should be replaced with the actual name of the package to be removed.
Replace “package_name” with the name of the package you want to remove (without any spaces). For example, if you installed VLC player earlier and now want to uninstall it, run:
# This script removes a package from the system using the dpkg command.
# Replace "package_name" with the name of the package you want to remove (without any spaces).
# For example, if you installed VLC player earlier and now want to uninstall it, run:
sudo dpkg -r vlc # "sudo" allows the command to be run with root privileges, "-r" specifies that the package should be removed, "vlc" is the name of the package to be removed.
This will remove the VLC player from your system. To update all packages on your local repository using the dpkg –update-avail option, run:
# This script removes the VLC player from the system and updates all packages on the local repository using the dpkg --update-avail option.
# Use sudo to run the command with root privileges.
sudo dpkg --remove vlc
# Use the --update-avail option to update all packages on the local repository.
sudo dpkg --update-avail
This will check for any updates available online and download them to your local repository. Note that this command does not automatically install or remove any packages it simply updates the list of available packages on your system. To see a complete list of options for the dpkg command, run:
# This command will open the manual page for the dpkg command, providing information on its usage and options.
man dpkg
# The following command will update the list of available packages on the system, but will not automatically install or remove any packages.
dpkg --update
# This command will check for any updates available online and download them to the local repository.
dpkg --download-only
# The following command will install a specific package from the local repository.
dpkg --install <package_name>
# This command will remove a specific package from the system.
dpkg --remove <package_name>
# The following command will list all installed packages on the system.
dpkg --list
# This command will display the version of a specific package.
dpkg --version <package_name>
This will open the man page for the dpkg command in your default text editor (usually nano or less). From there, you can scroll through the documentation and learn more about how to use this powerful package management tool.