apt / apt-get¶
the tool to manage debian / ubuntu packages, I always forget some commands, so let put them here.
extract .deb package contents¶
the package binutils
needs to be installed for this
find package for filename / executable¶
you want to run ping
but you have no idea which package provides ping
:
then do something like
you can also use dpkg:
pin version¶
sometimes you want or need to pin a package to a specific version since it'll break everything. looking at you, docker. this happened twice already.
vi /etc/apt/preferences.d/docker
Package: docker-ce
Pin: version 5:20.10.4~3-0~ubuntu-focal
Pin-Priority: 900
this will pin the package docker-ce
to version 5:20.10.4~3-0~ubuntu-focal
by using a high priority of 900, the default is usually 500.
You can check the package priority with the apt-cache policy
command (see above) to adjust the priority, but why not stick to 900. or over 9000.
version provided by repository / repository used by package¶
especially important for debian since all packages are always outdated by 10 years:
this is also useful if you do a major version upgrade and the new package is provided by the OS instead of a 3rd party:
ubuntu 20.04 for podman
:
podman:
Installed: 100:3.4.2-2
Candidate: 100:3.4.2-4
Version table:
100:3.4.2-4 500
500 http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04 Packages
*** 100:3.4.2-2 100
100 /var/lib/dpkg/status
ubuntu 22.04 for podman
: