Linux/Ubuntu

Ubuntu
Ubuntu - Wikipedia

Download
14.04 LTS: http://releases.ubuntu.com/14.04/

16.04 LTS: http://releases.ubuntu.com/16.04/

Architectures
"The desktop version of Ubuntu currently supports the Intel x86 and the AMD64 architectures. Some server releases also support the SPARC architecture in addition to Intel x86 and AMD64. Unofficial support is available for the PowerPC, IA-64 (Itanium) and PlayStation 3 architectures." 

Releases
Source: Ubuntu - Wikipedia

apt
See apt

Disable SSH Banner
http://i.stack.imgur.com/Xbu4L.png

For single user: touch ~/.hushlogin

For all users, edit /etc/pam.d/sshd and comment out: session   optional     pam_motd.so  motd=/run/motd.dynamic noupdate session   optional     pam_motd.so # [1]

References:
 * command line - How can I disable/modify the SSH login banner for a given user? - Ask Ubuntu - http://askubuntu.com/questions/32800/how-can-i-disable-modify-the-ssh-login-banner-for-a-given-user

Services
List services: service --status-all initctl list initctl show-config

Status service: service [service] status

Start service: service [service] start

Stop service: service [service] stop

Restart service: service [service] restart

Remove service: update-rc.d -f [service] remove

Add service: update-rc.d [service] defaults

Current run level: runlevel

Specify service priorities: update-rc.d [service] defaults [START] [KILL] update-rc.d apache2 defaults 90 90 update-rc.d mysql defaults 10 10 update-rc.d apache2 defaults 90 # 90 for both

Fully configure: update-rc.d apache2 start 10 2 3 4 5. stop 90 0 1 6.

References:
 * update-rc.d Cheat Sheet | JamesCoyle.net - http://www.jamescoyle.net/cheat-sheets/791-update-rc-d-cheat-sheet

motd
Message of the Day: /etc/motd

