dpkg --list
# show info for a package
- dpkg --status package_name
+ dpkg --status foobar
- # show files owned by a package
- dpkg --listfiles package_name
+ # show files owned by an installed package
+ dpkg --listfiles foobar
+
+ # show files owned by an uninstalled package
+ apt-file list foobar
+
+ # show which package owns a file
+ dpkg -S /usr/bin/foobar
+
+ # show which package will own a file
+ apt-file find /usr/bin/foobar
# resynchronize the package index files from their sources
apt-get update
## iptables
+ # so that firewall rules load at boot
+ apt-get install iptables-persistent
+ # edit rules
+ vim /etc/iptables/rules.v4
+ # reload rules
+ iptables-restore < /etc/iptables/rules.v4
+ # save rules
+ invoke-rc.d iptables-persistent save
+
+### Sample iptables firewall rules
+
+ root@server2:~# cat /etc/iptables/rules.v4
+ # Generated by iptables-save v1.4.21 on Wed Oct 14 22:17:08 2015
+ *filter
+ :INPUT ACCEPT [0:0]
+ :FORWARD ACCEPT [0:0]
+ :OUTPUT ACCEPT [72:34181]
+ -A INPUT -i lo -j ACCEPT
+ -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
+ -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
+ -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
+ -A INPUT -j DROP
+ COMMIT
+ # Completed on Wed Oct 14 22:17:08 2015
+ root@server2:~#
+
https://help.ubuntu.com/community/IptablesHowTo
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04
## Apache httpd
+Install Apache
+
sudo apt-get install apache2
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
+Restart Apache
+
+ systemctl reload apache2
+
+Enable site
+
+ a2ensite data.greptilian.com
+
+Show enabled sites
+
+ apache2ctl -S
+
## MySQL
sudo apt-get install mysql-server
https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial
+
+## Timezone
+
+ sudo timedatectl set-timezone America/New_York
+
+https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04
+
+## Grub
+
+On a new installation of Ubuntu 18.04 on Digital Ocean I ran `sudo apt-get dist-upgrade` and saw this message:
+
+"A new version of /boot/grub/menu.lst is available, but the version installed currently has been locally modified. What would you like to do about menu.lst?
+
+I selected the first option called "install the package maintainer's version" even though the second option called "keep the local version currently installed" was highlighted. Showing differences didn't work. I rebooted the server and it came back up. There's a related post at https://www.digitalocean.com/community/questions/ubuntu-new-boot-grub-menu-lst-after-apt-get-upgrade