Faruque Ahmed : MCP, MCSA, MCSE, MCTS, MCIT, CCNA, OCA, OCP, GCP
Remove unnecessary packages.
# apt autoremove
(Optional) Remove apt cache.
# apt autoclean
sudo killall -9 mysql
sudo killall -9 mysqld
sudo deluser -f mysql
sudo apt remove --purge vlc
sudo apt purge vlc
sudo apt remove vlc
apt --fix-broken install
apt autoremove
dpkg --get-selections | grep hold
apt install mariadb-server mariadb-client
apt-get install -f
dpkg --configure -a
cat /etc/apt/sources.list
REMOVE Mariadb
sudo apt-get remove --purge mysql-server mysql-client mysql-commonsudo apt-get autoremovesudo apt-get autocleanTHIS WILL WIPE ALL YOUR EXISTING DATABASES -->> sudo rm -rf /var/lib/mysqlsudo rm -rf /etc/mysqlDPKG commands
There are two actions, they are dpkg-query and dpkg-deb.
Install a package
# sudo dpkg -i {package_name}
# sudo dpkg -i skype-ubuntu-precise_4.2.0.11-1_i386.deb
# sudo apt install ./opera-stable_105.0.4970.16_amd64.deb
Remove a package
# sudo dpkg -r {package_name}
# sudo dpkg -r vlc
Remove a package and its configuration files
# sudo dpkg -P {package_name}
# sudo dpkg -P vlc
List all installed packages.
You can pipe the command to less (a pager) so you can more easily scroll the content:
# dpkg -l | less
Check if the package is installed or not
# dpkg -l {package_name}
# dpkg -l vlc
Check if the package is installed or not, and if it is, launch it:
# dpkg -l | vlc
See whether a package is installed or not And this will show the location where the package will be installed. Here -S (capital S) to search whether the package was installed or not.
# sudo dpkg -S {package_name}
# sudo dpkg -S skype
Install a *.deb package from a specified location Here -R is recursive. (Recursively handle all regular files matching the pattern *.deb found at specified directories and all of its subdirectories).
# sudo dpkg -R --install {package_location}
# sudo dpkg -R --install /home/sysadmin/soft
Show package details
Here -p (lowercase p) will show the package info:
# dpkg -p {package_name}
# dpkg -p apache2
View the content of a package
Use -c (lowercase c) to show the content:
# sudo dpkg -c {package_name}
# sudo dpkg -c skype-ubuntu-precise_4.2.0.11-1_i386.deb
Extract the *.deb package file
Use -x (lowercase x) to extract:
# dpkg -x {package_name} {location_were_to_extract}
# dpkg -x libqt4-phonon_4.6.3-4+squeeze1_i386.deb /home/sysadmin/
Extract and display the filenames contained in a package
Use -X (uppercase X) to display the content with extraction.
# dpkg -X {package_name} {location_were_to_extract}
# dpkg -X libqt4-phonon_4.6.3-4+squeeze1_i386.deb /home/sysadmin/
Display information about a package
Here -I stands for information:
# dpkg -I {package_name}
# dpkg -I libqt4-phonon_4.6.3-4+squeeze1_i386.deb
Reconfigure an already installed package dpkg-reconfigure reconfigures packages after they already have been installed. Pass it the name(s) of a package or packages to reconfigure. It will ask configuration questions, much like when the package was first installed.
# dpkg-reconfigure postfix
# sudo dpkg-reconfigure tzdata
# sudo dpkg-reconfigure keyboard-configuration