1. MagicESP
  2. Ubuntu Server 18.04
  3. Ubuntu Server Package Management

Ubuntu Server Package Management

package update and upgrade

upgrade (no reboot required)

sudo apt update && sudo apt -y upgrade

dist-upgrade and autoremove (reboot required)

sudo apt update && sudo apt -y dist-upgrade && sudo apt -y autoremove

automatically download and install important updates (interactively)

sudo dpkg-reconfigure unattended-upgrades

search and install package

search package

apt search {{ packagename.value }}
apt search {{ packagename.value }} | less
apt search {{ packagename.value }} | grep {{ packagename.value }} | less
apt list {{ packagename.value }}

install package

sudo apt install {{ packagename.value }}
sudo apt install -y {{ packagename.value }}

reinstall half-installed package

sudo apt install --reinstall {{ packagename.value }}

which package do i installed

dpkg -l
dpkg -l | grep {{ packagename.value }}
dpkg -l | grep {{ packagename.value }} | less

remove package

sudo apt remove {{ packagename.value }}
sudo apt remove -y {{ packagename.value }}

purge package (also remove the config files)

sudo apt purge {{ packagename.value }}
sudo apt purge -y {{ packagename.value }}