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
13 dpkg --status package_name
15 # show files owned by a package
16 dpkg --listfiles package_name
18 # show which package owns a file
19 dpkg -S /usr/bin/pdftoppm
21 # show which package will own a file
22 apt-file find /usr/bin/convert
24 # resynchronize the package index files from their sources
27 # install the newest versions installed packages
30 # install packages that are "kept back"
33 # for clearing out unused linux-headers, for example
36 # search for packages with a given string (i.e. json)
39 ### `apt-get dist-upgrade`
41 "-y Assume Yes to all queries and do not prompt" is not recommended for `apt-get dist-upgrade`
43 http://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it
45 http://askubuntu.com/questions/81585/what-is-dist-upgrade-and-why-does-it-upgrade-more-than-upgrade
49 useradd -m myuser -s /bin/bash
51 https://help.ubuntu.com/community/AddUsersHowto
53 ## Shutdown and restart
59 ## Change default $EDITOR from nano to vim
61 update-alternatives --config editor
65 ## Give user sudo access
67 newuser ALL=(ALL:ALL) ALL
71 newuser ALL=NOPASSWD: ALL
73 https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps
77 # so that firewall rules load at boot
78 apt-get install iptables-persistent
80 vim /etc/iptables/rules.v4
82 iptables-restore < /etc/iptables/rules.v4
84 invoke-rc.d iptables-persistent save
86 ### Sample iptables firewall rules
88 root@server2:~# cat /etc/iptables/rules.v4
89 # Generated by iptables-save v1.4.21 on Wed Oct 14 22:17:08 2015
93 :OUTPUT ACCEPT [72:34181]
94 -A INPUT -i lo -j ACCEPT
95 -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
96 -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
97 -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
100 # Completed on Wed Oct 14 22:17:08 2015
103 https://help.ubuntu.com/community/IptablesHowTo
105 https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04
111 sudo apt-get install apache2
113 https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
117 systemctl reload apache2
121 a2ensite data.greptilian.com
129 sudo apt-get install mysql-server
131 https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial
135 sudo timedatectl set-timezone America/New_York
137 https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04
141 On a new installation of Ubuntu 18.04 on Digital Ocean I ran `sudo apt-get dist-upgrade` and saw this message:
143 "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?
145 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