如何在 Windows 上设置 apt-offline

如何在 Windows 上设置 apt-offline

apt-离线声称是一款允许你在没有互联网连接的情况下在 Debian 上安装软件包的实用程序。它可以下载来自 git 存储库。
与许多免费软件一样,问题在于它没有文档记录,而且您必须自己构建它。在我链接到的 git 存储库中,有一个信息文件INSTALL

# Execute the file using the python interpreter
# Assuming python.exe is in your path

# To build
C:\> python setup.py build

# To install
C:\> python setup.py install

我运行了 build 然后安装。我可以看到 Python 输出了一些解析错误。我希望这些不会有什么影响。无论如何,我最终只得到了几个没有扩展名的文件夹和几个文件(为什么有些人总是省略扩展名?)。

所以我的问题是如何正确构建和安装该实用程序 - 假设它是可能的。(和这个问题表明这是有可能的)

答案1

我刚刚在 Windows XP 机器上安装了它,如下所示:-

安装Python 2.7。请确保您选择了正确的架构(32/64 位)。选择添加到路径的选项,python.exe因为它将使以后的操作更加简单。

安装适用于 PyQt4 的. 再次确保为你的 Windows 选择了正确的架构。

下载apt-离线。将其解压到 C:\ 驱动器。该文件夹将被命名为apt-offline-master- 将其重命名为,apt-offline以节省您稍后的输入。

打开 Windows 终端。输入以下内容:-

 cd c:\apt-offline
 python setup.py build
 python setup.py install
 python apt-offline-gui

答案2

截至 2024 年更新。 我在 Portable Msys2 下工作,但我想这没什么区别。的当前版本apt-offline似乎依赖于 PyQt5,而不是 PyQt4。因此,使用 python 3.8,我构建并安装了(部分?)成功,请参见下面的输出。然后,命令行apt-offline似乎可以工作,但 gui 不行。这很可能是我的系统的问题,而不是安装程序的问题:

$ python3 apt-offline
usage: apt-offline [-h] [--verbose] [--quiet] [-v] {set,get,install} ...

Offline APT Package Manager - 1.8.5

positional arguments:
  {set,get,install}

optional arguments:
  -h, --help         show this help message and exit
  --verbose          Enable verbose messages
  --quiet            Enable quiet mode
  -v, --version      show program's version number and exit

(C) 2005 - 2022 Ritesh Raj Sarraf - This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the GNU GPL
Version 3 (or later) License

$ python3 apt-offline-gui
Traceback (most recent call last):
  File "apt-offline-gui", line 27, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: cannot import name 'QtCore' from 'PyQt5' (/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.8/site-packages/PyQt5/__init__.py)

或者可能暗示了错误的原因,但我没有进一步尝试。

有关的

  1. Windows 上的 apt-offline

构建/安装的输出

