更换软件源

#备份
sudo cp /etc/apt/sources.list.d/ubuntu.sources  /etc/apt/sources.list.d/ubuntu.sources.bak
 
#编辑,将其追加在文件最后
sudo vim /etc/apt/sources.list.d/ubuntu.sources
 
# 阿里云
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
 
#更新源列表
sudo apt-get update
 
#更新软件包
sudo apt-get upgrade

国内其他源

# 清华源
Types: deb
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
 
# 中科大源
Types: deb
URIs: http://mirrors.ustc.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
 
#网易源
Types: deb
URIs: http://mirrors.163.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

安装docker

#卸载老版本docker
sudo apt-get remove docker docker-engine docker.io containerd runc
 
#更新软件包索引,并且安装docker依赖
sudo apt update
sudo apt-get install ca-certificates curl gnupg lsb-release
 
#添加docker密钥
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
 
#添加阿里云docker软件源
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
 
#安装docker
sudo apt-get install docker-ce docker-ce-cli containerd.i
 
#配置用户组(非必须操作,此操作目的是为了以后执行docker命令时无需输入sudo密码,避免这些重复操作而已。)
sudo usermod -aG docker $USER
sudo reboot
 
#等待重启后,检验docker是否安装成功
service start docker
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
service docker restart
sudo docker run hello-world
 

卸载docker

#删除docker的所有包
apt-get autoremove docker docker-ce docker-engine  docker.io  containerd runc
 
#查看docker是否卸载干净
dpkg -l | grep docker
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
 
#删除相关插件
apt-get autoremove docker-ce-*
 
#删除docker配置目录
rm -rf /etc/systemd/system/docker.service.d
rm -rf /var/lib/docker
 
#确定docker卸载完毕
docker --version
 
#遇到的问题
#按照上述流程后,再次输入docker --version还是会出现docker的版本号,让我很纳闷。输入which docker后,发现还存在一个snap 版本的docker,输入以下命令删除
which docker
sudo snap remove --purge docker
 
#再输入
whereis docker
将所有与docker相关的文件删除。

以上转载地址为:Ubuntu 24.04 LTS 相关配置 - huanghaonan - 博客园

以下转自:【ubuntu】ubuntu24.04.1的apt源配置_ubuntu24源-CSDN博客

# Ubuntu 24.04 (Noble) 官方源
Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: noble noble-updates noble-backports noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Ubuntu 24.04 (Noble) 安全更新源
Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Ubuntu 24.04 (Noble) 更新源
Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: noble-updates
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Ubuntu 24.04 (Noble) 回滚更新源
Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Ubuntu 24.04 (Noble) 提议源(可选,通常用于测试)
# Types: deb
# URIs: https://mirrors.aliyun.com/ubuntu/
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