嘗試安裝 torch 時出現「E:無法找到套件 libqt4-dev」(Ubuntu 22.04)

嘗試安裝 torch 時出現「E:無法找到套件 libqt4-dev」(Ubuntu 22.04)

我正在嘗試安裝火炬對於imagelua的包。當我運行bash install-deps命令時,我收到此錯誤:

...
E: The repository 'https://ppa.launchpadcontent.net/rock-core/qt4/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Some portion of the update is failed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'git' instead of 'git-core'
Note, selecting 'libncurses-dev' instead of 'ncurses-dev'
Package ipython is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package libqt4-dev
E: Package 'ipython' has no installation candidate

我使用這個答案添加了 Qt4 庫 PPA問題,但是當我運行這些命令時:

sudo apt update
sudo apt install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4

我收到此錯誤:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libqtcore4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libqt5core5a:i386 libqt5core5a qtchooser:i386 qtchooser

Package libqtgui4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package qt4-dev-tools
E: Unable to locate package libqt4-dev
E: Package 'libqtcore4' has no installation candidate
E: Package 'libqtgui4' has no installation candidate

也提到我ipython根據這個答案安裝問題,但我仍然收到錯誤。

答案1

我認為這些錯誤與您是否安裝“ipython”無關。我遇到了同樣的錯誤(“無法找到套件 libqt4-dev」)在安裝「libqt4-dev」時(我想使用qt5,我的環境是Ubuntu22.04也)。我找到的解決方案是新增一個新的「add-apt-repository」:

$sudo add-apt-repository ppa:ubuntuhandbook1/ppa
$sudo apt-get update

然後運行命令:

$sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4

我希望這對您有幫助。

相關內容