Ubuntu 20.10安装国内阿里云源

一:遇到的问题:

安装软件报错如下

root@server:~# apt-get install -f redis-server
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:
 libatomic1 : Depends: gcc-10-base (= 10.2.0-5ubuntu1~20.04) but 10.2.0-13ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

二:更换源:

修改配置文件vim /etc/apt/sources.list 如下

# deb cdrom:[Ubuntu 20.10 _Groovy Gorilla_ - Release amd64 (20201022)]/ groovy main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ groovy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ groovy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ groovy universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy universe
deb http://mirrors.aliyun.com/ubuntu/ groovy-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu/ groovy multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ groovy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu groovy partner
# deb-src http://archive.canonical.com/ubuntu groovy partner

deb http://mirrors.aliyun.com/ubuntu/ groovy-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ groovy-security universe
# deb-src http://security.ubuntu.com/ubuntu groovy-security universe
deb http://mirrors.aliyun.com/ubuntu/ groovy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu groovy-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

三:检验是否成功:

3.1:更新源

执行命令apt-get update

root@server:/etc/apt# apt-get update
Get:1 http://mirrors.aliyun.com/ubuntu groovy InRelease [267 kB]
Get:2 http://mirrors.aliyun.com/ubuntu groovy-updates InRelease [110 kB]
Get:3 http://mirrors.aliyun.com/ubuntu groovy-backports InRelease [101 kB]
Get:4 http://mirrors.aliyun.com/ubuntu groovy-security InRelease [110 kB]
Get:5 http://archive.canonical.com/ubuntu groovy InRelease [11.4 kB]
Get:6 http://mirrors.aliyun.com/ubuntu groovy/main amd64 Packages [1,378 kB]
Get:7 http://archive.canonical.com/ubuntu groovy/partner amd64 Packages [852 B]
Get:8 http://mirrors.aliyun.com/ubuntu groovy/main Translation-en [507 kB]
Get:9 http://archive.canonical.com/ubuntu groovy/partner Translation-en [384 B]
Get:10 http://mirrors.aliyun.com/ubuntu groovy/main amd64 c-n-f Metadata [29.2 kB]
Get:11 http://mirrors.aliyun.com/ubuntu groovy/restricted amd64 Packages [57.7 kB]
Get:12 http://mirrors.aliyun.com/ubuntu groovy/restricted Translation-en [9,404 B]
Get:13 http://mirrors.aliyun.com/ubuntu groovy/restricted amd64 c-n-f Metadata [456 B]
Get:14 http://mirrors.aliyun.com/ubuntu groovy/universe amd64 Packages [12.6 MB]
Get:15 http://mirrors.aliyun.com/ubuntu groovy/universe Translation-en [5,262 kB]
Get:16 http://mirrors.aliyun.com/ubuntu groovy/universe amd64 c-n-f Metadata [270 kB]
Get:17 http://mirrors.aliyun.com/ubuntu groovy/multiverse amd64 Packages [202 kB]
Get:18 http://mirrors.aliyun.com/ubuntu groovy/multiverse Translation-en [106 kB]
Get:19 http://mirrors.aliyun.com/ubuntu groovy/multiverse amd64 c-n-f Metadata [9,260 B]
Get:20 http://mirrors.aliyun.com/ubuntu groovy-updates/main amd64 Packages [244 kB]
Get:21 http://mirrors.aliyun.com/ubuntu groovy-updates/main Translation-en [66.3 kB]
Get:22 http://mirrors.aliyun.com/ubuntu groovy-updates/main amd64 c-n-f Metadata [4,044 B]
Get:23 http://mirrors.aliyun.com/ubuntu groovy-updates/restricted amd64 Packages [59.2 kB]
Get:24 http://mirrors.aliyun.com/ubuntu groovy-updates/restricted Translation-en [10.3 kB]
Get:25 http://mirrors.aliyun.com/ubuntu groovy-updates/restricted amd64 c-n-f Metadata [360 B]
Get:26 http://mirrors.aliyun.com/ubuntu groovy-updates/universe amd64 Packages [79.7 kB]
Get:27 http://mirrors.aliyun.com/ubuntu groovy-updates/universe Translation-en [30.1 kB]
Get:28 http://mirrors.aliyun.com/ubuntu groovy-updates/universe amd64 c-n-f Metadata [2,960 B]
Get:29 http://mirrors.aliyun.com/ubuntu groovy-updates/multiverse amd64 Packages [2,316 B]
Get:30 http://mirrors.aliyun.com/ubuntu groovy-updates/multiverse Translation-en [644 B]
Get:31 http://mirrors.aliyun.com/ubuntu groovy-updates/multiverse amd64 c-n-f Metadata [116 B]
Get:32 http://mirrors.aliyun.com/ubuntu groovy-backports/main amd64 c-n-f Metadata [112 B]
Get:33 http://mirrors.aliyun.com/ubuntu groovy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:34 http://mirrors.aliyun.com/ubuntu groovy-backports/universe amd64 Packages [3,888 B]
Get:35 http://mirrors.aliyun.com/ubuntu groovy-backports/universe Translation-en [1,324 B]
Get:36 http://mirrors.aliyun.com/ubuntu groovy-backports/universe amd64 c-n-f Metadata [188 B]
Get:37 http://mirrors.aliyun.com/ubuntu groovy-backports/multiverse amd64 c-n-f Metadata [116 B]
Get:38 http://mirrors.aliyun.com/ubuntu groovy-security/main amd64 Packages [155 kB]
Get:39 http://mirrors.aliyun.com/ubuntu groovy-security/main Translation-en [42.9 kB]
Get:40 http://mirrors.aliyun.com/ubuntu groovy-security/main amd64 c-n-f Metadata [2,724 B]
Get:41 http://mirrors.aliyun.com/ubuntu groovy-security/restricted amd64 Packages [35.8 kB]
Get:42 http://mirrors.aliyun.com/ubuntu groovy-security/restricted Translation-en [5,492 B]
Get:43 http://mirrors.aliyun.com/ubuntu groovy-security/restricted amd64 c-n-f Metadata [116 B]
Get:44 http://mirrors.aliyun.com/ubuntu groovy-security/universe amd64 Packages [41.9 kB]
Get:45 http://mirrors.aliyun.com/ubuntu groovy-security/universe Translation-en [17.2 kB]
Get:46 http://mirrors.aliyun.com/ubuntu groovy-security/universe amd64 c-n-f Metadata [1,936 B]
Get:47 http://mirrors.aliyun.com/ubuntu groovy-security/multiverse amd64 c-n-f Metadata [116 B]
Fetched 21.9 MB in 17s (1,297 kB/s)
Reading package lists... Done

3.2:重新安装软件看结果

root@server:/etc/apt# apt-get install redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libatomic1 libjemalloc2 liblua5.1-0 liblzf1 lua-bitop lua-cjson redis-tools
Suggested packages:
  ruby-redis
The following NEW packages will be installed:
  libatomic1 libjemalloc2 liblua5.1-0 liblzf1 lua-bitop lua-cjson redis-server redis-tools
0 upgraded, 8 newly installed, 0 to remove and 29 not upgraded.
Need to get 1,097 kB of archives.
After this operation, 5,357 kB of additional disk space will be used.
Do you want to continue? [Y/n]

ok! 问题解决了。。。

四:注意事项:

不是root用户,注意所有命令前加sudo

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值