Compiling GParted from source

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
legacypowers
Level 4
Level 4
Posts: 275
Joined: Sat Dec 19, 2020 8:53 am

Compiling GParted from source

Post by legacypowers »

Installing packages for compiling applications

Those are pretty much "universal", and you probably should search elsewhere, this guide assumes that you already have it set-up.
But the virtual package build-essential and cmake should do the trick for gparted so you can install them by opening the terminal and using apt to install these packages

Code: Select all

sudo apt-get install build-essential cmake 
Warning: When you compile and install from sources, it is up to you to keep it updated, apt and snap won't help you there, it is highly advisable that you keep using the packaged version.


Removing the packaged version

You should first remove the packaged version if you have it installed you can use the command line(apt) to remove it

Code: Select all

sudo apt remove gparted
or you can purge it(removing it + all the config files for it)

Code: Select all

sudo apt purge gparted

Downloading the source-code and extracting

Open your browser and download the desired version
https://sourceforge.net/projects/gparted/files/gparted/
and extract the tar.gz file to somewhere.


Installing additional packages

the packages intltool, libparted-dev, libgtkmm-3.0-dev and itstool are needed so you can install them using apt, so
Open your terminal and paste this:

Code: Select all

sudo apt install intltool libparted-dev libgtkmm-3.0-dev itstool

Configuring

Once the packages are installed, change directory to your gparted source folder and run the following command

Code: Select all

./configure
Alternatively you can add parameters to the ./configure script to change some aspect of the build
This configure script will output a lot of text, if it was successful you will have this at the end
======================== Final configuration ===========================
Installing into prefix : /usr/local

Build help documentation? : yes

Use native libparted dmraid support? : no

Explicitly grant root access to the display? : no

--- Features Based On Libparted Version ---
Need delete old partitions before
creating a loop table workaround? : no
Have old libparted file system resizing API? : no
Have new libparted file system resizing LIB? : yes
Enable online resize support? : yes

If all settings are OK, type make and then (as root) make install
========================================================================
Troubleshooting
configure: error: <something> not found
where "<something> is a name of a library or tool
you can usually install those with apt, if you are having trouble figuring out the package name, copy the error message line and paste it on your favorite search engine and in the end of the search add your distro name in the end.
for example
configure: error: Package requirements (gtkmm-3.0 >= 3.4.0) were not met:

No package 'gtkmm-3.0' found
try searching in apt for the name of the package with lib as prefix and -dev as suffix
libgtkmm-3.0-dev

once it is installed, repeat the ./configure command.


Compiling and Installing

The hard part is over, now it should be all smooth sailing so you can paste this on your terminal

Code: Select all

make && sudo make install
Hint: on the make you can specify the "-j X"(without the quotes, where X is the number of threads of your CPU) parameter, so you can speed-up the build process
once this is done you will have GParted compiled and installed on your system.
Terminal - zsh wrote: ╭─legacy@forums.linuxmint.com
╰─➜ _
Post Reply

Return to “Tutorials”