Most of the noise comes from here: /etc/update-motd.d/*

Disable noise: mkdir /etc/update-motd.d/DISABLED mv /etc/update-motd.d/* /etc/update-motd.d/DISABLED/

ufw
Enable firewall: sudo ufw enable

Disable firewall: sudo ufw disable

Show rules: sudo ufw status sudo ufw status numbered  # rule numbers sudo ufw status verbose   # with port numbers

Allow traffic: sudo ufw allow 22/tcp # SSH sudo ufw allow 53/tcp

Disallow traffic sudo ufw deny 53/tcp

Delete rule: sudo ufw delete allow 53/tcp sudo ufw delete 1   # rules from 'status numbered'

Rules are written to: /lib/ufw/user.rules

References:
 * UFW - Community Help Wiki - https://help.ubuntu.com/community/UFW

UFW Applications
/etc/ufw/applications.d/apache [Apache] title=Web Server description=Apache v2 is the next generation of the omnipresent Apache web server. ports=80/tcp

[Apache Secure] title=Web Server (HTTPS) description=Apache v2 is the next generation of the omnipresent Apache web server. ports=443/tcp

[Apache Full] title=Web Server (HTTP,HTTPS) description=Apache v2 is the next generation of the omnipresent Apache web server. ports=80,443/tcp

/etc/ufw/applications.d/terraria [Terraria] title=Terraria Server description=Terraria Server ports=7777/tcp

Make sure the application rule is not group writable: chmod 644 [RULE_FILE]

List applications: ufw app list

Application info: ufw app info [APP]

Allow: ufw allow Apache ufw allow terraria

Disable Logging
To stop UFW from logging to dmesg, disable logging completely: sudo ufw logging off

rsyslog
Not logging to /var/log/syslog

Check the file permissions chown syslog /var/log/syslog * service rsyslog restart

Run rsyslog in debug mode: rsyslogd -c3 -dn

Ubuntu apt sources
Tip: search google for "ubuntu sources.list generator"

Primary repositories: http://archive.ubuntu.com/ubuntu/dists/ http://security.ubuntu.com/ubuntu/dists/

Example 12.04 LTS (with sub repo branches, including universe) deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe deb http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe

Example 12.04 LTS (with sub repo branches, including universe separated) deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted

deb http://us.archive.ubuntu.com/ubuntu/ precise universe deb http://us.archive.ubuntu.com/ubuntu/ precise-security universe deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe

Example 12.04 LTS default server install: (fio-benchmark vm) deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise universe deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu precise-security main restricted deb-src http://security.ubuntu.com/ubuntu precise-security main restricted deb http://security.ubuntu.com/ubuntu precise-security universe deb-src http://security.ubuntu.com/ubuntu precise-security universe deb http://security.ubuntu.com/ubuntu precise-security multiverse deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise universe deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu precise-security main restricted deb http://security.ubuntu.com/ubuntu precise-security universe deb http://security.ubuntu.com/ubuntu precise-security multiverse
 * 1) or without source repos

Reference:
 * Ubuntu sources.list (Feisty) « Tuxicity’s source
 * Repositories Using the Command Line - Community Ubuntu Documentation
 * Repositories - Community Ubuntu Documentation

sources.list generator
Tip: search google for "ubuntu sources.list generator"

Ubuntu Sources List Generator - http://repogen.simplylinux.ch/

Repository Components
The repository components are:


 * Main - Officially supported software.
 * Restricted - Supported software that is not available under a completely free license.
 * Universe - Community maintained software, i.e. not officially supported software.
 * Multiverse - Software that is not free.

The Ubuntu Install CDs contain software from the "Main" and "Restricted" components of the repositories.

References:
 * Repositories/Ubuntu - Community Ubuntu Documentation - https://help.ubuntu.com/community/Repositories/Ubuntu

Networking
Network configuration folder: /etc/network/

Interfaces file: /etc/network/interfaces

Local loopback address: auto lo iface lo inet loopback

DHCP Address: auto eth0 iface eth0 inet dhcp

Static Address: auto eth0 iface eth0 inet static address 192.168.1.5 netmask 255.255.255.0 gateway 192.168.1.254

---

Manually Configured Interface - not ifup (by external application) auto eth0 iface eth0 inet manual

Note: The 'auto' line or lines indicates which interfaces should be brought up with 'ifup -a'. 

Another way to configure: auto lo eth0 eth1

iface lo inet loopback

iface eth0 inet dhcp

iface eth1 inet static address 192.168.1.5 netmask 255.255.255.0

References:
 * /etc/network/interfaces Ubuntu Linux networking example - http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/

---

auto lo iface lo inet loopback

iface eth0 inet dhcp hwaddress ether 36:f2:3b:e2:4f:2d auto eth0

Hostname
Change hostname hostname [newhostname] ; hostname > /etc/hostname

Should also update /etc/hosts for consistency

---

Edit /etc/hostname

Run sudo /etc/init.d/hostname.sh start service hostname start
 * 1) or (depending on system)

PXE Install
Get netboot image from http://cdimage.ubuntu.com/netboot/ mkdir -p /tftpboot/pxe/images/ubuntu cd /tftpboot/pxe/images/ubuntu wget http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/netboot.tar.gz tar -zvxf netboot.tar.gz cp ubuntu-installer/amd64/linux. cp ubuntu-installer/amd64/initrd.gz.

Tools:
 * system-config-kickstart - graphical tool for creating Kickstart files

apt-get install system-config-kickstart

References:
 * PXEInstallServer - Community Ubuntu Documentation - https://help.ubuntu.com/community/PXEInstallServer
 * [ubuntu] A question for kickstart.About Package Selection! [Archive] - Ubuntu Forums - http://ubuntuforums.org/archive/index.php/t-900878.html
 * Kick Start, Kickstart Linux, Red Hat / Ubuntu KickStart - http://www.linuxarticles.org/2010/10/linux-kickstart-file-generator/
 * Automated Remote Installs of Ubuntu using Kickstart - http://www.linuxquestions.org/questions/linux-newbie-8/automated-remote-installs-of-ubuntu-using-kickstart-802660/
 * PXEInstallMultiDistro - Community Ubuntu Documentation - https://help.ubuntu.com/community/PXEInstallMultiDistro

---

My kickstart: install text

url --url http://repo.int.fusionio.com/ubuntu/ubuntu
 * 1) url --url http://uefi.int.fusionio.com/ubuntu/

lang en_US langsupport en_US keyboard us timezone America/Denver

rootpw password1 user fio --fullname "fio" --password password1
 * 1) rootpw --disabled
 * 1) user karl --fullname "karl" --iscrypted --password $1$tNU2BbnT$VX/2/60.GsgAoM6LEl8qs1
 * 1) asking about weak passwords for both root and fio

auth --useshadow --enablemd5 firewall --disabled

skipx


 * 1) bootloader --location=mbr
 * 2) zerombr yes
 * 3) clearpart --all --initlabel

reboot

%packages openssh-server

%pre echo "pre" > pre.txt

%post echo "post" > post.txt

Sample kickstart:
 * 1) Generated by Kickstart Configurator
 * 2) platform=x86

lang en_US langsupport en_US keyboard us mouse timezone America/New_York rootpw --disabled user karl --fullname "karl" --iscrypted --password $1$tNU2BbnT$VX/2/60.GsgAoM6LEl8qs1 reboot text install cdrom bootloader --location=mbr zerombr yes clearpart --all --initlabel auth --useshadow --enablemd5 firewall --disabled skipx %packages @ ubuntu-desktop ftp openssh-server bsdmainutils emacs21-common emacs21-bin-common libungif4g xaw3dg emacs21 emacsen-common liblockfile1 libapr0 chess binutils gcc-4.0
 * 1) System language
 * 1) Language modules to install
 * 1) System keyboard
 * 1) System mouse
 * 1) System timezone
 * 1) Root password
 * 1) Initial user
 * 1) Reboot after installation
 * 1) Use text mode install
 * 1) Install OS instead of upgrade
 * 1) Use CDROM installation media
 * 1) System bootloader configuration
 * 1) Clear the Master Boot Record
 * 1) Partition clearing information
 * 1) System authorization infomation
 * 1) Firewall configuration
 * 1) Do not configure the X Window System
 * 1) Package install information

My Kickstart Generated by Kickstart Configurator
 * 1) Generated by Kickstart Configurator
 * 2) platform=AMD64 or Intel EM64T

lang en_US langsupport en_US keyboard us mouse timezone --utc America/Denver rootpw password1 user fio --fullname "fio" --password password1 reboot text install url --url http://uefi.int.fusionio.com/uefi bootloader --location=mbr zerombr yes clearpart --all --initlabel part /boot --fstype ext3 --size 100 part swap --size 1024 part / --fstype ext4 --size 1 --grow auth --useshadow  --enablemd5 network --bootproto=dhcp --device=eth0 firewall --disabled skipx %pre --interpreter=python test %post --nochroot --interpreter=perl test
 * 1) System language
 * 1) Language modules to install
 * 1) System keyboard
 * 1) System mouse
 * 1) System timezone
 * 1) Root password
 * 1) Initial user
 * 1) Reboot after installation
 * 1) Use text mode install
 * 1) Install OS instead of upgrade
 * 1) Use Web installation
 * 1) System bootloader configuration
 * 1) Clear the Master Boot Record
 * 1) Partition clearing information
 * 1) Disk partitioning information
 * 1) System authorization infomation
 * 1) Network information
 * 1) Firewall configuration
 * 1) Do not configure the X Window System

Upstart
Start/Stop/Restart/Status service: /etc/init.d/[service] [start|stop|restart|status] service [service] start service [service] stop service [service] restart service [service] status List services: ls /etc/init.d service --status-all

Add/remove service: update-rc.d [service] defaults update-rc.d [service] remove update-rc.d [service] start 20 2 3 4 5. update-rc.d [service] start 20 2 3 4 5. stop 20 0 1 6. update-rc.d [service] stop 45 S.

References:
 * UbuntuBootupHowto - Community Ubuntu Documentation - https://help.ubuntu.com/community/UbuntuBootupHowto
 * Ubuntu Manpage: update-rc.d - install and remove System-V style init script links - http://manpages.ubuntu.com/manpages/hardy/man8/update-rc.d.8.html
 * Upstart Intro, Cookbook and Best Practises - http://upstart.ubuntu.com/cookbook/

Driver Disk
Ubiquity/DriverUpdates - Ubuntu Wiki - https://wiki.ubuntu.com/Ubiquity/DriverUpdates

Partner Linux Driver Process - http://www.novell.com/developer/partner_linux_driver_process.html

Provide driver on removable media during installation? - Ask Ubuntu - http://askubuntu.com/questions/6499/provide-driver-on-removable-media-during-installation

"Alternatively, if you want a quick and dirty solution and assuming this is a disk driver, put the kernel module in one of the following directories:" /lib/modules/*/kernel/drivers/ide /lib/modules/*/kernel/drivers/scsi /lib/modules/*/kernel/drivers/block

