docker 您所在的位置:网站首页 升级ubuntu内核版本 docker

docker

2023-01-23 04:01| 来源: 网络整理| 查看: 265

如何查看Linux系统版本? Debian 11 (bullseye) 国内软件源

1 准备环境

一、拉取镜像

docker pull python:3.6 docker pull python:3.8 docker pull ubuntu:20.04 docker pull centos:7

二、进入容器

# 以交互式方式进入容器 docker run -it python:3.6 /bin/bash docker run -it ubuntu:20.04 /bin/bash 2 查看Linux系统版本 2.1 查看Linux内核版本的命令 2.1.1 cat /proc/version

此命令可以查看正在运行的内核版本信息。/proc目录存储的是当前内核运行状态的一系列特殊文件,包括:内存,CPU内核,已安装文件系统等信息。

#cat /proc/version 输出如下: Linux version 3.10.0-1127.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020 2.1.2 uname -a

此命令可以查看电脑以及操作系统内核的相关信息。uname命令用于查看多个系统信息,包括 Linux 内核体系结构,名称版本和发行版。

#uname -a 输出如下: Linux 30a0811d9ae8 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 GNU/Linux 2.2 查看Linux系统发行版本的命令 2.2.1 cat /etc/issue

此命令也可以用于查看Linux系统版本信息,但是显示的结果较为简略,只有系统名称和对应版本号。 该命令也适用于所有的 Linux 发行版。

# cat /etc/issue 输出如下: Debian GNU/Linux 11 \n \l 2.2.2 lsb_release -a

此命令用于查看当前 Linux 系统的完整的版本信息,包括Linux系统的名称和对应的版本号,以及该版本的代号。例如在Debian 8中将会显示代号jessie。

该命令适用于所有 Linux 发行版,包括:Debian、Ubuntu、CentOS 等。

apt-get update -y apt-get install lsb-release # lsb_release -a 输出如下: No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye

LSB 是 Linux Standard Base 的缩写,lsb_release用于显示有关 LSB 和特定版本的信息的命令。

2.3 Linux系统代号 Centos 7 Centos 8 Debian 8 Jessie Debian 9 stretch Debian 10 Buster Debian 11 Bullseye Debian 12 Bookworm Ubuntu 20.04 LTS Focal Fossa Ubuntu 18.04 LTS Bionic Beaver Ubuntu 16.04 LTS Xenial Xerus Ubuntu 14.04 LTS Trusty Tahr 3 镜像对应的系统版本

(1)内核版本

与宿主机保持一致 # cat /proc/version Linux version 3.10.0-1127.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) )

(2)系统版本

镜像python:3.6 系统版本Debian 11 Bullseye 镜像python:3.8 系统版本Debian 11 Bullseye 镜像ubuntu:20.04 系统版本Ubuntu 20.04 LTS Focal Fossa 镜像centos:7 系统版本CentOS 7.9.2009 3.1 Debian 11

更新源/etc/apt/sources.list

deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb https://mirrors.aliyun.com/debian-security/ bullseye-security main deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib 本地文件复制到容器 docker cp ./sources.list b80d8de1e511:/etc/apt apt update

(1)查看内核版本

# uname -a Linux b80d8de1e511 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 GNU/Linux # cat /proc/version Linux version 3.10.0-1127.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020

(2)查看系统版本

apt-get install lsb-release -y lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye 3.2 Ubuntu 20.04

更新源/etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 本地文件复制到容器 docker cp ./sources.list b80d8de1e511:/etc/apt apt update

(1)查看内核版本

# uname -a Linux b80d8de1e511 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 GNU/Linux # cat /proc/version Linux version 3.10.0-1127.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020

(2)查看系统版本

apt-get install lsb-release -y lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal 3.3 Centos 7

(1)查看内核版本

# uname -a Linux ba0d775ac1d4 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # cat /proc/version Linux version 3.10.0-1127.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020

(2)查看系统版本

yum install redhat-lsb -y lsb_release -a LSB Version: :core-4.1-amd64 :core-4.1-noarch: cxx-4.1-amd64: cxx-4.1-noarch: desktop-4.1-amd64: desktop-4.1-noarch: languages-4.1-amd64: languages-4.1-noarch: printing-4.1-amd64: printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.9.2009 (Core) Release: 7.9.2009 Codename: Core


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有