ubuntu 20.04 安装 php7.x-dev 软件包提示依赖问题的解决

参考思路:https://unix.stackexchange.com/questions/389156/how-to-fix-held-broken-packages

安装php7.4-dev的时候,提示“Depends: libssl-dev but it is not going to be installed”。

又试着安装 libssl-dev,提示“Depends: libssl1.1 (= 1.1.1f-1ubuntu2.2) but 1.1.1j-1+ubuntu20.04.1+deb.sury.org+3 is to be installed”。

根据[参考思路]链接,尝试:

sudo apt update
sudo apt install php-common

更新下 php-common 的安装版本,再安装 php7.4-dev 就可以正确安装了。

$ sudo apt install php7.3-dev                                                                                                                                                                   
Reading package lists... Done                                                                                                                                                                   
Building dependency tree                                                                                                                                                                        
Reading state information... Done                                                                                                                                                               
The following additional packages will be installed:                                                                                                                                            
  autoconf automake autopoint autotools-dev debhelper dh-autoreconf dh-strip-nondeterminism                                                                                                     
  dwz gettext intltool-debian libarchive-cpio-perl libarchive-zip-perl libcroco3                                                                                                                
  libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl                                                                                                          
  libpcre2-dev libpcre2-posix2 libsigsegv2 libssl-dev libssl1.1 libsub-override-perl                                                                                                            
  libsys-hostname-long-perl libtool m4 pkg-php-tools po-debconf shtool                                                                                                                          
Suggested packages:                                                                                                                                                                             
  autoconf-archive gnu-standards autoconf-doc dh-make gettext-doc libasprintf-dev                                                                                                               
  libgettextpo-dev libtool-doc libssl-doc gfortran | fortran95-compiler gcj-jdk m4-doc dh-php                                                                                                   
  libmail-box-perl                                                                                                                                                                              
The following NEW packages will be installed:                                                                                                                                                   
  autoconf automake autopoint autotools-dev debhelper dh-autoreconf dh-strip-nondeterminism                                                                                                     
  dwz gettext intltool-debian libarchive-cpio-perl libarchive-zip-perl libcroco3                                                                                                                
  libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl                                                                                                          
  libpcre2-dev libpcre2-posix2 libsigsegv2 libssl-dev libsub-override-perl                                                                                                                      
  libsys-hostname-long-perl libtool m4 php7.3-dev pkg-php-tools po-debconf shtool                                                                                                               
The following packages will be DOWNGRADED:                                                                                                                                                      
  libssl1.1                                                                                                                                                                                     