$ python3 setup.py build
running build
running build_py
file apt_offline_gui/resources_rc.py (for module apt_offline_gui.resources_rc) not found
file apt_offline_gui/Ui_AptOfflineQtAbout.py (for module apt_offline_gui.Ui_AptOfflineQtAbout) not found
file apt_offline_gui/Ui_AptOfflineQtCreateProfile.py (for module apt_offline_gui.Ui_AptOfflineQtCreateProfile) not found
file apt_offline_gui/Ui_AptOfflineQtFetch.py (for module apt_offline_gui.Ui_AptOfflineQtFetch) not found
file apt_offline_gui/Ui_AptOfflineQtFetchOptions.py (for module apt_offline_gui.Ui_AptOfflineQtFetchOptions) not found
file apt_offline_gui/Ui_AptOfflineQtInstall.py (for module apt_offline_gui.Ui_AptOfflineQtInstall) not found
file apt_offline_gui/Ui_AptOfflineQtInstallBugList.py (for module apt_offline_gui.Ui_AptOfflineQtInstallBugList) not found
file apt_offline_gui/Ui_AptOfflineQtInstallChangelog.py (for module apt_offline_gui.Ui_AptOfflineQtInstallChangelog) not found
file apt_offline_gui/Ui_AptOfflineQtMain.py (for module apt_offline_gui.Ui_AptOfflineQtMain) not found
file apt_offline_gui/Ui_AptOfflineQtSaveZip.py (for module apt_offline_gui.Ui_AptOfflineQtSaveZip) not found
file apt_offline_gui/resources_rc.py (for module apt_offline_gui.resources_rc) not found
file apt_offline_gui/Ui_AptOfflineQtAbout.py (for module apt_offline_gui.Ui_AptOfflineQtAbout) not found
file apt_offline_gui/Ui_AptOfflineQtCreateProfile.py (for module apt_offline_gui.Ui_AptOfflineQtCreateProfile) not found
file apt_offline_gui/Ui_AptOfflineQtFetch.py (for module apt_offline_gui.Ui_AptOfflineQtFetch) not found
file apt_offline_gui/Ui_AptOfflineQtFetchOptions.py (for module apt_offline_gui.Ui_AptOfflineQtFetchOptions) not found
file apt_offline_gui/Ui_AptOfflineQtInstall.py (for module apt_offline_gui.Ui_AptOfflineQtInstall) not found
file apt_offline_gui/Ui_AptOfflineQtInstallBugList.py (for module apt_offline_gui.Ui_AptOfflineQtInstallBugList) not found
file apt_offline_gui/Ui_AptOfflineQtInstallChangelog.py (for module apt_offline_gui.Ui_AptOfflineQtInstallChangelog) not found
file apt_offline_gui/Ui_AptOfflineQtMain.py (for module apt_offline_gui.Ui_AptOfflineQtMain) not found
file apt_offline_gui/Ui_AptOfflineQtSaveZip.py (for module apt_offline_gui.Ui_AptOfflineQtSaveZip) not found
running build_scripts
creating build/scripts-3.8
copying and adjusting apt-offline -> build/scripts-3.8
copying and adjusting apt-offline-gui -> build/scripts-3.8
copying apt-offline-gui-pkexec -> build/scripts-3.8

