Apt: Difference between revisions
From DWIKI
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
=Unattended upgrades= | =Unattended upgrades= | ||
==Links== | |||
*https://help.ubuntu.com/community/AutomaticSecurityUpdates | |||
*[https://pimylifeup.com/unattended-upgrades-debian-ubuntu/ Using Unattended-Upgrades on Debian and Ubuntu] | |||
*https://wiki.debian.org/UnattendedUpgrades | |||
==Simple command== | ==Simple command== | ||
dpkg-reconfigure unattended-upgrades | dpkg-reconfigure unattended-upgrades | ||
==Disable unattended upgrades== | ==Disable unattended upgrades== | ||
Line 33: | Line 37: | ||
==List installed packages== | ==List installed packages== | ||
apt list --installed | apt list --installed | ||
==Upgrade just one package== | |||
apt-get install --only-upgrade <packagename> | |||
= FAQ = | = FAQ = | ||
Line 48: | Line 56: | ||
== have been kept back == | == have been kept back == | ||
On Ubuntu this can be caused by phased updates, see https://itsfoss.com/following-packages-have-been-kept-back/ | |||
Usually means you should run | Usually means you should run | ||
Line 100: | Line 109: | ||
https://ppa.launchpadcontent.net/ | https://ppa.launchpadcontent.net/ | ||
===apt-key is deprecated. Manage keyring files in trusted.gpg.d instead=== | |||
See [https://itsfoss.com/apt-key-deprecated/ apt-key is deprecated] | |||
==The following upgrades have been deferred due to phasing== | ==The following upgrades have been deferred due to phasing== |
Latest revision as of 10:13, 7 March 2025
Debian/Ubuntu package manager
Unattended upgrades
Links
- https://help.ubuntu.com/community/AutomaticSecurityUpdates
- Using Unattended-Upgrades on Debian and Ubuntu
- https://wiki.debian.org/UnattendedUpgrades
Simple command
dpkg-reconfigure unattended-upgrades
Disable unattended upgrades
In /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Unattended-Upgrade "0";
The logs
/var/log/unattended-upgrades/*.log
FAQ
Unattended-Upgrade::DevRelease "auto";
Only works on "dev releasess", which is any not .04
What is this Allowed-Origins about?
HOWTO
Extract files from .deb
dpkg-deb
Pin a version
List installed packages
apt list --installed
Upgrade just one package
apt-get install --only-upgrade <packagename>
FAQ
Show version of packages before installing
apt-get -s install somepackage
or
apt install madison-lite apt-cache madison somepackage
or
apt-show packagename
Show available/installed versions of package
apt-cache policy elasticsearch
have been kept back
On Ubuntu this can be caused by phased updates, see https://itsfoss.com/following-packages-have-been-kept-back/
Usually means you should run
apt install <kept-back-package>
or
apt upgrade packagename
otherwise
apt dist-upgrade
Unable to correct problems, you have held broken packages.
Try
dpkg --get-selections | grep hold
What packages depend on package
apt-cache rdepends --installed libc6-dev
Clear cache
apt-get clean
Could not handshake: The TLS connection was non-properly terminated.
try http instead of https
Depends: but it is not going to be installed
First try
apt-get update && apt-get upgrade
E: Unable to correct problems, you have held broken packages.
Which services should be restarted?
That's from needrestart
Prevent restarting all services when installing a package
NEEDRESTART_MODE=i apt install somepackage
What repository provides package
apt policy <packagename>
Error messages
Key is stored in legacy trusted.gpg keyring
Check apt-key is deprecated
Certificate verification failed: The certificate is NOT trusted.
try
deb [trusted=yes] ...
in sources.list, but things might be worse than that, in case of launchpad change to
https://ppa.launchpadcontent.net/
apt-key is deprecated. Manage keyring files in trusted.gpg.d instead
The following upgrades have been deferred due to phasing
apt install <whatever package it lists>
needrestart
Service restarts being deferred
Probably services like networkd-dispatcher.service. Check /etc/needrestart/needrestart.conf for $nrconf{override_rc}