Gnome Desktop
Install: apt-get install x-window-system-core apt-get install gnome apt-get install xterm reboot

Repair: apt-get install --reinstall ubuntu-desktop

Ubuntu Desktop
Repair: apt-get install --reinstall ubuntu-desktop

Auto Login
sudo mkdir /etc/lightdm/lightdm.conf.d cat > /etc/lightdm/lightdm.conf.d/50-myconfig.conf << "EOF" [SeatDefaults] autologin-user=USERNAME EOF

Ref: https://help.ubuntu.com/community/AutoLogin

OR

System Settings > User Accounts

https://i.stack.imgur.com/xCOz0.png

Release Upgrade
Major release upgrade: (eg. Karmic Koala to Lucid Lynx) sudo do-release-upgrade

I used this to successfully upgrade a Karmic Koala (9.10) to Lucid Lynx (10.04 LTS). And then from Lucid Lynx (10.04 LTS) to Precise Pangolin (12.04 LTS).

References:
 * Releases - Ubuntu Wiki - https://wiki.ubuntu.com/Releases
 * Upgrading - https://help.ubuntu.com/12.04/serverguide/installing-upgrading.html
 * [ubuntu] Upgrade Karmic Koala server - http://ubuntuforums.org/showthread.php?t=1885404

Samba
Samba and CIFS: sudo apt-get install cifs-utils

