[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1027276: apt: "apt install" should run "apt update" when some repositories metadata have not been fetched



Package: apt
Version: 2.5.4
Severity: wishlist
User: devel@kali.org
Usertags: origin-kali
X-Debbugs-Cc: arnaudr@kali.org, raphael@offensive-security.com

Hello,

there are many cases where apt will not have fetched any repository
information yet:
- first run of a container (no metadata fetched to keep container small)
- when the user has manually added a new repository to sources.list
- when running from a live image
- other kind of fresh installation without network

In those situations, itt would be nice if apt could be smarter than this:

┌──(root㉿carbon)-[/work]
└─# apt install nano
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package nano is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'nano' has no installation candidate

Apt could, for instance, inform the user that some repository information
is missing and propose to run it for them.

# apt install nano
Apt is lacking metadata for some repositories. The missing metadata
can be downloaded by running "apt update".
Do you want to execute this command? [Y/n/q]
Get:1 ....
[...]
Fetched 41.8 MB in 15s (2782 kB/s)
The following NEW packages will be installed:
  nano
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
[...]

Typing "q" would "quit" the whole process. "Y" would run apt update and
then follow with the requested installation. "n" would skip apt update and
still try to perform the installation.

-- System Information:
Debian Release: bookworm/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-6-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages apt depends on:
ii  adduser                 3.129
ii  base-passwd             3.6.1
ii  debian-archive-keyring  2021.1.1
ii  gpgv                    2.2.40-1
ii  libapt-pkg6.0           2.5.4
ii  libc6                   2.36-6
ii  libgcc-s1               12.2.0-9.1
ii  libgnutls30             3.7.8-4
ii  libseccomp2             2.5.4-1+b2
ii  libstdc++6              12.2.0-9.1
ii  libsystemd0             252.3-1

Versions of packages apt recommends:
ii  ca-certificates  20211016

Versions of packages apt suggests:
ii  apt-doc         2.5.4
ii  aptitude        0.8.13-5
ii  dpkg-dev        1.21.12
ii  gnupg           2.2.40-1
ii  powermgmt-base  1.37
ii  synaptic        0.91.2

-- no debconf information

Reply to: