ubuntu 报错 无法定位软件包

 ZR_yst     2023-07-18     506     0   

欢迎来到银盒子的世界~

linux 安装php时遇到问题无法定位软件包  php-mysql

经查找 是源的问题 改为阿里云的源即可

过程:

(1)备份原始文件

sudo cp /etc/apt/sources.list /etc/apt/sources_copy.list

(2)修改文件source.list 注释原语句,并复制

deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

其中 jammy为虚拟机版本代号,在原始语句(被注释的语句)中相同位置上有该代号,照用即可,或者

lsb_release -a

该命令可查找虚拟机版本号,Codename即是我们要找的内容 替换jammy

(3)更新源

sudo apt-get update

(4)重新安装包

sudo apt install php-curl

发表评论