Quantcast
Viewing all articles
Browse latest Browse all 2849

Installation • Re: Preparing To Upgrade From Buster to Bookworm

Hello,
Thank you @bbhitz and @Aki for your comments. I agree that the Debian release notes are far more comprehensive than the Linux Patch I referred to. At best it provides an overview of the procedure.

Working my way through the Buster release notes I find in Section 4.4.4 Minimal System Upgrade the command:

Code:

 apt upgrade --without-new-pkgs
Is there any documentation for the option without-new-pkgs? I cannot see this in the manuals for apt or apt-get or any of the config files.
That's a interesting question.

The documentation for the --without-new-pkgs option is not in the manual page, indeed.

On the contrary, the oppsite option --with-new-pkgs is documented [1]:
--with-new-pkgs
Allow installing new packages when used in conjunction with upgrade. This is useful if the update of an installed package requires new dependencies to be installed. Instead of holding the package back upgrade will upgrade the package and install the new dependencies. Note that upgrade with this option will never remove packages, only allow adding new ones. Configuration Item: APT::Get::Upgrade-Allow-New.

and it matches the apt configuration item:

Code:

APT::Get::Upgrade-Allow-New
Searching the source code of the apt package, I found that the options starting with the prefix --with or --without are treated as a logical option with respect to the corresponding options after the prefix ("new-pkgs", in this case):

Code:

// StringToBool - Converts a string into a boolean/*{{{*/// ---------------------------------------------------------------------/* This inspects the string to see if it is true or if it is false and   then returns the result. Several variants on true/false are checked. */int StringToBool(const string &Text,int Default){   char *ParseEnd;   int Res = strtol(Text.c_str(),&ParseEnd,0);   // ensure that the entire string was converted by strtol to avoid   // failures on "apt-cache show -a 0ad" where the "0" is converted   const char *TextEnd = Text.c_str()+Text.size();   if (ParseEnd == TextEnd && Res >= 0 && Res <= 1)      return Res;      // Check for positives   if (strcasecmp(Text.c_str(),"no") == 0 ||       strcasecmp(Text.c_str(),"false") == 0 ||       strcasecmp(Text.c_str(),"without") == 0 ||       strcasecmp(Text.c_str(),"off") == 0 ||       strcasecmp(Text.c_str(),"disable") == 0)      return 0;      // Check for negatives   if (strcasecmp(Text.c_str(),"yes") == 0 ||       strcasecmp(Text.c_str(),"true") == 0 ||       strcasecmp(Text.c_str(),"with") == 0 ||       strcasecmp(Text.c_str(),"on") == 0 ||       strcasecmp(Text.c_str(),"enable") == 0)      return 1;      return Default;}
So I assume that the --without-new-pkg option argument means that the APT::Get::Upgrade-Allow-New apt configuration item is not set.

Consider that the apt upgrade command includes as default the --with-new-pkgs option [3][4]:

Code:

[..]static void BinarySpecificConfiguration(char const * const Binary)/*{{{*/{   std::string const binary = flNotDir(Binary);   if (binary == "apt-cdrom" || binary == "apt-config")   {      _config->CndSet("Binary::apt-cdrom::APT::Internal::OpProgress::EraseLines", false);   }   if (binary == "apt" || binary == "apt-config")   {      if (getenv("NO_COLOR") == nullptr && getenv("APT_NO_COLOR") == nullptr) _config->CndSet("Binary::apt::APT::Color", true);      _config->CndSet("Binary::apt::APT::Output-Version", 30);      _config->CndSet("Binary::apt::APT::Cache::Show::Version", 2);      _config->CndSet("Binary::apt::APT::Cache::AllVersions", false);      _config->CndSet("Binary::apt::APT::Cache::ShowVirtuals", true);      _config->CndSet("Binary::apt::APT::Cache::Search::Version", 2);      _config->CndSet("Binary::apt::APT::Cache::ShowDependencyType", true);      _config->CndSet("Binary::apt::APT::Cache::ShowVersion", true);      _config->CndSet("Binary::apt::APT::Get::Upgrade-Allow-New", true);      _config->CndSet("Binary::apt::APT::Cmd::Show-Update-Stats", true);      _config->CndSet("Binary::apt::DPkg::Progress-Fancy", true);      _config->CndSet("Binary::apt::APT::Keep-Downloaded-Packages", false);      _config->CndSet("Binary::apt::APT::Get::Update::InteractiveReleaseInfoChanges", true);      _config->CndSet("Binary::apt::APT::Cmd::Pattern-Only", true);      _config->CndSet("Binary::apt::Pager", true);      if (isatty(STDIN_FILENO))         _config->CndSet("Binary::apt::Dpkg::Lock::Timeout", -1);      else         _config->CndSet("Binary::apt::Dpkg::Lock::Timeout", 120);   }   _config->Set("Binary", binary);}[..]static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const * const Cmd)/*{{{*/{   if (CmdMatches("install", "reinstall", "remove", "purge", "upgrade", "dist-upgrade",    "dselect-upgrade", "autoremove", "autopurge", "full-upgrade"))   {      addArg(0, "show-progress", "DpkgPM::Progress", 0);      addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0);      addArg(0, "purge", "APT::Get::Purge", 0);      addArg('V',"verbose-versions", "APT::Get::Show-Versions",0);      addArg(0, "list-columns", "APT::Get::List-Columns", 0);      addArg(0, "autoremove", "APT::Get::AutomaticRemove", 0);      addArg(0, "auto-remove", "APT::Get::AutomaticRemove", 0);      addArg(0, "reinstall", "APT::Get::ReInstall", 0);      addArg(0, "solver", "APT::Solver", CommandLine::HasArg);      addArg(0, "strict-pinning", "APT::Solver::Strict-Pinning", 0);      addArg(0, "planner", "APT::Planner", CommandLine::HasArg);      addArg(0, "comment", "APT::History::Comment", CommandLine::HasArg);      addArg('U', "update", "APT::Update", 0);      if (CmdMatches("upgrade"))      {         addArg(0, "new-pkgs", "APT::Get::Upgrade-Allow-New",                 CommandLine::Boolean);      }   }
I have tried to find exactly where in the apt code the "--without-new-pkgs" is detected, but I haven't found it yet.

Hope this helps.

--
[1] apt-get - APT package handling utility -- command-line interface
[2] StringToBool - Converts a string into a boolean
[3] static void BinarySpecificConfiguration(char const * const Binary)
[4] static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const * const Cmd)

Statistics: Posted by Aki — 2025-02-15 13:33



Viewing all articles
Browse latest Browse all 2849

Trending Articles