apt-get can not simulate

Bug #1399037 reported by Svivi
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi,

I just noticed that apt can not simulate in Ubuntu 14.04.1.

Updated:

sudo apt-get -s dselect-upgrade
E: Command line option 's' [from -s] is not known.

sudo apt-get --dry-run dselect-upgrade
E: Command line option --dry-run is not understood

sudo apt-get --recon dselect-upgrade
E: Command line option --recon is not understood

sudo apt-get --no-act dselect-upgrade
E: Command line option --no-act is not understood

sudo apt-get --simulate dselect-upgrade
E: Command line option --simulate is not understood

sudo apt-get --just-print dselect-upgrade
E: Command line option --just-print is not understood

The issue occures with at least the following versions of apt: 1.0.1ubuntu2.4.1, 1.0.1ubuntu2.5, 1.0.1ubuntu2.6
and 1.3.1 version of apt-offline.

It works fine on Ubuntu 12.04 with: apt 0.8.16~exp12ubuntu10.22 and without apt-offline.

Related branches

Svivi (svivi)
affects: apt-offline (Ubuntu) → apt (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Lacyc3 (lacyc3) wrote :

Ubuntu 14.10 also affected.

$ LANG="C" sudo apt-get -s dselect-update
E: Command line option 's' [from -s] is not known.

apt version: 1.0.9.2ubuntu2

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote : Re: [Bug 1399037] [NEW] apt-get can not simulate

On 12/04/2014 06:39 AM, Svivi wrote:
> Public bug reported:
>
> Hi,
>
> I just noticed that apt can not simulate in Ubuntu 14.04.1.
>
> sudo apt-get -s dselect-upgrade
> E: A(z) „s” parancssori kapcsoló [a következőből: -s] ismeretlen.
>
> sudo apt-get --dry-run dselect-upgrade
> E: --dry-run parancssori kapcsoló értelmezhetetlen
>
> sudo apt-get --recon dselect-upgrade
> E: --recon parancssori kapcsoló értelmezhetetlen
>
> sudo apt-get --just-print dselect-upgrade
> E: --just-print parancssori kapcsoló értelmezhetetlen
>
> sudo apt-get --just-print dselect-upgrade
> E: --just-print parancssori kapcsoló értelmezhetetlen
>
> sudo apt-get --just-print dselect-upgrade
> E: --just-print parancssori kapcsoló értelmezhetetlen
>
>
> The issue occures with at least the following versions of apt: 1.0.1ubuntu2.4.1, 1.0.1ubuntu2.5
> It works fine on Ubuntu 12.04 with: 0.8.16~exp12ubuntu10.22

What is the version of apt-offline you are using ? Also, I cannot make
out the non-english error message.
There were issues, that were fixed upstream in version 1.5 of apt-offline.

--
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."

Revision history for this message
Svivi (svivi) wrote :

I updated the description.

description: updated
Revision history for this message
Svivi (svivi) wrote :

I tried the apt-offline version 1.5 (on a Xubuntu 14.04.1) but nothing changed.

$ LANG="C" apt-cache policy apt
apt:
  Installed: 1.0.1ubuntu2.6
  Candidate: 1.0.1ubuntu2.6

$ LANG="C" apt-cache policy apt-offline
apt-offline:
  Installed: 1.5
  Candidate: 1.5

$ LANG="C" apt-get -s dselect-upgrade
E: Command line option 's' [from -s] is not known.

$ LANG="C" apt-get --dry-run dselect-upgrade
E: Command line option --dry-run is not understood

$ LANG="C" apt-get --recon dselect-upgrade
E: Command line option --recon is not understood

$ LANG="C" apt-get --no-act dselect-upgrade
E: Command line option --no-act is not understood

$ LANG="C" apt-get --simulate dselect-upgrade
E: Command line option --simulate is not understood

$ LANG="C" apt-get --just-print dselect-upgrade
E: Command line option --just-print is not understood

Revision history for this message
Bib (bybeu) wrote :

I remember the position of the -s (or --long-opt) was important: maybe apt-get command -s would work?
Also, the behaviour is different when simulating without (verbose) sudo an with sudo (less verbose)

Revision history for this message
Svivi (svivi) wrote :

Thanks for the advice but the position of the -s option had no effect:
$ LANG="C" apt-get dselect-upgrade -s
E: Command line option 's' [from -s] is not known.

The issue occures with and without sudo.

Revision history for this message
David Kalnischkies (donkult) wrote :

That's a fun one… You see, back in 2013 I remodeled the commandline parsing. The point was that an option (like -s) is only accepted if the command (e.g. dselect-upgrade) supports this option. Previously e.g. apt-get would accept any option even if it only has an effect for certain commands. Very dangerous as that made user believe they would actually have an effect…

Now, what happen back then is that I typoed "dselect" as "deselect", which made it not accept any option… Well, I was never using it, many others neither, so that went unnoticed for months, until someone reported that and (still in 2013) we fixed that. Over the years other similar things appeared (usually forgotten options or options which really had no effect) like the one mentioned here with apt-offline. Anyway, all nice and good right?

Well, expect that while the commit message back then indicates that Michael replaced ALL instances of 'deselect', he just fixed one instance. Another one was still in there, guarding some options: (drumroll) -s and friends. Quite telling how unused dselect is nowadays that this could hide itself for another (nearly) two years…

Will be fixed "soon" (= fixed in my branch, but that is unlikely to hit any release soon). Until then you can use -o APT::Get::Simulate=1 instead of -s (or the others like --dry-run). Or, well, don't simulate. ;)

Oh, and feel free to give me a compelling example of how to use it for good. Its totally underrepresented in our testcases, so if you want to prevent breakage of your usecase in the future…

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.0.9.9ubuntu1

---------------
apt (1.0.9.9ubuntu1) wily; urgency=low

  * merged from debian/sid

apt (1.0.9.9) unstable; urgency=medium

  [ David Kalnischkies ]
  * parse specific-arch dependencies correctly on single-arch systems
    (Closes: 777760)
  * remove "first package seen is native package" assumption.
    Thanks to Axel Beckert for testing (Closes: 782777)

apt (1.0.9.8) unstable; urgency=medium

  [ David Kalnischkies ]
  * fix another d(e)select-upgrade typo (LP: #1399037)
  * properly handle expected filesize in https.
    Thanks to Robert Edmonds and Anders Kaseorg for initial patchs
    (Closes: 777565, 781509) (LP: #807303)
  * avoid depends on std::string implementation for pkgAcquire::Item::Mode
    (Closes: 781858)
  * demote VectorizeString gcc attribute from const to pure
  * keyids in "apt-key del" should be case-insensitive (Closes: 781696)
  * parse specific-arch dependencies correctly on single-arch systems
    (Closes: 777760)

  [ Michael Vogt ]
  * fix crash in order writing in pkgDPkgPM::WriteApportReport() (LP: #1436626)

 -- Michael Vogt <email address hidden> Thu, 07 May 2015 10:40:54 +0200

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.