How to fix : Unable to install GParted on Ubuntu

Updated. :July the 1st 2020
You have tried to install GParted from the Ubuntu software center but you received the error below :Could not get lock /var/lib/dpkg/lock’ Error in Ubuntu

gparted

GParted Linux

From the error message above, one can tell that the reason might be related to the lock file. When two processes have access to the same resource, the first one will lock it up while the second one will wait until it gets unlocked. In other words, processes serialize their actions via this file locking mechanism. This is to prevent conflicts and inconsistencies. This principle is used heavily in operating systems.

In our case, it could be that the lock files were not deleted, for instance when the previous apt command process was not terminated properly which therefore will not allow other processes from executing any new apt/apt-get commands.

Read: Processes in Linux: Guide for beginners

The following will help solve this problem. First open up the terminal and execute the commands shown below :

lsof /var/lib/dpkg/lock

lsof /var/lib/apt/lists/lock

lsof /var/cache/apt/archives/lock

image5.png

If either of the above commands return a number, which will be the process ID, go ahead an kill it using the command :

sudo kill -9 PID

Now issue the commands below which will remove the lock files:

image3.png

image4.png

And then reconfigure the packages via the command below:

image2.png

Read: Best Partition Managers for Linux Users

Finally run :

sudo apt update :

Now run the command below in order to install GParted :

sudo apt install gparted                 [Install gparted Ubuntu]

Ubuntu gparted install

Read: Ubuntu Installation on a VM : Ubuntu wants to format partitions, should you write the changes to disks?

Parted Magic

Parted Magic is based on the GParted software which handles partitioning tasks with ease. An extensive collection of file system tools are also included. It supports the following file systems : btrfs, ext2, ext3, ext4, fat16, fat32, hfs, hfs +, jfs, linux-swap, ntfs, reiserfs, reiser4, and xfs.

gparted software

Read: How to solve “ubi-partman failed with exit code 10” On ubuntu 18.04

It is a good solution for hard disk management. You can use it to partition, clone partitions, erase disks, benchmark and analyze performance , for example.

MORE INFORMATION : Official Website

 


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

ziad nahdy

Ziad Nahdy, fan of open source and programming languages. He is a technical writer, blogger and Linux enthusiast. He loves to read and help others with their problems. He is addicted to open source software but he also loves other technology related subjects.

Leave a Reply