如何为 Ubuntu 获取 gvedit (GVEdit 图形文件编辑器)?

如何为 Ubuntu 获取 gvedit (GVEdit 图形文件编辑器)?

官方有链接GraphViz 文档页面手册页实用性gvedit

姓名
gvedit− 简单的图形编辑器和查看器

但有趣的是 - 这个实用程序不包含在官方 Ubuntu 软件包中

我举报了错误 1784224 到启动板关于错过的可执行文件。

如何为 Ubuntu 获取 gvedit (GVEdit 图形文件编辑器)?

答案1

问题是由于debian/control文件- 它不包含 GUI - Qt 的构建依赖项。

在 Ubuntu 16.04.6 LTS 或 18.04.2 LTS 系统上从源代码编译包gvedit会将可执行文件安装到其中。

首先,我们需要源代码存储库,在“软件和更新”(software-properties-gtk)中,运行以下命令:

sudo apt-get install devscripts libqt4-dev
sudo apt-get build-dep graphviz

cd ~/Downloads
apt-get source --build graphviz
sudo apt-get install ./*.deb

结果,gvedit文件已到位并在 APT 数据库中注册:

$ dpkg -S gvedit
graphviz: /usr/share/man/man1/gvedit.1.gz
graphviz-doc: /usr/share/doc/graphviz/pdf/gvedit.1.pdf
graphviz: /usr/bin/gvedit

GVEdit 应用程序似乎运行正常:

16.04 LTS 上的 GVEdit 窗口

但终端显示错误:

Could not open attribute name file "/usr/share/graphviz/gvedit/attrs.txt" for reading

我们可以通过从源包中复制此文件来解决这个问题:

sudo mkdir -p /usr/share/graphviz/gvedit/
cd ~/Downloads
sudo cp graphviz-*/doc/infosrc/attrs /usr/share/graphviz/gvedit/attrs.txt

我们需要固定自编译的软件包以防止其升级(以及丢失gvedit):

sudo tee /etc/apt/preferences.d/pin-gv >/dev/null <<EOF
Package: graphviz
Pin: release a=now
Pin-Priority: 1337

Package: graphviz-dev
Pin: release a=now
Pin-Priority: 1337

Package: graphviz-doc
Pin: release a=now
Pin-Priority: 1337

Package: libcdt5
Pin: release a=now
Pin-Priority: 1337

Package: libcgraph6
Pin: release a=now
Pin-Priority: 1337

Package: libgraphviz-dev
Pin: release a=now
Pin-Priority: 1337

Package: libgvc6
Pin: release a=now
Pin-Priority: 1337

Package: libgvc6-plugins-gtk
Pin: release a=now
Pin-Priority: 1337

Package: libgv-guile
Pin: release a=now
Pin-Priority: 1337

Package: libgv-lua
Pin: release a=now
Pin-Priority: 1337

Package: libgv-perl
Pin: release a=now
Pin-Priority: 1337

Package: libgvpr2
Pin: release a=now
Pin-Priority: 1337

Package: libgv-python
Pin: release a=now
Pin-Priority: 1337

Package: libgv-ruby
Pin: release a=now
Pin-Priority: 1337

Package: libgv-tcl
Pin: release a=now
Pin-Priority: 1337

Package: libpathplan4
Pin: release a=now
Pin-Priority: 1337

Package: libxdot4
Pin: release a=now
Pin-Priority: 1337

# for 18.04 LTS
Package: libgv-php7
Pin: release a=now
Pin-Priority: 1337

Package: liblab-gamut1
Pin: release a=now
Pin-Priority: 1337

Package: python3-gv
Pin: release a=now
Pin-Priority: 1337

Package: python-gv
Pin: release a=now
Pin-Priority: 1337

EOF

答案2

这是为了补充@magjac 的答案。我知道这个答案适用于 Ubuntu 20,但我还是在这里发布了它,因为这是我在 Ubuntu 上找到的关于 gvedit 的唯一帖子,它应该适用于 Ubuntu 18。

以下是我的安装步骤:

#dependancy installation
sudo apt install freeglut3 libglade2-0 libgtkglext1 libpangox-1.0-0 libdevil1c2 liblasi0 libpoppler-glib8 liballegro4.4

wget https://www2.graphviz.org/Packages/stable/ubuntu/20.04/os/x86_64/libgraphviz4_2.44.1-1_amd64.deb
wget https://www2.graphviz.org/Packages/stable/ubuntu/20.04/os/x86_64/graphviz_2.44.1-1_amd64.deb

sudo dpkg -i libgraphviz4_2.44.1-1_amd64.deb
sudo dpkg -i graphviz_2.44.1-1_amd64.deb

显然,版本号会随着时间而变化,并且您的依赖关系可能与我的不同。

也可能可以sudo apt -f install根据此处的答案来获取依赖项:https://linuxhint.com/install_deb_file_ubuntu/

答案3

Graphviz 版本包含gvedit以下内容:https://www2.graphviz.org/Packages/stable/ubuntu/

相关内容