4

If I run apt-cache show nonexistent, I get this error:

N: Unable to locate package nonexistent
E: No packages found

I know the E stands for "Error", and a W would stand for "Warning", but what does the N stand for? "Information"?

Are there other letters that may show up?

I couldn't find anything in man apt-cache, man apt, or man apt-get.

P.s. This came up because of this question: Bash file redirection bug?

wjandrea
  • 14,504

1 Answers1

4

Letters designate error message type. By looking at the apt-cache C++ source code and the related error.cc file, there's apparently different types of errors:

  • GEMessage(FatalE, FATAL)
  • GEMessage(Errno, ERROR)
  • GEMessage(WarningE, WARNING)
  • GEMessage(NoticeE, NOTICE)
  • GEMessage(DebugE, DEBUG)

The errors are pushed onto message stack via _error->Insert method which in the apt-cache source is apparently an "alias" for GlobalError::Insert method.

Interestingly enough there's also CacheSetHelper which sets whether to show errors or not. That defaults to showing errors in the constructor for this class, and message type to ERROR.