$ python3 setup.py install
running install
running build
running build_py
file apt_offline_gui/resources_rc.py (for module apt_offline_gui.resources_rc) not found
file apt_offline_gui/Ui_AptOfflineQtAbout.py (for module apt_offline_gui.Ui_AptOfflineQtAbout) not found
file apt_offline_gui/Ui_AptOfflineQtCreateProfile.py (for module apt_offline_gui.Ui_AptOfflineQtCreateProfile) not found
file apt_offline_gui/Ui_AptOfflineQtFetch.py (for module apt_offline_gui.Ui_AptOfflineQtFetch) not found
file apt_offline_gui/Ui_AptOfflineQtFetchOptions.py (for module apt_offline_gui.Ui_AptOfflineQtFetchOptions) not found
file apt_offline_gui/Ui_AptOfflineQtInstall.py (for module apt_offline_gui.Ui_AptOfflineQtInstall) not found
file apt_offline_gui/Ui_AptOfflineQtInstallBugList.py (for module apt_offline_gui.Ui_AptOfflineQtInstallBugList) not found
file apt_offline_gui/Ui_AptOfflineQtInstallChangelog.py (for module apt_offline_gui.Ui_AptOfflineQtInstallChangelog) not found
file apt_offline_gui/Ui_AptOfflineQtMain.py (for module apt_offline_gui.Ui_AptOfflineQtMain) not found
file apt_offline_gui/Ui_AptOfflineQtSaveZip.py (for module apt_offline_gui.Ui_AptOfflineQtSaveZip) not found
file apt_offline_gui/resources_rc.py (for module apt_offline_gui.resources_rc) not found
file apt_offline_gui/Ui_AptOfflineQtAbout.py (for module apt_offline_gui.Ui_AptOfflineQtAbout) not found
file apt_offline_gui/Ui_AptOfflineQtCreateProfile.py (for module apt_offline_gui.Ui_AptOfflineQtCreateProfile) not found
file apt_offline_gui/Ui_AptOfflineQtFetch.py (for module apt_offline_gui.Ui_AptOfflineQtFetch) not found
file apt_offline_gui/Ui_AptOfflineQtFetchOptions.py (for module apt_offline_gui.Ui_AptOfflineQtFetchOptions) not found
file apt_offline_gui/Ui_AptOfflineQtInstall.py (for module apt_offline_gui.Ui_AptOfflineQtInstall) not found
file apt_offline_gui/Ui_AptOfflineQtInstallBugList.py (for module apt_offline_gui.Ui_AptOfflineQtInstallBugList) not found
file apt_offline_gui/Ui_AptOfflineQtInstallChangelog.py (for module apt_offline_gui.Ui_AptOfflineQtInstallChangelog) not found
file apt_offline_gui/Ui_AptOfflineQtMain.py (for module apt_offline_gui.Ui_AptOfflineQtMain) not found
file apt_offline_gui/Ui_AptOfflineQtSaveZip.py (for module apt_offline_gui.Ui_AptOfflineQtSaveZip) not found
running build_scripts
running install_lib
creating /usr/lib/python3.8/site-packages/apt_offline_core
copying build/lib/apt_offline_core/AptOfflineCoreLib.py -> /usr/lib/python3.8/site-packages/apt_offline_core
copying build/lib/apt_offline_core/AptOfflineDebianBtsLib.py -> /usr/lib/python3.8/site-packages/apt_offline_core
copying build/lib/apt_offline_core/AptOfflineLib.py -> /usr/lib/python3.8/site-packages/apt_offline_core
copying build/lib/apt_offline_core/AptOfflineMagicLib.py -> /usr/lib/python3.8/site-packages/apt_offline_core
copying build/lib/apt_offline_core/__init__.py -> /usr/lib/python3.8/site-packages/apt_offline_core
creating /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtAbout.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtCommon.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtCreateProfile.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtFetch.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtFetchOptions.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtInstall.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtInstallBugList.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtInstallChangelog.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtMain.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/AptOfflineQtSaveZip.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/QtProgressBar.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/UiDataStructs.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
copying build/lib/apt_offline_gui/__init__.py -> /usr/lib/python3.8/site-packages/apt_offline_gui
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_core/AptOfflineCoreLib.py to AptOfflineCoreLib.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_core/AptOfflineDebianBtsLib.py to AptOfflineDebianBtsLib.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_core/AptOfflineLib.py to AptOfflineLib.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_core/AptOfflineMagicLib.py to AptOfflineMagicLib.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_core/__init__.py to __init__.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtAbout.py to AptOfflineQtAbout.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtCommon.py to AptOfflineQtCommon.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtCreateProfile.py to AptOfflineQtCreateProfile.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtFetch.py to AptOfflineQtFetch.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtFetchOptions.py to AptOfflineQtFetchOptions.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtInstall.py to AptOfflineQtInstall.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtInstallBugList.py to AptOfflineQtInstallBugList.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtInstallChangelog.py to AptOfflineQtInstallChangelog.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtMain.py to AptOfflineQtMain.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/AptOfflineQtSaveZip.py to AptOfflineQtSaveZip.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/QtProgressBar.py to QtProgressBar.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/UiDataStructs.py to UiDataStructs.cpython-38.pyc
byte-compiling /usr/lib/python3.8/site-packages/apt_offline_gui/__init__.py to __init__.cpython-38.pyc
running install_scripts
copying build/scripts-3.8/apt-offline -> /usr/bin
copying build/scripts-3.8/apt-offline-gui -> /usr/bin
changing mode of /usr/bin/apt-offline to 755
changing mode of /usr/bin/apt-offline-gui to 755
changing mode of /usr/bin/apt-offline-gui-pkexec to 755
running install_egg_info
Writing /usr/lib/python3.8/site-packages/apt_offline-1.8.5-py3.8.egg-info

相关内容