is a front end for groupadd
and groupmod
. For more info
see adduser
.
is a front end for useradd
and usermod
.
adduser
and addgroup
together have five (5) modes:
- add a normal user;
- add a system user;
- add a user group;
- add a system group;
- add an existing user to an existing group;
Some examples (you must have root priv):
adduser mozart audio
add an existing user mozart to an existing group audio;
adduser bamboo
create a new [normal, regular] user with typical defaults
like home dir of the same name, group of the same name (will be auto created);
this cmd also prompts you for password and additional info; you can force the
assignment of specific UID with --uid
nn, but cmd
fails if this UID is already taken;
adduser --system terminator
create a system account, i.e., a user with UID in the range
FIRST_SYSTEM_UID .. LAST_SYSTEM_UID; by default, system users are
placed in the nogroup (can be overridden with --gid
);
a home dir is created by the same rules as for normal users (can be cancelled
with --no-create-home
); the new system user will have the
/bin/false shell (unless overridden with --shell
),
and have logins disabled; skeletal config files are not copied;
searches man database (manual pages) for instances of keyword.
The database is updated by mandb
program (usually runs as
dayly / weekly cron
job, see /etc/cron.dayly).
Some installations do not configure it to be run auto; in this case you can
either start it manually (each time when new app was installed) or configure
auto execution.
apropos
[options] keyword ...
apropos stream
apropos datagram portmap
apropos -w job*
apropos -e printf
Options
-h
--help
-v
--verbose
-V
--version
-a
, --and
show only those items that match all specified keywords;
-C
file, --config-file=
file
use the specified user config file instead of ~/.manpath;
-e
, --exact
search each keyword for exact match;
-L
str, --locale=
str
temporarily override current locale with the specified locale string;
-l
, --long
do not truncate the output to the terminal width;
-M
path, --manpath=
path
set search path for manual pages to path;
-m
system, --system=
system
use manual pages from other systems;
-r
, --regex
interpret each keyword as a regular expression (default);
-s
n, --section
n
search only the specified man section;
-w
, --wildcard
interpret each keyword as a pattern containing shell-style wildcards;
0 | Success |
1 | Usage, syntax or configuration file error |
2 | Operational error |
16 | Nothing was found that matched the criteria specified |
Do not confuse apt
with APT, Advanced
Packaging Tool, which includes a library and a set of cmdline programs like
apt
, apt-get
, apt-cache
, etc.
Technically, APT is a free-software user interface that works with core
libraries to handle the installation and removal of software on Debian-based
distributions. Also, it can be considered as a front-end to dpkg
.
apt
was introduced in Ubuntu 16.04 (?) as an attempt to improve
and simplify software management by merging the best features of
apt-get
and apt-cache
.
You should prepend apt
with sudo
, unless you
are root. And before you start upgrading or installing pkgs,
you should run the following cmd to refresh your pkg database with the latest
"news" from the repositories:
apt update
reads info from repositories and updates the local package database; during pkg info retreival it marks each line either with Hit (nothing new), or Ign (ignored because of some error, or because it's too recent to update), or Get (new version is available); Note! This cmd does not install anything!
apt upgrade
upgrades all installed packages (it shows you the list of packages to be upgraded and asks if you want to do this);
apt full-upgrade
like prev, but also removes installed pkgs if it's necessary for the correct upgrade;
apt update && sudo apt upgrade -y
updates pkg database, and immediately starts to update
(upgrade) eligible pkgs; -y
means "assume yes as answer
to all prompts and run non-interactively";
apt install postgresql postgresql-contrib
installs PostgreSQL and related stuff; if it is already
installed, it will be upgraded, but only if [according to package database]
a new version is available (and that's why the package database must be
updated at the beginning of each upgrade/install session); by default,
~
installs the latest version available; however, if you
explicitly specify version number, a command like:
apt install pkg_name=version
installs earlier version of the package; usually it's not good, but sometimes it's a satisfactory temporary solution;
apt install audacious --no-upgrade
install audacious; but if it's already installed, do not upgrade it to a newer version!
apt install mplayer --only-upgrade
upgrade mplayer if it's present in the system; but do not install it, if it was not installed earlier!
apt remove gnome-tweak-tool
removes the specified package; to be exact, this cmd removes binary files and leaves behind config files related to a package; if you want to remove everything, use purge:
apt purge gnome-tweak-tool
this cmd removes everything related to the specified package; it's good in two cases: (1) if you want to perform a clean reinstall, and (2) if you're not going to use this package in the foreseeable future;
apt search word_to_look_for
lists all pkgs containing the specified word (choose your search pattern carefully: unique library name is good, common words not);
apt show pkg_name
shows info about the specified pkg (dependencies, download size, installation size, sources the pkg is available from, content description, etc); this cmd is applicable to all pkgs, installed and not installed;
apt list --upgradeable
lists all pkgs that have a newer versions and can/should be upgraded;
apt list --installed
lists all installed packages;
apt list --all-versions
lists all available packages for your system;
apt purge autoremove
removes useless libs and pkgs that were auto installed to
satisfy dependencies and left behind after the depending packages were removed;
apt
does not support clean or autoclean;
Options
-h
--help
-v
--version
Probably, you should use apt
- it's newer,
simpler, and more convenient. The only reason to use apt-get
is
the necessity to do something that apt
does not allow.
The apt-get
handles installation and removal of software
on the Ubuntu, Debian, and other Debian-like Linux systems. It automates
retrieval, configuration, installation of software pkgs from binary files
or source code. All pkgs containing dependencies required by the package(s)
specified for the installation are auto retrieved and installed.
~
was originally designed as a front-end for dpkg
to work with .deb pkgs, but now it also supports RPM (via
apt-rpm
). Synaptic Package Manager, Ubuntu Software
Center are GUI front-ends to APT. Non-root users
should prepend ~
with
sudo
.
apt-get update
update the package index, i.e., sync your local database of pkgs available from repositories (/etc/apt/sources.lst) with the appropriate servers; usually this is done at the session start);
apt-get upgrade
upgrade any pkgs on your system with new versions available;
apt-get dist-upgrade
upgrade your whole distribution to the newest release (it's a serious operation, think twice, make backup, etc);
apt-get install mplayer smplayer
install packages mplayer and smplayer;
apt-get remove unison-gtk
remove package unison-gtk; if other pkgs depend on the one
being removed, ~
prompts you with what pkgs will be affected;
apt-get remove --purge unison-gtk
remove unison-gtk and related config files;
apt-get remove --purge linux-image-2.6.35-24-generic-pae
apt-get remove --purge linux-headers-2.6.35-24
remove outdated linux kernel and related files;
apt-get autoremove
remove miscellaneous old packages;
apt-get source mpg321
download the source code for the package mpg321;
apt-get build-dep mpg321
download and install all dependencies required to build mpg321
from the source downloaded in the previous example;
apt-get clean && apt-get autoclean
clean out the local archive; autoclean
removes only pkg
files that are no longer available; clean
removes everything
except the lock file;
apt-get check
verify dependencies;
apt-cache policy python-numpy
check availablity of the specified pkg (python-numpy): is it installed already, or can it be downloaded, etc;
dpkg-reconfigure gdm
repair a damaged package gdm;
dpkg-reconfigure tzdata
adjust the time zone;
dpkg-reconfigure postfix
create new config files for postfix;
dpkg-query -l | more
show all packages installed in the system;
dpkg -l | wc -l
how many packages are installed here?
dpkg -l pkg
show info on the installed software package;
dpkg -L pkg
list all files installed by the software package;
dpkg -i file
install a local (.deb) file to your system;
dpkg -S file
show info about the software pkg owning file;
Release upgrade for Ubuntu servers
Make sure that you have a good backup of your data, and copies of some modified config files from /etc.
apt-get update
apt-get install screen
screen
Now if you get disconnected from your server, you can log back in and issue the following command to resume your screen session:
screen -Dr
Install the latest version of key system utilities:
apt-get install update-manager-core
Upgrade:
do-release-upgrade
When it's done, you may check the version:
cat /etc/lsb-release
Files
/etc/apt/sources.list
locations to fetch pkgs from;
/etc/apt/sources.list.d/
additional src list fragments;
/etc/apt/apt.conf
APT config file;
/etc/apt/apt.conf.d/
APT config file fragments;
/etc/apt/preferences
version preferences file;
/var/cache/apt/archives/
storage area for the retrieved package files;
/var/cache/apt/archives/partial/
storage area for the package files in transit;
/var/lib/apt/lists/
storage area for the state information for each package resource specified in sources.list;
/var/lib/apt/lists/partial/
storage area for the state information in transit;
Deprecated
manipulates or displays the kernel's ARP (Address Resolution Protocol) cache (/proc/net/arp). ARP is used to find the media access control (MAC) address of a network neighbour for a given IPv4 address. Complete entries in the ARP cache are marked with C, permanent entries with M, published entries with P.
arp
show the current content of the ARP table;
arp -a
same as previous, but output in BSD format;
arp srv2
show entry for host srv2;
arp 192.168.0.254
show entry for host with IP 192.168.0.254;
arp -e -p inet
show all Internet (inet protocol family) entries in default format;
arp -i eth0 -d 192.168.0.4
delete from ARP cache an entry for 192.168.0.4;
Options
-h
--help
-V
--version
-v
--verbose
-a
[host],
--display
[=
host]
show arp cache entries in alternate (BSD) format; host can be either hostname or IP; if host is not specified, show all;
-d
host, --delete=
host
delete a ARP table entry for host (IP or hostname);
-D
hw_addr,
--use-device=
hw_addr
show only info related to the interface specified by the hardware address;
-e |
show arp cache entries in default (Linux) format; |
-f
file,
--file=
file
like -s
, but entry info is taken from file;
-H
type,
--hw-type
type
the class (type) of entries to check for; ether (0x01) is default; other available options are arcnet, pronet, ax25, netrom;
-i
iface,
--device=
iface
show only info related to the specified network interface;
-n
, --numeric
show numerical addresses;
-p
prot,
--protocol=
prot
show only info related to the specified protocol family;
-s
host hw_addr
create an arp address mapping entry;
To schedule some job to be executed at 20:00 today, type
at 20:00
and press ENTER. When prompt (at>) appears, type cmd(s) to be executed (use ENTER for multiline input) and finish this procedure by pressing ENTER followed by CTRL+D.
at
[options] time
execute cmds at a specified time;
atq
[-q
queue]
list pending jobs of the current user (root gets everybody's jobs);
atrm
job ...
remove job(s);
batch
[options] time
do job when the system load is relatively low;
Time: HH:MM[am|pm], midnight, noon, teatime (4pm);
Date: month day [year] (Jun 29 2008), MMDDYY, MM.DD.YY, MM/DD/YY,
now, today, tomorrow, monday, tuesday, wednesday, thursday, friday,
saturday, sunday;
at 4:55pm Sep 5 < cmd.lst
execute commands from file cmd.lst
at 4:55pm, Sep 5;
at 10:30am < cmd.lst
exec cmds from file cmd.lst
at 10:30 today;
at -f cmds.txt 8:30 tomorrow
exec cmds from cmds.txt
at 8:30 tomorrow;
at -f cmds.txt now + 15 minutes
exec cmds from cmds.txt
in 15 minutes;
at -f cmds.txt 9:15am + 7 days
exec cmds ... at 9:15am, 7 days from now;
echo "shutdown -r now" | at now + 1 hour
initiate system reboot in one hour from now;
batch -f cmds.txt now + 8 hours
exec cmds ... in 8 hours (approx) from now;
atq |
list jobs in queue (also: at -l ); |
atrm 18 23
cancel jobs #18 and #23;
Options
-V |
version; |
-c |
cat the jobs listed on the cmd line to stdout; |
-d
job
remove job from queue (alias for atrm
);
-f
file
read job from the specified file;
-l |
list user's pending jobs (alias for atq ); |
-m |
send mail to user, when job has completed; |
-q
queue
use the specified queue (a-z, A-Z); a is default
for at
, b is default for batch
);
-t
time
submit the job to be run at the specified time,
which must have the same format as specified for the
touch
utility’s
-t
option ([[CC]YY]MMDDhhmm);
-v |
show the time when the job will be executed; |
Files
/etc/at.allow
/etc/at.deny
/var/spool/at
/var/spool/at/spool