sudo apt-get install smbfs
 * 1) older system:

Mount: mount //fileserver.oeey.com/share /mnt -t cifs -o user=guest

VNC

 * 1) apt-get install tightvncserver
 * 2) apt-get install xterm
 * 3) apt-get install xfce4
 * 4) apt-get install xfonts-base

apt-get install tightvncserver xterm xfce4 xfonts-base

vncpasswd
 * 1) set passwd

echo "" | vncpasswd -f > ~/.vnc/passwd
 * 1) set empty passwd (after starting server to create xstartup template)

vncserver

~/.vnc/xstartup: startxfce4 & xterm &

Kill: killall Xtightvnc

Vino
Type “Desktop Sharing” into the dash and hit the configuration screen.

To disabled the encryption: sudo apt-get install vino dconf-editor

As the regular login user (NOT ROOT!): gsettings set org.gnome.Vino require-encryption false gsettings set org.gnome.Vino prompt-enabled false gsettings set org.gnome.Vino authentication-methods "['none']"

Or Access via gui: $ dconf-editor org.gnome.desktop.remote-access

To auto start Vino on systems it doesn't auto start on (eg. Raspberry Pi)
 * 1) sudo su -
 * 2) cat > /etc/sudoers.d/vsrv.sh << "EOF"
 * 3) #!/bin/bash
 * 4) /usr/lib/vino/vino-server
 * 5) EOF
 * 6) chmod +x /etc/sudoers.d/vsrv.sh
 * 7) cat >> /etc/xdg/lxsession/LXDE/autostart << "EOF"
 * 8) @/etc/sudoers.d/vsrv.sh
 * 9) EOF
 * 1) EOF

sudo su - cat > /etc/xdg/autostart/vino-server.desktop << "EOF" [Desktop Entry] Name=Desktop Sharing Comment=GNOME Desktop Sharing Server Exec=/usr/lib/vino/vino-server Terminal=false Type=Application X-GNOME-Autostart-Phase=Applications X-GNOME-AutoRestart=true NoDisplay=true EOF

On Ubuntu this added: Exec=/usr/lib/vino/vino-server --sm-disable

Ubuntu 14 Sample: [Desktop Entry] Name=Desktop Sharing Comment=GNOME Desktop Sharing Server Keywords=vnc;share;remote; NoDisplay=true Exec=/usr/lib/vino/vino-server --sm-disable Icon=preferences-desktop-remote-desktop OnlyShowIn=GNOME;Unity; Terminal=false Type=Application AutostartCondition=GSettings org.gnome.Vino enabled X-GNOME-Autostart-Phase=Applications X-GNOME-AutoRestart=true X-GNOME-UsesNotifications=true X-Ubuntu-Gettext-Domain=vino
 * 1) cat /etc/xdg/autostart/vino-server.desktop

Manually run: pkill vino export DISPLAY=:0.0 /usr/lib/vino/vino-server &

References:
 * http://www.libregeek.org/2014/04/29/getting-remote-access-work-ubuntu-14-04-vino/
 * RPi VNC Screen Sharing - eLinux.org - http://elinux.org/RPi_VNC_Screen_Sharing

DHCP Hostname
DHCP Register Hostname

