Can't able to install Git

Shouldn't be seeing these if you used sudo.
Given what I have seen from your apt-update print out, your sources.list should be ok. But may need to check it later if the problem persists.

Installing git from repo should work fine, first time.
Can you try

sudo apt full-upgrade

sudo apt install git

sudo apt --fix-broken install

1 Like

this also not worked for me :disappointed:

Let's try installing liberror-perl from a .deb package first, then try installing git normally in the terminal again after:
http://archive.ubuntu.com/ubuntu/pool/main/libe/liberror-perl/liberror-perl_0.17029-1_all.deb

sudo apt install git

1 Like

also my softwere store not working well., it can't able to use internet ,
most of the time it's keep loading , anything i search on them , also my net speed is totally fine
you can see i hv uploaded screen recording on google drive :-
https://drive.google.com/file/d/1jBl1jsbei7c_kSrehN9P14Xal1S8J-b4/view?usp=sharing

how to install "deb" from terminal

Click the link and it will give a pop up offering the .deb package. You can either select to Open With Gdebi and run the installer, or you can save the package in Downloads folder, then Double-Click it to run the installer. Once installed, then try installing git again in the terminal.

Yes, your above details from running commands in terminal showed repeated failures in the updates, too.
And git should install from terminal normally without dependency errors.
You may try

pkill snap-store

pkill gnome-software

Reinitialize and test Software store

yes i did this , it takes me to the software store , and there store keeps loading

Ok, select to Open with Gdebi, instead.


only have these options

Heh...

sudo apt install gdebi

image
may be it is installed now?

1 Like

That'll do it. Ok... So, what happens with installing git now?

ok, i installed manually
and now git is installing

... but software store is still loading

Have you

pkill gnome-software

and then reopened it?

1 Like

yes , i did

Opening Software & Updates, first tab Zorin Software; Download From -is this set to Main Server?

yesss
image

finding best server ,
may be i have to change right?
image

which one ? i'm in india
image

I would highly recommend staying to "Main Server." The "best server (Local region)" option has never worked the way it should.

You are showing a variety of symptoms.
Git not installing properly (on my machine, there was no problem locating and installing liberror-perl), software store constantly loading and updating sources.list was dropping connection above, too.
Like git, cmake should have had no trouble installing, as well.
There seems to be a larger problem.

You may clean your apt cache, remove the ~/.local/share/gnome-software file if it exists and

These suggest packet loss or net drop.

This suggests that Synaptic Package Manager was open and running while also running apt/dpkg in terminal.

2 Likes

okayy

yes this i noticed ,this was my fault

but

how to clean this ? directly have to delete files ?


this??

i didn't get this , what do you mean by net drop?
sorry for lack of knowledge in me , but i really don't know about this

1 Like

The command

sudo apt clean

Should do it. You can also perform sudo apt autoremove to get rid of orphaned packages.

If you are using a Proxy or experiencing Internet Outages. An internet outage can be very fast, with the net dropping out only for a second or so. But that second is enough to cause "packet Loss."

1 Like

If it is still something to do with front end lock, have a look through what I have found by internet research. My favourite method is 4, but I guess the others can be valid:

  1. Try running sudo rm /var/lib/dpkg/lock && sudo rm /var/lib/apt/lists/lock , which will free up the particular files that apt is taking a look at when you’re running it. Make sure to be careful about the names of those files, since running rm as root is destructive.

  2. Coming back to the GUI-based applications we were talking about, another useful and time-saving option is to use the fuser command.

With “fuser” you only need to know the file being accessed (“/var/lib/dpkg/lock” in our case), and you can kill the process accessing that file even if you don’t know which process it is. For example:

sudo fuser -cuk /var/lib/dpkg/lock

Keep in mind that the fuser command will not release the lock acquired by the process you just killed, so you’ll have to do this manually:

sudo rm -f **/var/lib/dpkg/**lock

Note : to “release the lock ” simply means deleting the “lock” file so that other processes can “acquire the lock ” by recreating it.

You may also need to run the following two commands:

sudo fuser -cuk **/var/cache/apt/archives/**lock; sudo rm -f **/var/cache/apt/archives/**lock

  1. In this case, the root cause is the lock file. As mentioned earlier, the lock files are used to prevent two or more processes from using the same data. When apt or apt-get commands are run, they create lock files in a few places. If the previous apt command was not terminated properly, the lock files are not deleted and hence they prevent any new instances of apt-get or apt commands.

To fix the problem, all you need to do is to remove the lock files. But before you do that, it would be a good idea to stop any process that is using the lock files.

Use the lsof command to get the process ID of the process holding the lock files. Check the error and see what lock files it is complaining about and get the id of the processes holding these lock files. Run these commands one by one:

sudo lsof /var/lib/dpkg/lock
sudo lsof /var/lib/apt/lists/lock
sudo lsof /var/cache/apt/archives/lock

It’s possible that the commands don’t return anything, or return just one number. If they do return at least one number, use the number(s) and kill the processes like this (replace the <process_id> with the numbers you got from the above commands):

sudo kill -9 <process_id>

You can now safely remove the lock files using the commands below:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

After that, reconfigure the packages:

sudo dpkg --configure -a

Now if you run the sudo apt update command, everything should be fine.

  1. First, find out the id of the process that is holding the lock file:

lsof /var/lib/dpkg/lock-frontend

The above command will give you the PID of the processes using the lock files. Use this PID to kill the process:

sudo kill -9 PID

Now you can remove the lock and reconfigure dpkg:

sudo rm /var/lib/dpkg/lock-frontend sudo dpkg --configure -a

  1. If you find the “dpkg: error: dpkg frontend lock is locked by another process” error while running the procedure described above, you need to do an extra step. First, find the ID of the process that contains the lock file. You can do so using below command:

itsmarttricks@ubuntu:~$ lsof /var/lib/dpkg/lock

Then make sure the process is not running:

itsmarttricks@ubuntu:~$ ps cax | grep PID PID TTY STAT TIME COMMAND

The above command will give you the process PID using lock files. Use this PID to kill the process:

itsmarttricks@ubuntu:~$ kill PID bash: kill: PID: arguments must be process or job IDs itsmarttricks@ubuntu:~$ kill -9 PID bash: kill: PID: arguments must be process or job IDs

To get an errant key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys

sudo apt-get install

To Update, Upgrade and create a new Grub:

sudo apt-get -f install -y && sudo apt dist-upgrade -y && sudo update-initramfs -u -k all && reboot

2 Likes