0 upgraded, 29 newly installed, 1 downgraded, 0 to remove and 54 not upgraded.                                                                                                                  
Need to get 2,901 kB/8,517 kB of archives.                                                                                                                                                      
After this operation, 30.7 MB of additional disk space will be used.                           
Do you want to continue? [Y/n] y                                                               
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.2 [1,319 kB]                                                                         
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.2 [1,582 kB]                                                                        
Fetched 2,901 kB in 4s (753 kB/s)                                                                                                                                                               
Preconfiguring packages ...                                                                    
dpkg: warning: downgrading libssl1.1:amd64 from 1.1.1j-1+ubuntu20.04.1+deb.sury.org+3 to 1.1.1f-1ubuntu2.2
(Reading database ... 214645 files and directories currently installed.)                       
Preparing to unpack .../00-libssl1.1_1.1.1f-1ubuntu2.2_amd64.deb ...                                                                                                                            
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.2) over (1.1.1j-1+ubuntu20.04.1+deb.sury.org+3) ... 
Selecting previously unselected package libsigsegv2:amd64.                                     
Preparing to unpack .../01-libsigsegv2_2.12-2_amd64.deb ...                                    
Unpacking libsigsegv2:amd64 (2.12-2) ...                                                       
Selecting previously unselected package m4.                                                    
Preparing to unpack .../02-m4_1.4.18-4_amd64.deb ...                                           
Unpacking m4 (1.4.18-4) ...                                                                                                                                                                     
Selecting previously unselected package autoconf.                                              
Preparing to unpack .../03-autoconf_2.69-11.1_all.deb ...                                       
Unpacking autoconf (2.69-11.1) ...              
Selecting previously unselected package autotools-dev.                                          
Preparing to unpack .../04-autotools-dev_20180224.1_all.deb ...                                 
Unpacking autotools-dev (20180224.1) ...        
Selecting previously unselected package automake.                                               
Preparing to unpack .../05-automake_1%3a1.16.1-4ubuntu6_all.deb ...                             
Unpacking automake (1:1.16.1-4ubuntu6) ...      
Selecting previously unselected package autopoint.                                              
Preparing to unpack .../06-autopoint_0.19.8.1-10build1_all.deb ...                              
Unpacking autopoint (0.19.8.1-10build1) ...     
Selecting previously unselected package libtool.                                                
Preparing to unpack .../07-libtool_2.4.6-14_all.deb ...                                         
Unpacking libtool (2.4.6-14) ...                
Selecting previously unselected package dh-autoreconf.                                          
Preparing to unpack .../08-dh-autoreconf_19_all.deb ...                                         
Unpacking dh-autoreconf (19) ...                
Selecting previously unselected package libdebhelper-perl.                                      
Preparing to unpack .../09-libdebhelper-perl_12.10ubuntu1_all.deb ...                           
Unpacking libdebhelper-perl (12.10ubuntu1) ...  
Selecting previously unselected package libarchive-zip-perl.                                    
Preparing to unpack .../10-libarchive-zip-perl_1.67-2_all.deb ...                               
Unpacking libarchive-zip-perl (1.67-2) ...      
Selecting previously unselected package libsub-override-perl.                                   
Preparing to unpack .../11-libsub-override-perl_0.09-2_all.deb ...                              
Unpacking libsub-override-perl (0.09-2) ...     
Selecting previously unselected package libfile-stripnondeterminism-perl.                       
Preparing to unpack .../12-libfile-stripnondeterminism-perl_1.7.0-1_all.deb ...                 
Unpacking libfile-stripnondeterminism-perl (1.7.0-1) ...                                        
Selecting previously unselected package dh-strip-nondeterminism.                                
Preparing to unpack .../13-dh-strip-nondeterminism_1.7.0-1_all.deb ...                          
Unpacking dh-strip-nondeterminism (1.7.0-1) ...

...

Setting up libpcre2-dev:amd64 (10.36-2+ubuntu20.04.1+deb.sury.org+2) ...                        
Setting up libtool (2.4.6-14) ...               
Setting up m4 (1.4.18-4) ...                                                                    
Setting up intltool-debian (0.35.0+20060710.5) ...                                              
Setting up libmail-sendmail-perl (0.80-1) ...                                                   
Setting up autoconf (2.69-11.1) ...                                                             
Setting up dh-strip-nondeterminism (1.7.0-1) ...                                                
Setting up automake (1:1.16.1-4ubuntu6) ...     
update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode
Setting up po-debconf (1.0.21) ...                                                              
Setting up libltdl-dev:amd64 (2.4.6-14) ...                                                     
Setting up php7.3-dev (7.3.27-9+ubuntu20.04.1+deb.sury.org+1) ...                               
update-alternatives: using /usr/bin/php-config7.3 to provide /usr/bin/php-config (php-config) in auto mode
update-alternatives: using /usr/bin/phpize7.3 to provide /usr/bin/phpize (phpize) in auto mode  
Setting up debhelper (12.10ubuntu1) ...                                                         
Setting up dh-autoreconf (19) ...                                                               
Setting up pkg-php-tools (1.38) ...                                                             
Processing triggers for doc-base (0.10.9) ...                                                   
Processing 2 added doc-base files...                                                            
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...                                          
Processing triggers for man-db (2.9.1-1) ...    
Processing triggers for install-info (6.7.0.dfsg.2-5) ... 

-EOF-

posted @ 2021-03-23 16:36  imzhi  阅读(2536)  评论(0编辑  收藏  举报