Getting Debian to send your DHCP server it's hostname for Dynamic DNS - http://jeffwelling.github.io/2010/01/02/Debian-dynamic-dns.html

Should already be enbaled by default:

/etc/dhcp3/dhclient.conf send host-name = gethostname;

test with: nslookup [hostname]

Java 8
add-apt-repository -y ppa:webupd8team/java apt-get update echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections apt-get -y --force-yes install oracle-java8-installer oracle-java8-set-default
 * 1) For Ubuntu

Console Only Mode
The Ubuntu 16 non gui systems struggle with the console.

1. The login screen isn't visible from console 1, and 2. the refresh rate is beyond terrible.

This can be fixed by simply commenting out a line (fix #1) and adding a line (fix #2):

/etc/default/grub:
 * 1) GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_TERMINAL=console

and then running: update-grub

ref: https://askubuntu.com/questions/92276/how-do-i-boot-into-true-text-mode

Maybe https://superuser.com/questions/1106174/boot-ubuntu-16-04-into-command-line-do-not-start-gui

Full Release Upgrade
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get install update-manager-core sudo do-release-upgrade

https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-16-04-lts

Open VM Tools
VMware tools and drivers:

apt install open-vm-tools open-vm-tools-desktop

Driver: apt install xserver-xorg-video-vmware xserver-xorg-input-vmmouse

Afterwards, restart the VM

Make sure the VM's display "Video card" device has "auto" set for RAM. Need to have sufficient to run the GUI. 3D support is not required.

LAMP
sudo apt install apache2 mysql-server php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php
 * 1) sudo apt install apache2
 * 2) sudo apt install mysql-server
 * 3) sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php

How to Install LAMP on Ubuntu  ·  How to Ubuntu - https://howtoubuntu.org/how-to-install-lamp-on-ubuntu

phpmyadmin: apt-get -y install phpmyadmin

Free SSL Certificate from Let's Encrypt
apt-get -y install python3-certbot-apache certbot --apache -d example.com

Let's Encrypt SSL certificates are valid for a short period of 80 days only. Therefore a cronjob to auto-renew the SSL certificates is necessary that runs the certbot --renew command.

/etc/cron.d/certbot: SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 * 1) /etc/cron.d/certbot: crontab entries for the certbot package
 * 2) Upstream recommends attempting renewal twice a day
 * 3) Eventually, this will be an opportunity to validate certificates
 * 4) haven't been revoked, etc. Renewal will only occur if expiration
 * 5) is within 30 days.
 * 1) haven't been revoked, etc. Renewal will only occur if expiration
 * 2) is within 30 days.

0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew

Ref: Ubuntu 18.04 (LTS) LAMP server tutorial with Apache, PHP 7.2, and MySQL - https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-18-04-lamp/

You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=wiki.example.com

- Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/wiki.example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/wiki.example.com/privkey.pem Your cert will expire on 2018-11-21. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of  your certificates, run "certbot renew"

Mirror Repo
Install: apt install apt-mirror yum install apt-mirror
 * 1) ubuntu
 * 1) centos

Create folder: mkdir -p /repo/apt-mirror

Run update: (after config below) apt-mirror

---

Ubunut 16.04:

/etc/apt/mirror.list set base_path   /repo/apt-mirror set nthreads    20 set _tilde 0
 * 1) config ##################
 * 2) set base_path    /var/spool/apt-mirror
 * 1) set base_path    /var/spool/apt-mirror
 * 1) set mirror_path  $base_path/mirror
 * 2) set skel_path    $base_path/skel
 * 3) set var_path     $base_path/var
 * 4) set cleanscript $var_path/clean.sh
 * 5) set defaultarch
 * 6) set postmirror_script $var_path/postmirror.sh
 * 7) set run_postmirror 0
 * 1) set run_postmirror 0
 * 1) end config ##############
 * 1) end config ##############

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
 * 1) deb http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
 * 1) deb-src http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

This would be /etc/apt-mirror.list on Centos

--- ref

Host Your Own YUM and APT Repository – Engineering Tomorrow’s Systems - https://estl.tech/host-your-own-yum-and-apt-repository-4ba8350eeda1

Install Pip with Easy Install
pip via package seems broken, especially on "pip install pip --upgrade". Installing with easy_install seems to work better.

apt-get install python-setuptools easy_install pip pip install pip --upgrade

---

Ubuntu 18 removed easy_install from python-setuptools

