Friday, September 22, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  1] [ 0]  / answers: 1 / hits: 45370  / 2 Years ago, wed, january 26, 2022, 12:24:23

How can I get a 'verbose' exit code for apt-get so that errors like this

Package google-chrome is a virtual package provided by:
google-chrome-stable 29.0.1547.76-r223446
google-chrome-beta 30.0.1599.47-1
You should explicitly select one to install.

E: Package 'google-chrome' has no installation candidate

have a different exit code than download errors like this

Err stable/main google-chrome-stable amd64 29.0.1547.76-r223446
Something wicked happened resolving '' (-11 - System error)

Currently, both errors exit with 100

Basically, I'd like to have download errors exit with a different code than errors like the first. If possible, I'd like each specific error to have a different exit code, but the above example is the minimum I need. How can I do this in a vanilla Ubuntu install without additional software (with the exception of aptitude)?

More From » apt


Not a complete answer, but you could test for the existence of packages first by doing apt-cache policy X and grepping the output for "Candidate (none)" or "Couldn't find package X", etc.

[#29357] Thursday, January 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 120
Total Questions: 126
Total Answers: 119

Location: Marshall Islands
Member since Wed, Feb 9, 2022
2 Years ago
gavgenerati questions
Wed, Jun 22, 22, 17:24, 1 Year ago
Fri, Jul 30, 21, 04:32, 2 Years ago
Fri, Jan 14, 22, 14:20, 2 Years ago
Tue, Jul 27, 21, 19:05, 2 Years ago