UOS无法安装软件-更改软件源或激活

今天在使用UOS虚拟机安装nginx时出现以下问题: 

root@uos1:~# apt -y reinstall nginx
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
不能重新安装 nginx,因为无法下载它。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
解压缩后会消耗 0 B 的额外空间。
正在设置 nginx-full (1.14.2-2+deb10u1) ...
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-12-04 09:27:18 CST; 7ms ago
     Docs: man:nginx(8)
  Process: 2783 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 2784 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
dpkg: 处理软件包 nginx-full (--configure)时出错:
 已安装 nginx-full 软件包 post-installation 脚本 子进程返回错误状态 1
dpkg: 依赖关系问题使得 nginx 的配置工作不能继续:
 nginx 依赖于 nginx-full (<< 1.14.2-2+deb10u1.1~) | nginx-light (<< 1.14.2-2+deb10u1.1~) | nginx-extras (<< 1.14.2-2+deb10u1.1~);然而:
  软件包 nginx-full 尚未配置。
  未安装软件包 nginx-light。
  未安装软件包 nginx-extras。
 nginx 依赖于 nginx-full (>= 1.14.2-2+deb10u1) | nginx-light (>= 1.14.2-2+deb10u1) | nginx-extras (>= 1.14.2-2+deb10u1);然而:
  软件包 nginx-full 尚未配置。
  未安装软件包 nginx-light。
  未安装软件包 nginx-extras。

dpkg: 处理软件包 nginx (--configure)时出错:
 依赖关系问题 - 仍未被配置
在处理时有错误发生:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

使用的UOS系统版本:

root@uos1:~# cat /etc/deepin-version 
[Release]
Version=20 SP1
Type=Server
Type[zh_CN]=服务器版
Edition=Y2020E0002
Copyright=Y2020CR002
[Addition]
Milestone=
Buildid=build1

查看其软件源设置:

root@uos1:~# cat /etc/apt/sources.list
## Generated by deepin-installer
deb [by-hash=force] https://enterprise-packages.chinauos.com/server-enterprise fou/sp1 main contrib non-free
#deb-src https://enterprise-packages.chinauos.com/server-enterprise fou/sp1 main contrib non-free

之前使用上面的这个软件源记得好像是有问题,更改软件源如下:

root@uos1:~# cat /etc/apt/sources.list
## Generated by deepin-installer
#deb [by-hash=force] https://enterprise-packages.chinauos.com/server-enterprise fou/sp1 main contrib non-free
#deb-src https://enterprise-packages.chinauos.com/server-enterprise fou/sp1 main contrib non-free
deb [by-hash=force] https://packages.chinauos.cn/uos eagle main contrib non-free

随机成功安装了nginx:

root@uos1:~# systemctl restart nginx
root@uos1:~# netstat -anptu | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2090/nginx: master  
tcp6       0      0 :::80                   :::*                    LISTEN      2090/nginx: master  
root@uos1:~# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-12-04 09:40:56 CST; 21s ago
     Docs: man:nginx(8)
  Process: 2088 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 2089 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 2090 (nginx)
    Tasks: 3 (limit: 1108)
   Memory: 4.7M
   CGroup: /system.slice/nginx.service
           ├─2090 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─2091 nginx: worker process
           └─2092 nginx: worker process

12月 04 09:40:56 uos1 systemd[1]: Starting A high performance web server and a reverse proxy server...
12月 04 09:40:56 uos1 systemd[1]: Started A high performance web server and a reverse proxy server.

这次使用UOS没有成功安装软件是因为软件源(有时有可能自带的软件源也有问题),还遇到过因为UOS系统重启之后出现未激活的状态,这些都会造成无法正常安装软件包,当然具体问题还得具体分析。

你可能感兴趣的:(Linux,UOS,Linux,国产操作系统)