Ubuntu: Difference between revisions

From Halfface
Jump to navigation Jump to search
Line 5: Line 5:
==List contents of package==
==List contents of package==
  apt-file list packagename
  apt-file list packagename
dpkg -c <$package.deb>


=Update apt-file database=
=Update apt-file database=

Revision as of 15:44, 22 February 2022

Which package contains file

apt-file search filename
dpkg -S /usr/sbin/apache2

List contents of package

apt-file list packagename
dpkg -c <$package.deb>

Update apt-file database

apt-file update

updates the list of available packages and their versions

apt-get update

upgrade single package

apt --only-upgrade install apache2

show installed packages in cronological order

cat /var/log/dpkg.log* | grep "\ install\ " | sort | less

Installed packages.

dpkg --get-selections
apt-get install openssh-client openssh-server

List packages on one machine and install on another.

dpkg --get-selections > installed-software
dpkg --set-selections < installed-software
dselect

Upgrade.

sudo apt-get -y update
sudo apt-get -y upgrade

Which package provides.

http://packages.ubuntu.com/

List available linux packages.

apt-cache pkgnames

install local deb packages

sudo dpkg -i 1.deb 2.deb 

install from experimental

# add next row to /etc/apt/sources.list and do an apt-get update
deb http://ftp.debian.org/debian/ experimental main contrib non-free
# Then install latest version of ekiga.
apt-get -t experimental install ekiga

which version of debian

lsb_release

add gpg key

gpg --keyserver subkeys.pgp.net --recv-keys AED4B06F473041FA
gpg -a --export AED4B06F473041FA | sudo apt-key add -

clean /var/cache/apt

sudo apt-get clean

which version is available and installed(*** means installed)

apt-cache policy apache2-bin

Read values from the debconf database

debconf-get-selections | grep ^iptables-persistent

Set value in debconf database

echo newrelic-php5 newrelic-php5/application-name string "blablabla" | debconf-set-selections

dowload deb

sudo apt-get install --download-only --reinstall sudo

verify deb package

checksums are stored /var/lib/dpkg/info/elasticsearch.md5sums

dpkg --verify elasticsearch
??5?????? c /etc/elasticsearch/elasticsearch.yml
??5?????? c /etc/elasticsearch/jvm.options

extract deb

dpkg-deb -xv elasticsearch_7.9.3_amd64.deb .

configure networks

/etc/netplan/10-eth0.yaml
netplan apply

add static route

/etc/network/interfaces

#--------------------------------------------#
# Setup eth0 - connected to private LAN/VLAN #
#--------------------------------------------# 
auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 10.70.201.5
        netmask 255.255.255.192
        ### Ubuntu Linux add persistent route command ###
        post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.70.201.6

add static route netplan way

network:
    ethernets:
        enp0s3:
            dhcp4: false
            addresses: [192.168.1.202/24]
            gateway4: 192.168.1.1
            nameservers:
              addresses: [8.8.8.8,8.8.4.4,192.168.1.1]
            routes:
            - to: 172.16.0.0/24
              via: 192.168.1.100
    version: 2
# netplan apply

enable sysstat

apt -y install sysstat
vi /etc/default/sysstat
ENABLED="true"
systemctl restart sysstat