Dealing with Packages on Debian/Ubuntu

assuming you’ve set it up already

Packages

Clean-up the configuration file

    mv -i /etc/apt/sources.list /etc/apt/sources.list.dist
    grep -vE '^#|^$' /etc/apt/sources.list.dist > /etc/apt/sources.list

find about your nearest mirror

wget -qO - mirrors.ubuntu.com/mirrors.txt

and point the repositories against it e.g.

vi /etc/apt/sources.list

deb http://mirrors.online.net/ubuntu focal main restricted universe multiverse
deb http://mirrors.online.net/ubuntu focal-updates main restricted universe multiverse
deb http://mirrors.online.net/ubuntu focal-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse

#http://fr.archive.ubuntu.com/ubuntu/
#http://ru.archive.ubuntu.com/ubuntu/

Alternatively, you can build your own configuration with some helper

And in case you have an HTTP PROXY on your network for that purpose

nmap -p 3142 x.x.x.x
vi /etc/apt/apt.conf.d/02proxy

Acquire::http { Proxy "http://x.x.x.x:3142"; };

apt update

Initial upgrade

Check for major release uprgade

do-release-upgrade

Proceed with patches

cat /etc/apt/apt.conf.d/02proxy
apt update
apt full-upgrade

and see Ubuntu Server Operations for further maintenance

Additional packages

Install a few more packages.

export DEBIAN_FRONTEND=noninteractive

Bare-metal

apt install \
    ethtool \
    hwinfo \
    screen \
    sudo

    #ifupdown \
    #ifupdown2 \
    #xfsprogs \
    #xfsdump \

Server system

    openssh-server \
    openssh-client \

and even more for any kind of system incl. some container that you need to troubleshoot

apt install \
    apt-utils \
    apt-transport-https \
    biff \
    bzip2 \
    colordiff \
    curl \
    dialog \
    dnsutils \
    dos2unix \
    elvis-tiny \
    git \
    htop \
    iputils-ping \
    iotop \
    ksh \
    less \
    lftp \
    lsb-release \
    lynx \
    man-db \
    manpages \
    mlocate \
    net-tools \
    netcat \
    nmap \
    procps \
    pwgen \
    software-properties-common \
    sysstat \
    telnet \
    unzip \
    wget \
    whois \
    xxd

note iputils-ping is preferred (PTR-capable)

    # inetutils-ping
    # mc \
    # nvi \
    # vim-nox \

    update-alternatives --config vi
    update-alternatives --config editor

Resources

fastest mirror

How to select the fastest apt mirror on Ubuntu Linux https://linuxconfig.org/how-to-select-the-fastest-apt-mirror-on-ubuntu-linux


GUIDES | LECTURES | BENCHMARKS | SMTP HEALTH