Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 1363  / 3 Years ago, tue, september 14, 2021, 5:36:24

How can I stop Apt from marking packages as manual when you run the "apt install " command?


For example, Accidentally, when I run apt install <package-which-is-already-there> (of a package which is already there), it marks the package as manually installed.


Which I hate a lot. How can I stop apt from doing this? It even messes up things sometimes.


More From » apt

 Answers
3

Aside from the remedy provided by @user535733, you can always check before installing what the apt will do by simulating the install using the -s flag:


apt install -s <package-which-is-already-there>

If the package is already installed you will get a line like this:



<package-which-is-already-there> is already the newest version (<version>).

From the man page man apt-get:



-s, --simulate, --just-print, --dry-run, --recon, --no-act
No action; perform a simulation of events that would occur based on the
current system state but do not actually change the system. Locking will be
disabled (Debug::NoLocking) so the system state could change while apt-get
is running. Simulations can also be executed by non-root users which might
not have read access to all apt configuration distorting the simulation. A
notice expressing this warning is also shown by default for non-root users
(APT::Get::Show-User-Simulation-Note). Configuration Item:
APT::Get::Simulate.

Simulated runs print out a series of lines, each representing a dpkg
operation: configure (Conf), remove (Remv) or unpack (Inst). Square brackets
indicate broken packages, and empty square brackets indicate breaks that are
of no consequence (rare).

[#2157] Thursday, September 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tigehanc

Total Points: 162
Total Questions: 113
Total Answers: 122

Location: Zambia
Member since Sat, Oct 31, 2020
4 Years ago
tigehanc questions
Thu, Dec 22, 22, 01:47, 1 Year ago
Sat, Aug 28, 21, 03:26, 3 Years ago
Fri, Feb 10, 23, 05:50, 1 Year ago
;