Getting dependency error when trying to install packages such as vim to noble chroot
I'm getting dependency conflict when trying to install packages such as vim to Ubuntu Noble chroot. The dependency version it wants is older then what is available in repositories. Running apt-get install vim fails with error as shown below, with workaround inluded near the end of this post:
(chroot) $ sudo apt-get install vim
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
vim : Depends: vim-common (= 2:9.1.0016-
Depends: vim-runtime (= 2:9.1.0016-
E: Unable to correct problems, you have held broken packages.
Apt-cache policy shows older version of vim available while in launchpad the newer version is shown, also the amd64 package version 2:9.1.0016-1ubuntu6 is missing from repositories, no amd64 deb within repository pool directory of repository files
(chroot) $ apt-cache policy vim
vim:
Installed: (none)
Candidate: 2:9.1.0016-1ubuntu3
Version table:
2:
500 http://
If vim was installed before, it would be uninstalled by upgrading vim-common and vim-runtime
My sources list file:
(chroot) $ cat /etc/apt/
deb http://
deb http://
deb http://
deb http://
Contents of /etc/lsb-release
(chroot) $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
Host is Ubuntu 22.04 LTS, using schroot 1.6.10 to access Ubuntu Noble chroot
Edit: This is caused by broken apt repositories for Ubuntu Noble caused by mitigation of the related cve not yet being completed.
Workaround: Add pinning override to apt config to make noble-updates be more prefered than noble by also allowing downgrade to older version that might be uploaded later than the compromised ones.
To do that, add an apt pinning override, e.g. create a new file in /etc/apt/
Package: *
Pin: release a=noble-updates
Pin-Priority: 1002
Package: *
Pin: release a=noble
Pin-Priority: 1001
Apt cache policy should return something like this:
Package files:
100 /var/lib/
release a=now
1002 http://
release v=24.04,
origin archive.ubuntu.com
1002 http://
release v=24.04,
origin archive.ubuntu.com
1002 http://
release v=24.04,
origin archive.ubuntu.com
1002 http://
release v=24.04,
origin archive.ubuntu.com
1001 http://
release v=24.04,
origin archive.ubuntu.com
1001 http://
release v=24.04,
origin archive.ubuntu.com
1001 http://
release v=24.04,
origin archive.ubuntu.com
1001 http://
release v=24.04,
origin archive.ubuntu.com
Pinned packages:
Also don't forget to check for obsolete packages by running apt list ?obsolete and remove them or install an alternative dependency if needed by checking package depends by running apt-cache depends or something alike.
Finaly you can run apt upgrade and apt dist-upgrade then to "downgrade" versions to ones provided by -updates archive.
After package rebuild in repositories complete, repositories cleaned and dependencies resolved (e.g. packages in 'noble' archive are not newer than in 'noble-updates' and all required packages available in 'noble', a.k.a. main archive, no conflicts, etc.) it would be safe to remove file in /etc/apt/
Edit: added a newline between pinning rules above, w/o gap pinning might not work properly.
Edit2: The noble repositories appear now to fixed as correct dependencies are downloaded when installing it, also bootstrapping the release should work again as long as latest debootstrap version is used, before I could not ever bootstrap minbase w/o an error.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was originally filed as bug #2059862.
Can you help with this problem?
Provide an answer of your own, or ask Juozas Pocius for more information if necessary.