-1

This question already has an answer here:

I'm trying to install packages from terminal but experiencing problem such that:

tarlan@tarlan:~/Downloads/git-2.9.5$ sudo apt install git
[sudo] password for tarlan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
git-svn git-el

E: Package 'git' has no installation candidate
tarlan@tarlan:~/Downloads/git-2.9.5$ sudo apt install git-svn
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

 The following packages have unmet dependencies:
 git-svn : Depends: git (> 1:2.14.1) but it is not installable
       Depends: git (< 1:2.14.1-.) but it is not installable
       Depends: libsvn-perl but it is not installable
       Depends: libyaml-perl but it is not installable
 E: Unable to correct problems, you have held broken packages.

It appeared after installing ubuntu to my PC. I thought the problem is rooted in held broken packages

I tried this this way.


The problem in this answer couldn't help me as couldn't list held packages.

dpkg --get-selections | grep hold

I also wanted try to use this way

sudo aptitude -f install <packagename>

The problem is that i don't know the broken packages.


Please help me, i'm new here and trying to adapt to Ubuntu so any suggestion will be welcomed


Editted

I also tried this way:

sudo apt-get -f install

and experienced this and again saw the previous issue:

tarlan@tarlan:~/Downloads/git-2.9.5$ sudo apt-get -f install
[sudo] password for tarlan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

marked as duplicate by karel, Fabby, waltinator, user68186, Zanna Apr 12 '18 at 20:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Try sudo apt-get -f install to fix the "broken dependencies" issue. – zx485 Feb 2 '18 at 14:01
  • I have editted the question... – Tarlan Ahad Feb 2 '18 at 14:12
  • 1
    You have downloaded a git-package file from somewhere and expect to install it with apt ? – Soren A Feb 2 '18 at 14:18
  • I saw this problem with any apt installation process, i just used Git as a sample – Tarlan Ahad Feb 2 '18 at 14:25
  • 17.04 is EOL. You should upgrade it to 17.10 or directly to development 18.04 LTS. – N0rbert Feb 2 '18 at 14:28
0

Really two options here:

  • switch download mirrors to old-releases as described in the answer of duplicate question:

    sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
    sudo apt-get update
    sudo apt-get upgrade
    
  • upgrade your 17.04 system to 17.10 as described in the answer of duplicate question:

    sudo apt-get update
    sudo apt-get install update-manager-core
    sudo do-release-upgrade
    

If you have slow internet or do not want to upgrade. You may stay on 17.04, but you will not receive security updates.

  • I've tried your way but it stuck at here: tarlan@tarlan:~/Downloads/git-2.9.5$ sudo do-release-upgrade -d Checking for a new Ubuntu release Get:1 Upgrade tool signature [819 B] Get:2 Upgrade tool [1.250 kB] Fetched 1.251 kB in 0s (0 B/s) authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg' extracting 'bionic.tar.gz' Reading cache – Tarlan Ahad Feb 2 '18 at 15:06
  • try without -d. – N0rbert Feb 2 '18 at 15:07
  • when i do it without -d It says: sudo do-release-upgrade [sudo] password for tarlan: Checking for a new Ubuntu release No new release found. – Tarlan Ahad Feb 2 '18 at 15:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.