Apt: Difference between revisions
m →Links Tag: wikieditor |
|||
| (16 intermediate revisions by the same user not shown) | |||
| Line 13: | Line 13: | ||
*https://wiki.debian.org/UnattendedUpgrades | *https://wiki.debian.org/UnattendedUpgrades | ||
*https://linuxblog.io/how-to-enable-unattended-upgrades-on-ubuntu-debian/ | *https://linuxblog.io/how-to-enable-unattended-upgrades-on-ubuntu-debian/ | ||
*[https://gist.github.com/CodingKoopa/3b30afe8c91e3950f6b124cd2abe3b6b the apt manpage you were looking for] | |||
==Enabling/disabling unattended upgrades== | ==Enabling/disabling unattended upgrades== | ||
Maybe install it first | |||
apt install unattended-upgrades | |||
that will most likely also enable unattended upgrades | |||
then | |||
dpkg-reconfigure unattended-upgrades | dpkg-reconfigure unattended-upgrades | ||
The dialog will show which option is selected now. | |||
==The relevant systemd service== | ==The relevant systemd service== | ||
| Line 27: | Line 33: | ||
==FAQ== | ==FAQ== | ||
===Unattended-upgrade is not upgrading all packages=== | |||
That's normal, it defaults to upgrading only security updates. | |||
===Unattended-Upgrade::DevRelease "auto";=== | ===Unattended-Upgrade::DevRelease "auto";=== | ||
Only works on "dev | Only works on "dev releases", which is any not .04 | ||
==What is this Allowed-Origins about?== | ==What is this Allowed-Origins about?== | ||
Check output of | |||
apt -s upgrade | |||
you might see something like | |||
Conf cloud-init (25.1.2-0ubuntu0~22.04.2 '''Ubuntu:22.04/jammy-updates''' | |||
which will match | |||
${distro_id}:${distro_codename}-updates | |||
==No packages found that can be upgraded unattended== | |||
By default '''"${distro_id}:${distro_codename}-updates";''' is commented out in '''/etc/apt/apt.conf.d/50unattended-upgrades''', so to get those updated as well, uncomment that line. | |||
=HOWTO= | =HOWTO= | ||
==Extract files from .deb== | ==Extract files from .deb== | ||
dpkg-deb | dpkg -x foo.deb ~/foo | ||
also | |||
dpkg - | mkdir tmp | ||
dpkg-deb -R original.deb tmp | |||
==Pin a version== | ==Pin a version== | ||
| Line 55: | Line 76: | ||
and to undo | and to undo | ||
apt-mark unhold somepackage | apt-mark unhold somepackage | ||
==Disable source in deb822 source file== | |||
add | |||
Enabled: no | |||
= FAQ = | = FAQ = | ||
==What is new style sources files called?== | |||
deb822 | |||
== the following packages have been kept back: == | |||
Time to apt-get dist-upgrade ( but check [https://askubuntu.com/questions/194651/why-use-apt-get-upgrade-instead-of-apt-get-dist-upgrade/226213#226213 ]first But it could be different things. | |||
See https://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it | |||
Perhaps: | |||
apt-get upgrade package-that-is-kept-back | |||
or try | |||
apt install package-that-is-kept-back | |||
==What version of a package is going to be installed?== | |||
apt-cache policy <package> | |||
==What package does a file belong to?== | |||
dpkg -S /path/to/file | |||
==Error messages== | ==Error messages== | ||
===E: Could not get lock /var/lib/apt/lists/lock. It is held by process 1538337 (apt-get)===Try | |||
===InRelease doesn't support architecture 'i386'=== | |||
set ''arch=amd64''' in sources old style or '''Architectures: amd64'' new style | |||
===E: Could not get lock /var/lib/apt/lists/lock. It is held by process 1538337 (apt-get)=== | |||
Try | |||
systemctl restart packagekit | systemctl restart packagekit | ||
and check | and check | ||
fuser /var/lib/apt/lists/lock | fuser /var/lib/apt/lists/lock | ||
again | again | ||
===Repository changed its 'Version' value=== | |||
Try | |||
apt-get --allow-releaseinfo-change update | |||
===The repository 'http://security.debian.org buster/updates Release' no longer has a Release file=== | |||
time to upgrade entire system | |||
==Unable to correct problems, you have held broken packages.== | ==Unable to correct problems, you have held broken packages.== | ||
| Line 120: | Line 177: | ||
Probably services like '''networkd-dispatcher.service'''. | Probably services like '''networkd-dispatcher.service'''. | ||
Check '''/etc/needrestart/needrestart.conf''' for '''$nrconf{override_rc}''' | Check '''/etc/needrestart/needrestart.conf''' for '''$nrconf{override_rc}''' | ||
[[Category:Debian]] | |||
Latest revision as of 14:30, 9 June 2026
Debian/Ubuntu package manager
Documentation
Phased Packages
Unattended upgrades
Links
- https://help.ubuntu.com/community/AutomaticSecurityUpdates
- Using Unattended-Upgrades on Debian and Ubuntu
- https://wiki.debian.org/UnattendedUpgrades
- https://linuxblog.io/how-to-enable-unattended-upgrades-on-ubuntu-debian/
- the apt manpage you were looking for
Enabling/disabling unattended upgrades
Maybe install it first
apt install unattended-upgrades
that will most likely also enable unattended upgrades then
dpkg-reconfigure unattended-upgrades
The dialog will show which option is selected now.
The relevant systemd service
apt-daily-upgrade.service
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 is not upgrading all packages
That's normal, it defaults to upgrading only security updates.
Unattended-Upgrade::DevRelease "auto";
Only works on "dev releases", which is any not .04
What is this Allowed-Origins about?
Check output of
apt -s upgrade
you might see something like
Conf cloud-init (25.1.2-0ubuntu0~22.04.2 Ubuntu:22.04/jammy-updates
which will match
${distro_id}:${distro_codename}-updates
No packages found that can be upgraded unattended
By default "${distro_id}:${distro_codename}-updates"; is commented out in /etc/apt/apt.conf.d/50unattended-upgrades, so to get those updated as well, uncomment that line.
HOWTO
Extract files from .deb
dpkg -x foo.deb ~/foo
also
mkdir tmp dpkg-deb -R original.deb tmp
Pin a version
List installed packages
apt list --installed
Upgrade just one package
apt-get install --only-upgrade <packagename>
exclude package from upgrade
apt-mark hold somepackage
and to undo
apt-mark unhold somepackage
Disable source in deb822 source file
add
Enabled: no
FAQ
What is new style sources files called?
deb822
the following packages have been kept back:
Time to apt-get dist-upgrade ( but check [1]first But it could be different things. See https://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it Perhaps:
apt-get upgrade package-that-is-kept-back
or try
apt install package-that-is-kept-back
What version of a package is going to be installed?
apt-cache policy <package>
What package does a file belong to?
dpkg -S /path/to/file
Error messages
InRelease doesn't support architecture 'i386'
set arch=amd64 in sources old style or Architectures: amd64 new style
E: Could not get lock /var/lib/apt/lists/lock. It is held by process 1538337 (apt-get)
Try
systemctl restart packagekit
and check
fuser /var/lib/apt/lists/lock
again
Repository changed its 'Version' value
Try
apt-get --allow-releaseinfo-change update
The repository 'http://security.debian.org buster/updates Release' no longer has a Release file
time to upgrade entire system
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
Show which services need restarting
needrestart -rl
Service restarts being deferred
Probably services like networkd-dispatcher.service. Check /etc/needrestart/needrestart.conf for $nrconf{override_rc}
