5 https://help.ubuntu.com/community/AptGet/Howto
7 [Ubuntu comparison of apt-get vs. yum commands](https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora)
9 # show installed packages
12 # show info for a package
15 # show files owned by an installed package
16 dpkg --listfiles foobar
18 # show files owned by an uninstalled package
21 # show which package owns a file
22 dpkg -S /usr/bin/foobar
24 # show which package will own a file
25 apt-file find /usr/bin/foobar
27 # resynchronize the package index files from their sources
30 # install the newest versions installed packages
33 # install packages that are "kept back"
36 # for clearing out unused linux-headers, for example
39 # search for packages with a given string (i.e. json)
42 ### `apt-get dist-upgrade`
44 "-y Assume Yes to all queries and do not prompt" is not recommended for `apt-get dist-upgrade`
46 http://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it
48 http://askubuntu.com/questions/81585/what-is-dist-upgrade-and-why-does-it-upgrade-more-than-upgrade
52 useradd -m myuser -s /bin/bash
54 https://help.ubuntu.com/community/AddUsersHowto
56 ## Shutdown and restart
62 ## Change default $EDITOR from nano to vim
64 update-alternatives --config editor
68 ## Give user sudo access
70 newuser ALL=(ALL:ALL) ALL
74 newuser ALL=NOPASSWD: ALL
76 https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps
80 # so that firewall rules load at boot
81 apt-get install iptables-persistent
83 vim /etc/iptables/rules.v4
85 iptables-restore < /etc/iptables/rules.v4
87 invoke-rc.d iptables-persistent save
89 ### Sample iptables firewall rules
91 root@server2:~# cat /etc/iptables/rules.v4
92 # Generated by iptables-save v1.4.21 on Wed Oct 14 22:17:08 2015
96 :OUTPUT ACCEPT [72:34181]
97 -A INPUT -i lo -j ACCEPT
98 -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
99 -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
100 -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
103 # Completed on Wed Oct 14 22:17:08 2015
106 https://help.ubuntu.com/community/IptablesHowTo
108 https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04
114 sudo apt-get install apache2
116 https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
120 systemctl reload apache2
124 a2ensite data.greptilian.com
132 sudo apt-get install mysql-server
134 https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial
138 sudo timedatectl set-timezone America/New_York
140 https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04
144 On a new installation of Ubuntu 18.04 on Digital Ocean I ran `sudo apt-get dist-upgrade` and saw this message:
146 "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?
148 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