According to the changelog easy_install was removed from the python-setuptools package. https://launchpad.net/ubuntu/+source/python-setuptools/39.0.1-2

python /usr/lib/python2.7/dist-packages/easy_install.py pip pip install pip --upgrade

Extract deb Package Contents
$ ar x example.deb $ ar -xv example.deb x - debian-binary x - control.tar.gz x - data.tar.xz

$ tar -xvf control.tar.gz

$ dpkg -x package.deb /tmp/out

Ref:

Keep Ubuntu from releasing DHCP address on reboot
For crappy networks with crappy DHCP lease times...

Prevent DHCP release upon shutdown? - Raspberry Pi Forums - https://www.raspberrypi.org/forums/viewtopic.php?t=72579

When you shut down your RPi, the /etc/init.d/networking script is invoqued, called by the rc.d hooks. In turn, the /etc/init.d/networking execute ifdown -a in the "stop)" and the "reload)" case switches. Just comment out these lines. Even better, if you want to deconfigure gracefully the interfaces before shut down, replace the ifdown command by the appropriate ip link set eth0 down command. I just checked with tcpdump, no DHCPRELEASE is sent in that case.

/etc/init.d/networking
 * 1) Comment out the 'ifdown -a' section in the stop) case

stop) ...       #log_action_begin_msg "Deconfiguring network interfaces"        #if ifdown -a --exclude=lo $verbose; then        #    log_action_end_msg $?        #else        #    log_action_end_msg $?        #fi

FTDI Driver
The Linux kernel team decided to remove some modules from the base kernel to allow "virtual" images to be slimmed down. The extra modules are moved into linux-image-extra and you can get them installed by typing:

apt install linux-image-extra-virtual apt install linux-image-extra-`uname -r`

modprobe usbserial modprobe ftdi_sio

ref:

Default Kernels
ubuntu-16.04.6-server-amd64.iso - 4.4.0-142-generic available: linux-image-4.15.0-46-generic

-

ubuntu-18.04.1-server-amd64.iso - 4.15.0-29-generic available: linux-image-4.18.0-16-generic

ubuntu-18.04.2-server-amd64.iso - 4.15.0-45-generic available: linux-image-4.18.0-16-generic

ubuntu-18.04.2-live-server-amd64.iso - 4.15.0-46-generic available: linux-image-4.18.0-16-generic

ubuntu-18.10-live-server-amd64.iso - 4.18.0-16-generic available: linux-image-4.18.0-16-generic

Sample APT: linux-image-4.18.0-10-generic

Cheat way to list available: $ apt install linux-image Package linux-image is a virtual package provided by: ... linux-image-4.18.0-16-lowlatency 4.18.0-16.17~18.04.1 linux-image-4.18.0-16-generic 4.18.0-16.17~18.04.1 You should explicitly select one to install.

List current installed: ii linux-image-4.15.0-46-generic         4.15.0-46.49                      amd64        Signed kernel image generic ii linux-image-generic                   4.15.0.46.48                      amd64        Generic Linux kernel image
 * 1) dpkg --list | grep linux-image

Slow NFS Mount
Ubuntu 14.04 NFS4 client has slow access to NFS - share

Syslog shows: RPC: AUTH_GSS upcall timed out. Please check user daemon is running.

/etc/modprobe.d/savenfs.conf blacklist rpcsec_gss_krb5
 * 1) ken

unload module: modprobe -r rpcsec_gss_krb5

And remount, should be instant.

References:
 * Bug #1270445 “slow NFS4 without “NEED_GSSD=yes"" : Bugs : “nfs-utils” package : Ubuntu - https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1270445

runit socket upstart connection refused
15.04 - Failed to connect to socket /com/ubuntu/upstart: Connection refused: Errors were encountered while processing: runit - Ask Ubuntu https://askubuntu.com/questions/654951/failed-to-connect-to-socket-com-ubuntu-upstart-connection-refused-errors-were

vim /var/lib/dpkg/info/runit.postinst

Comment out:
 * 1) if [ -x /sbin/start ]; then #provided by upstart
 * 2)  /sbin/start runsvdir
 * fi

Finish install: sudo apt-get install -f

--

apt - How to fix processing with runit and git-daemon-run - Ask Ubuntu https://askubuntu.com/questions/765565/how-to-fix-processing-with-runit-and-git-daemon-run

sudo apt-get purge runit sudo apt-get purge git-all sudo apt-get purge git sudo apt-get autoremove sudo apt update sudo apt install git