LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No success in installing Git on debian-8.5.0-i386 (https://www.linuxquestions.org/questions/linux-newbie-8/no-success-in-installing-git-on-debian-8-5-0-i386-4175586430/)

Nai Nai 08-06-2016 10:07 AM

No success in installing Git on debian-8.5.0-i386
 
Hello!I have an ERROR when installing git on debian:
#Package git is not available, but it is referred to by another package.This may mean package is missing,has been obsoleted,or is only available from another source.
E:Package git has no installation candidate#

And I tried :sudo apt-get update && sudo apt-get install git-core.

But,the same ERROR still exists.

What can I do now? Can you give me some advices? Thank you for your kindness.

hydrurga 08-06-2016 10:22 AM

Can you please paste here, preferably within [CODE] tags (you can use the # button in the advanced edit menu to generate these tags), the output from dpkg -l git* ? Thanks.

Edit: And a copy of the contents of /etc/apt/sources.list please.

Nai Nai 08-06-2016 10:53 AM

The output from dpkg -l git*:
#ii zliblg:i386 1:1.2.8.dfsg i386 compression library - runtime
un zmailer <none> <none> (no description available)
dpkg-query: no packages found matching git
#

Well,I don't know how to copy the words in the Linux,so I type the last three sentences.

hydrurga 08-06-2016 11:19 AM

It looks like you typed dpkg -l git# , not dpkg -l git* .

You can use shift-ctrl-c to copy text from the terminal.

If you could please also paste the contents of /etc/apt/sources.list then that would be useful.

Please enclose all output here in CODE tags as I described above.

Nai Nai 08-07-2016 01:17 AM

@hydrurga Sorry for my carelessness,and I did as your advice.

I tried shift-ctrl-c to copy text from the terminal,and failed.There was a ^C in the command line.I have the paste setting ON from virtual machine to main engine.So I type.

dpkg -l git*:
#Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name version Architecture Description
+++=================-==========-=======-======================
un gitweb <none> <none> (no description available)#

cat /etc/apt/sources.list:
##jessie-updates,previously known as 'volatile'
#deb http://mirrors.163.com/debian/ jessie-updates main
#deb-src http://mirrors.163.com/debian/ jessie-updates main

#deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official i386 NETINST Binary-1 20160604-14:07]/ jessie main

#Line commented out by installer because it failed to verify:
#deb http://security.debian.org/ jessie/updates main
#Line commented out by installer because it failed to verify:
#deb-src http://security.debian.org/ jessie/updates main

#jessie-updates, previously known as 'volatile'
deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official i386 NETINST Binary-1 20160604-14:07]/ jessie main
deb http://mirrors.163.com/debian/ jessie-updates main
deb-src http://mirrors.163.com/debian/ jessie-updates main

#jessie-backports,previously on backports.debian.org
deb http://mirrors.163.com/debian/ jessie-backports main
deb-src http://mirrors.163.com/debian jessie-backports main
#

Thank you for your advice and kindness!

AwesomeMachine 08-07-2016 02:16 AM

You have only one apt source, CDROM. Try adding a mirror to sources.list:

Code:

deb http://ftp.us.debian.org/debian jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian jessie main contrib non-free

then do:
Code:

$ apt-get update

hydrurga 08-07-2016 04:38 AM

Hi NaiNai,

(i) To copy text from the terminal, highlight the text you want in the terminal window, then press the Shift key with one finger. Keeping that key pressed down, place another finger on the Ctrl. Then, still keeping these two keys pressed down, press the c key. That should place the text into your clipboard, available for a subsequent Ctrl-v.

(ii) You're still not getting the hang of the CODE tags here in Linux Questions. If you have any command output or code, you should first paste it here. Then select all that text and click on the # in the toolbar (first click on "Go Advanced" if you don't see the toolbar). This puts CODE tags around the text.

Code:

This is an example.
(iii) AwesomeMachine is correct. Your sources.lst file is a bit of a mess. You need to edit it with a text editor as root. Try AwesomeMachine's suggestion at first. If that doesn't work, copy the file to sources.lst.backup and then replace everything in the sources.lst file with:

Code:

deb http://mirrors.163.com/debian/ jessie main contrib non-free
deb-src http://mirrors.163.com/debian/ jessie main contrib non-free

deb http://mirrors.163.com/debian/ jessie-updates main contrib non-free
deb-src http://mirrors.163.com/debian/ jessie-updates main contrib non-free

deb http://mirrors.163.com/debian/ jessie-backports main contrib non-free
deb-src http://mirrors.163.com/debian jessie-backports main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official i386 NETINST Binary-1 20160604-14:07]/ jessie main

Then run apt-get update as AwesomeMachine suggests, and let us know how it goes.

Nai Nai 08-07-2016 12:13 PM

Have a try:
Code:

This is an example.
Oh~I am so happy that AwesomeMachine's advice is valid,of course I change us to cn. And now sudo apt-get install git is working, there comes no error!

It is so fantastic!Thank you for your depending time on my question,I am so moved! Thank you,hydrurga and AwesomeMachine!

And,I couldn't make sense of highlighting the text? There isn't a mouse,so how can I do it by keyboard?

Regards…

hydrurga 08-07-2016 05:37 PM

Excellent!

I'm afraid that I don't know enough to help you to highlight text in the terminal without a mouse, sorry Nai Nai. Perhaps you could start a new thread on the subject? Remember to indicate which terminal emulator you are using e.g. gnome-terminal.

Nai Nai 08-07-2016 10:50 PM

Good idea!


All times are GMT -5. The time now is 06:02 PM.