Ubuntu: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 8: Line 8:


   lsb_release -a
   lsb_release -a
=Package Management=
{{External|[https://www.howtogeek.com/261449/how-to-install-linux-software-in-windows-10s-ubuntu-bash-shell/ apt-get tutorial]}}
apt-get update
Add a repository:
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Query and display available information about installed and installable packages:
apt-cache
=User Management=
[[useradd]], [[usermod]], etc.


=Configuration=
=Configuration=
Line 19: Line 37:
<tt>ifup</tt> is one of the utilities that can be used to configure the network interfaces. It reads its configuration from /etc/network/interfaces:
<tt>ifup</tt> is one of the utilities that can be used to configure the network interfaces. It reads its configuration from /etc/network/interfaces:


<syntaxhighlight'>
<syntaxhighlight lang='bash'>
# This file describes the network interfaces available on your system
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# and how to activate them. For more information, see interfaces(5).
Line 31: Line 49:
# The primary network interface
# The primary network interface
auto ens5
auto ens5
#iface ens5 inet dhcp
iface ens5 inet static
iface ens5 inet static
   address 192.168.1.10
   address 192.168.1.10
   netmask 255.255.255.0
   netmask 255.255.255.0
   gateway 192.168.1.1
   gateway 192.168.1.1
dns-servernames 1.1.1.1 8.8.8.8 8.8.4.4
  dns-nameservers 1.1.1.1 8.8.8.8 8.8.4.4
</syntaxhighlight>
</syntaxhighlight>


Line 47: Line 64:
====DNS Resolver====
====DNS Resolver====


DNS resolver is configured with <tt>resolvconf</tt>. Normally, <tt>resolvconf</tt> is invoked by network interface configuration programs, such as <tt>ifup</tt>, <tt>NetworkManager</tt> or <tt>dhclient</tt>. <tt>resolvconf</tt> ''can'' be run by administrators, but this s normally necessary.
DNS resolver is configured with <tt>resolvconf</tt>, which writes /etc/resolv.conf. Normally, <tt>resolvconf</tt> is invoked by network interface configuration programs, such as <tt>ifup</tt>, <tt>NetworkManager</tt> or <tt>dhclient</tt>. <tt>resolvconf</tt> ''can'' be run by administrators, but this s normally necessary. /etc/network/interfaces contains DNS-related configuration keywords: "dns-nameserver", "dns-search", "dns-nameservers". For more details
 
man resolvconf
 
=Execute a Script on Boot=
 
Place the script to be executed in the /etc/init.d directory.
 
Make it executable.
 
Execute:
 
<syntaxhighlight lang='text'>
sudo update-rc.d <script-name> defaults
</syntaxhighlight>
 
Do not prefix the script name with "/etc/init.d".

Latest revision as of 01:45, 20 September 2020

Internal

Info

Ubuntu Version

 lsb_release -a

Package Management

apt-get tutorial
apt-get update

Add a repository:

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Query and display available information about installed and installable packages:

apt-cache

User Management

useradd, usermod, etc.

Configuration

Network

Network Interfaces

ifup

ifup is one of the utilities that can be used to configure the network interfaces. It reads its configuration from /etc/network/interfaces:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens5
iface ens5 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 1.1.1.1 8.8.8.8 8.8.4.4

NetworkManager

dhclient

DNS

DNS Resolver

DNS resolver is configured with resolvconf, which writes /etc/resolv.conf. Normally, resolvconf is invoked by network interface configuration programs, such as ifup, NetworkManager or dhclient. resolvconf can be run by administrators, but this s normally necessary. /etc/network/interfaces contains DNS-related configuration keywords: "dns-nameserver", "dns-search", "dns-nameservers". For more details

man resolvconf

Execute a Script on Boot

Place the script to be executed in the /etc/init.d directory.

Make it executable.

Execute:

sudo update-rc.d <script-name> defaults

Do not prefix the script name with "/etc/init.d".