What do the letters stand for in APT errors?

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?

1

1 Answer

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.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like