2

I'm using Debian 9.5 and recently uninstalled a package (mariadb), now as I try to install a new package, I keep getting this:

E: Unable to correct problems, you have held broken packages.

I have tried these commands but no result:

sudo dpkg --configure -a
sudo apt-get install -f
apt-get install --fix-broken

I have also ran this command to show the broken packages but it didn't show anything:

apt-mark showhold

Even when I try run sudo apt-get upgrade I get this:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

then i was able to install aptitude package manager(don't know how), and tried to install the new package with sudo aptitude install mysql-server and it showed something:

The following packages have unmet dependencies:
 libdbi-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
                        - perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed

 libfcgi-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
                         - perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed

 libterm-readkey-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
                                 - perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed

 libdbd-mysql-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
                              - perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed

The following actions will resolve these dependencies:

      Keep the following packages at their current version:         
1)      default-mysql-server [Not Installed]                        
2)      libcgi-fast-perl [Not Installed]                            
3)      libdbd-mysql-perl [Not Installed]                           
4)      libdbi-perl [Not Installed]                                 
5)      libfcgi-perl [Not Installed]                                
6)      libterm-readkey-perl [Not Installed]                        
7)      mariadb-server-10.1 [Not Installed]                         
8)      mysql-server [Not Installed]                                

      Leave the following dependencies unresolved:                  
9)      libcgi-pm-perl recommends libcgi-fast-perl (>= 1:2.01)      
10)     mariadb-client-10.1 recommends libdbd-mysql-perl (>= 1.2202)
11)     mariadb-client-10.1 recommends libdbi-perl                  
12)     mariadb-client-10.1 recommends libterm-readkey-perl     

and this is the output of apt policy pearl-base:

 perl-base:    
    Installed: 5.26.2-7    
    Candidate: 5.26.2-7    
    Version table:    
 *** 5.26.2-7 500   
    500 http://ftp.us.debian.org/debian testing/main amd64 Packages    
    100 /var/lib/dpkg/status    
 5.24.1-3+deb9u4 500    
    500 http://httpredir.debian.org/debian stretch/main amd64 Packages    
    500 http://ftp.de.debian.org/debian stretch/main amd64 Packages     
    500 http://deb.debian.org/debian stretch/main amd64 Packages        
4

You have testing in your repositories, with priority 500, the same as your stable repositories; this effectively means that you’re running Debian testing, not Debian 9.5. (Thanks for helping test the next release of Debian!)

mysql-server is currently not available in testing, so apt install mysql-server (or variants thereof) attempts to install the version in Debian stable; but that requires the Debian stable of Perl, not the Debian testing one, so the installation can’t proceed.

To fix this, I recommend reverting to Debian stable. If you want to stay on testing, you’ll have to wait for MySQL to migrate there, or switch to a mixed testing/unstable setup.

  • oh, i understand what u say, but recently i installed the mysql-server on it and for some internal issues i removed it and installed mariadb, and now again i'm trying to install it.and by the way this is the debian file i installed: debian-live-9.5.0-amd64-gnome.iso – Faramarz Aug 28 '18 at 11:51
  • hmm, thanks.right now i'm upgrading the apps with aptitude. i hope it solve it but i guess not. – Faramarz Aug 28 '18 at 11:59
  • 1
    No, upgrading won’t solve your problem. The last paragraph in my answer explains how to solve your problem. – Stephen Kitt Aug 28 '18 at 12:00
  • ok i will test it – Faramarz Aug 28 '18 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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