Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using apt --version doesn't work at Linux Mint #52

Closed
autinerd opened this issue Jul 18, 2019 · 1 comment · Fixed by #57
Closed

Using apt --version doesn't work at Linux Mint #52

autinerd opened this issue Jul 18, 2019 · 1 comment · Fixed by #57
Labels
🐛 bug Something isn't working, or a fix is proposed 📦 manager: dpkg-based apt, apt-mint, opkg 🖥 platform: Linux Linux, Windows Subsystem for Linux v2

Comments

@autinerd
Copy link
Contributor

autinerd commented Jul 18, 2019

Because apt works a bit different in Linux Mint, apt --version doesn't work and crashes mpm managers

Error log:

Traceback (most recent call last):
  File "/usr/local/bin/mpm", line 10, in <module>
    sys.exit(cli())
  File "/home/sidney/.local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/sidney/.local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/sidney/.local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/sidney/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/sidney/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/sidney/.local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/meta_package_manager/cli.py", line 212, in managers
    version_infos = OK if manager.fresh else KO
  File "/usr/local/lib/python3.6/dist-packages/boltons/cacheutils.py", line 610, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python3.6/dist-packages/meta_package_manager/base.py", line 177, in fresh
    if not self.version:
  File "/usr/local/lib/python3.6/dist-packages/boltons/cacheutils.py", line 610, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python3.6/dist-packages/meta_package_manager/base.py", line 140, in version
    if self.version_string:
  File "/usr/local/lib/python3.6/dist-packages/boltons/cacheutils.py", line 610, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python3.6/dist-packages/meta_package_manager/base.py", line 130, in version_string
    version = self.get_version()
  File "/usr/local/lib/python3.6/dist-packages/meta_package_manager/managers/apt.py", line 56, in get_version
    return output.split('\n')[0].split()[1]
IndexError: list index out of range

apt --version returns:

$ apt --version
apt
Usage: apt command [options]
       apt help command [options]

Commands:
  add-repository   - Add entries to apt sources.list
  autoclean        - Erase old downloaded archive files
  autoremove       - Remove automatically all unused packages
  build            - Build binary or source packages from sources
  build-dep        - Configure build-dependencies for source packages
  changelog        - View a package's changelog
  check            - Verify that there are no broken dependencies
  clean            - Erase downloaded archive files
  contains         - List packages containing a file
  content          - List files contained in a package
  deb              - Install a .deb package
  depends          - Show raw dependency information for a package
  dist-upgrade     - Upgrade the system by removing/installing/upgrading packages
  download         - Download the .deb file for a package
  edit-sources     - Edit /etc/apt/sources.list with your preferred text editor
  dselect-upgrade  - Follow dselect selections
  full-upgrade     - Same as 'dist-upgrade'
  held             - List all held packages
  help             - Show help for a command
  hold             - Hold a package
  install          - Install/upgrade packages
  list             - List packages based on package names
  policy           - Show policy settings
  purge            - Remove packages and their configuration files
  recommends       - List missing recommended packages for a particular package
  rdepends         - Show reverse dependency information for a package
  reinstall        - Download and (possibly) reinstall a currently installed package
  remove           - Remove packages
  search           - Search for a package by name and/or expression
  show             - Display detailed information about a package
  showhold         - Same as 'held'
  source           - Download source archives
  sources          - Same as 'edit-sources'
  unhold           - Unhold a package
  update           - Download lists of new/upgradable packages
  upgrade          - Perform a safe upgrade
  version          - Show the installed version of a package

apt version apt returns the version

$ apt version apt
1.6.11
@autinerd autinerd changed the title Using "apt version" doesn't work at Linux Mint Using "apt --version" doesn't work at Linux Mint Jul 18, 2019
kdeldycke added a commit that referenced this issue Mar 18, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2020
@kdeldycke kdeldycke added 📦 manager: dpkg-based apt, apt-mint, opkg 🖥 platform: Linux Linux, Windows Subsystem for Linux v2 🐛 bug Something isn't working, or a fix is proposed labels Dec 20, 2020
@kdeldycke kdeldycke changed the title Using "apt --version" doesn't work at Linux Mint Using apt --version doesn't work at Linux Mint Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working, or a fix is proposed 📦 manager: dpkg-based apt, apt-mint, opkg 🖥 platform: Linux Linux, Windows Subsystem for Linux v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants