How to install on ubuntu?
TraxXavier opened this issue ยท 19 comments
How can I use this tool on ubuntu or debian?
Cheers
Trax
Update: We now have an OBS repository for Debian and Ubuntu. Please prefer this rather than manual installation:
https://software.opensuse.org/download.html?project=home:vtrefny&package=blivet-gui
Unfortunately blivet-gui (and blivet) is not packaged for Ubuntu/Debian so you need to install it manually.
Really short howto, tested on fresh install of Ubuntu 18.04:
Dependecies of blivet and blivet-gui available from Ubuntu repositories:
sudo apt-get install python3-blockdev libblockdev* python3-bytesize python3-pyudev python3-parted python3-selinux adwaita-icon-theme-full lvm2-dbusd
Other dependencies can be installed using pip:
sudo apt-get install git python3-pip
sudo pip3 install pid
blivet and blivet-gui installation:
sudo pip3 install git+http://github.com/storaged-project/blivet.git@3.0-release
sudo pip3 install git+http://github.com/storaged-project/blivet-gui.git
Maybe the above should be a part of a file like INSTALL
here in the repo?
Iโm a Linux beginner, so possibly my question is odd. Does this solution work for debian stretch, too? And perhaps for all debian versions?
Does this solution work for debian stretch, too? And perhaps for all debian versions?
Unfortunately not, you need libblockdev and it is available only for buster and sid.
We are running tests on current testing (buster) so blivet-gui should work there.
Debian 10 "buster":
apt install python3-blockdev python3-bytesize python3-pyudev python3-selinux python3-parted lvm2-dbusd adwaita-icon-theme git python3-pip python3-gi-cairo gir1.2-gtk-3.0 gir1.2-blockdev-2.0 libblockdev-lvm2 libblockdev-btrfs2 libblockdev-swap2 libblockdev-loop2 libblockdev-crypto2 libblockdev-mpath2 libblockdev-dm2 libblockdev-mdraid2
I use pip3 with the --user option, so it installs in ~/.local, not in /usr/local
pip3 install --user pid
pip3 install --user git+http://github.com/storaged-project/blivet.git@3.0-release
pip3 install --user git+http://github.com/storaged-project/blivet-gui.git
Then, add ~/.local/bin
to PATH
I had to correct the paths to the glade file
~/ .local/lib/python3.7/site-packages/usr/share/blivet-gui/ui/error_dialog.ui
and to the CSS file
~/.local/lib/python3.7/site-packages/usr/share/blivet-gui/css/rectangle.css
in ~/.local/lib/python3.7/site-packages/blivetgui/gui_utils.py
Hello,
i follow the guide from @MHellmund with a fresh installed Debian Buster. My ~/.local/lib/python3.7/site-packages/blivetgui/gui_utils.py looks like:
import os
import shutil
# ---------------------------------------------------------------------------- #
def command_exists(command):
""" Find if given command exists
"""
ret = shutil.which(command)
return bool(ret)
def locate_ui_file(filename):
""" Locate Glade ui files
"""
path = [os.path.split(os.path.abspath(__file__))[0] + '/../data/ui/',
'~/.local/lib/python3.7/site-packages/usr/share/blivet-gui/ui/error_dialog.ui']
for folder in path:
filepath = folder + filename
if os.access(filepath, os.R_OK):
return filepath
raise RuntimeError("Unable to find glade file %s" % filename)
def locate_css_file(filename):
""" Locate CSS files
"""
path = [os.path.split(os.path.abspath(__file__))[0] + '/../data/css/',
'~/.local/lib/python3.7/site-packages/usr/share/blivet-gui/css/rectangle.css']
for folder in path:
filepath = folder + filename
if os.access(filepath, os.R_OK):
return filepath
raise RuntimeError("Unable to find css file %s" % filename)
but if i execute the blivet-gui-daemon:
root@example.org ~/.local/bin # ./blivet-gui-daemon
Traceback (most recent call last):
File "./blivet-gui-daemon", line 115, in <module>
main(sys.argv[1:])
File "./blivet-gui-daemon", line 94, in main
user_id = int(argv[0])
IndexError: list index out of range
root@example.org ~/.local/bin #
and the blivet-gui
root@example.org ~/.local/bin # ./blivet-gui
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Cannot run program blivet-gui-daemon: No such file or directory
Traceback (most recent call last):
File "./blivet-gui", line 115, in <module>
main()
File "./blivet-gui", line 99, in main
ErrorDialog(parent_window=None, msg=_("Failed to start blivet-gui-daemon."))
File "/root/.local/lib/python3.7/site-packages/blivetgui/dialogs/message_dialogs.py", line 68, in __init__
builder.add_from_file(locate_ui_file('error_dialog.ui'))
File "/root/.local/lib/python3.7/site-packages/blivetgui/gui_utils.py", line 51, in locate_ui_file
raise RuntimeError("Unable to find glade file %s" % filename)
RuntimeError: Unable to find glade file error_dialog.ui
root@example.org ~/.local/bin #
Any ideas whats wrong?
Any ideas whats wrong?
The daemon is started automatically and should not be started manually.
And the application should not be run as root.
Thank you @vpodzime now it works. I have found the installation guide from the wiki:
https://github.com/storaged-project/blivet-gui/wiki
and follow step for step as normal user. Now I have no icon in the taskbar. But I have found the tool in
/usr/local/bin/blivet-gui
but it didn't start. I still had to perform the above steps in the files
/usr/local/lib/python3.7/dist-packages/usr/share/blivet-gui/ui/error_dialog.ui
/usr/local/lib/python3.7/dist-packages/usr/share/blivet-gui/css/rectangle.css
/usr/local/lib/python3.7/dist-packages/blivetgui/gui_utils.py
thanks :-)
I know that pip tells users to install packages using the --user
option but I suggest installing blivet-gui as root. It's a system application and it installs some config and data files to /usr so this will never work without manually changing a lot of things. I've tried to figure out how to change setup.py
to work bot when installing as root and as a "regular" user, but I don't think there is a way to make it work.
Anyway, I have finally package both blivet-gui and blivet for Debian and Ubuntu in OBS (it took me only 5 years to do that) so the manual installation is no longer needed.
On UBUNTU 20 just did as in #102 (comment)
I got
$ blivet-gui
Traceback (most recent call last):
File "/usr/local/bin/blivet-gui", line 115, in <module>
main()
File "/usr/local/bin/blivet-gui", line 109, in main
BlivetGUI(client)
File "/usr/local/lib/python3.8/dist-packages/blivetgui/blivetgui.py", line 75, in __init__
self.builder.add_from_file(locate_ui_file("blivet-gui.ui"))
File "/usr/local/lib/python3.8/dist-packages/blivetgui/gui_utils.py", line 51, in locate_ui_file
raise RuntimeError("Unable to find glade file %s" % filename)
RuntimeError: Unable to find glade file blivet-gui.ui
The manual installation using pip should still work, I'll check what's wrong here. But I definitely recommend using the OBS repository for Debian and Ubuntu: https://software.opensuse.org/download.html?project=home:vtrefny&package=blivet-gui
I have tested the packages on a fresh Ubuntu 20.04 installation, so this should work.
The trouble only in and because of default installing to /usr/local/* not in /usr/* . "local" folder is evil.
All pathes are without local in "/usr/local/lib/python3.8/dist-packages/blivetgui/gui_utils.py" but the are.
A crutch solution that should not be https://stackoverflow.com/questions/55387879/installing-pip-in-usr-bin-instead-of-usr-local-bin
Could you consider packaging a version of this for regular Ubuntu, not just xUbuntu? I tried the previous howto, and it worked fine, after I tried the deb download, and it did not.
Could you consider packaging a version of this for regular Ubuntu, not just xUbuntu?
The repo should work for all versions of Ubuntu. I think the xUbuntu
in the name in OBS means <any-prefix>Ubuntu
, not Xubuntu.
I did a quick test with a fresh installation of Ubuntu 20.10 and everything seems to be working (I added the repo using the commands in the Add repository and install manually section). Can you please be more specific about the issue with the OBS repo (e.g. copy here errors from apt)?
Can you please be more specific about the issue with the OBS repo (e.g. copy here errors from apt)?
I actually didn't try adding the repo. I just tried downloading the deb. It was the deb that didn't work. (The deb installer said there were dependency issues.) This was on vanilla Ubuntu 20.10.
The repo contains three packages: blivet-gui, python3-blivet and python3-pid and you need all three to for blivet-gui. I don't think it's possible to make OBS show all three on a single page but I recommend adding the repository, it's much easier that way.
Okay. I mean, the fact that you need all three isn't present in the comments in this thread, where the link to OBS appears. It would be useful for there to be specific instructions about how to install via the deb, in addition to using the repository. Of course, none of this even appears in the main README... I guess it would make sense to add that. (I can do a pull request with the instructions, but I might not get to it immediately.)
I've added more information about the OBS repository to the README.md: #276