当前位置: 首页 > news >正文

ubuntu的快速安装与配置

文章目录

  • 前言
  • 一、快速安装
  • 二 、基础配置
    • 1 Sudo免密码
    • 2 ubuntu20.04 pip更新源
    • 3 安装和配置oneapi(infort/mpi/mkl) apt下载
      • 第一次下载的要建立apt源
      • apt下载(infort/mpi/mkl)
    • 4 安装一些依赖库等
    • 5 卸载WSL
  • python
  • 总结


前言

win11系统
ubuntu20.04


提示:以下是本篇文章正文内容,下面案例可供参考

一、快速安装

在这里插入图片描述

wsl.exe --list -o

在这里插入图片描述

wsl.exe --install Ubuntu-20.04

在这里插入图片描述

  • 输入用户名和密码
    在这里插入图片描述


二 、基础配置

1 Sudo免密码

  • 给/etc/sudoers增加写的权限
gpasswd -a 用户名 sudo
  • 添加信息
visudo

在这里插入图片描述

  • 重新进入管理员模式
ctrl+x 直接退出
sudo -i

2 ubuntu20.04 pip更新源

cbb@qbchen:~/bin$ cd /etc/apt/
  • 复制原本文件
cbb@qbchen:/etc/apt$ sudo cp -r sources.list sources.list.bak
cbb@qbchen:/etc/apt$ sudo vi sources.list
  • 注意每个源的版本对应ubuntu的版本 不要选错了 我的是ubuntu20.04的版本
    全部替换
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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/ focal universe
# deb-src http://mirrors.aliyun.com/ubuntu/ focal universe
deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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/ focal multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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 focal partner
# deb-src http://archive.canonical.com/ubuntu focal partnerdeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal-security universe
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security universe
deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
# deb-src https://apt.repos.intel.com/oneapi all main
esc
:wq
  • 更新源以及更新软件 如果报错没有权限 提升为管理员权限就好了
cbb@qbchen:/etc/apt$ apt update
cbb@qbchen:/etc/apt$ apt upgrade

3 安装和配置oneapi(infort/mpi/mkl) apt下载

  • 官网:https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?operatingsystem=linux&distributions=aptpackagemanager

第一次下载的要建立apt源

root@qbchen:sudo -iroot@qbchen:~# ls
intelroot@qbchen:~# cd /etc/apt/root@qbchen:/etc/apt# ls
apt.conf.d  auth.conf.d  preferences.d  sources.list  sources.list.bak  sources.list.d  trusted.gpg.droot@qbchen:/etc/apt# cd sources.list.d/
root@qbchen:/etc/apt/sources.list.d# wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null--2023-03-07 15:03:04--  https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Resolving apt.repos.intel.com (apt.repos.intel.com)... 104.71.139.144, 2600:1417:8000:b86::4b23, 2600:1417:8000:b92::4b23
Connecting to apt.repos.intel.com (apt.repos.intel.com)|104.71.139.144|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3796 (3.7K) [binary/octet-stream]
Saving to: ‘STDOUT’-                             100%[=================================================>]   3.71K  --.-KB/s    in 0s2023-03-07 15:03:05 (616 MB/s) - written to stdout [3796/3796]--2023-03-07 15:03:05--  http://%20/
Resolving   ( )... failed: Name or service not known.
wget: unable to resolve host address ‘ ’
FINISHED --2023-03-07 15:03:05--
Total wall clock time: 1.0s
Downloaded: 1 files, 3.7K in 0s (616 MB/s)
root@qbchen:/etc/apt/sources.list.d# lsroot@qbchen:/etc/apt/sources.list.d# echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.listroot@qbchen:/etc/apt/sources.list.d# ls
oneAPI.listroot@qbchen:/etc/apt/sources.list.d# cat oneAPI.list
deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all mainroot@qbchen:/etc/apt/sources.list.d# apt update

更新出apt里面的包 就算建立完成
在这里插入图片描述

apt下载(infort/mpi/mkl)

  • 下载
root@qbchen:~# apt install intel-oneapi-mkl intel-oneapi-mpi intel-oneapi-compiler intel-oneapi-compiler-fortran
  • 查看ifx icc ifort 看到这几个文件存在 说明安装完成
root@qbchen:~# cd /opt/intel/oneapi/compiler/latest/linux/bin
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin# ls
aocl-ioc64  fpp  icx-cc  icx-cl  icx.cfg  ifx  ifx.cfg  intel64  ioc64  sycl-ls  sycl-post-link
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin# cd intel64/
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# ls
codecov  fpp    ifort.cfg        map_opts  profmerge          proforder  xiar      xild
fortcom  ifort  libcilkrts.so.5  profdcg   profmergesampling  tselect    xiar.cfg  xild.cfg

在这里插入图片描述

  • 配置环境变量
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# vi /etc/profile.d/intel.sh

输入以下内容

oaroot=/opt/intel/oneapi
source $oaroot/mkl/latest/env/vars.sh
source $oaroot/mpi/latest/env/vars.sh
source $oaroot/compiler/latest/env/vars.sh
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# . /etc/profile.d/intel.sh
  • 安装成功
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# ifortifort: command line error: no files specified; for help type "ifort -help"

4 安装一些依赖库等

apt install build-essential 
apt install cmake

5 卸载WSL

  • 打开cmd
  • 查看版本号
wsl --list
  • 注销ubuntu
wsl --unregister <你的ubuntu的版本号>
  • win系统卸载
    在这里插入图片描述

python

  • ubuntu20.04默认装了python 名字叫python3 默认在/usr/bin
    指向usr/lib目录下面的python3.8
    在这里插入图片描述

总结

相关文章:

ubuntu的快速安装与配置

文章目录前言一、快速安装二 、基础配置1 Sudo免密码2 ubuntu20.04 pip更新源3 安装和配置oneapi(infort/mpi/mkl) apt下载第一次下载的要建立apt源apt下载&#xff08;infort/mpi/mkl)4 安装一些依赖库等5 卸载WSLpython总结前言 win11系统 ubuntu20.04 提示&#xff1a;以下…...

人工智能AI工具汇总(AIGC ChatGPT时代个体崛起)

NameCategoryWebsiteDescription描述《AIGC时代&#xff1a;超级个体的崛起》小报童https://xiaobot.net/p/SuperIndividual 介绍AIGC&#xff0c;ChatGPT&#xff0c;使用技巧与搞钱方式。Masterpiece Studio3Dhttps://masterpiecestudio.comSimplifying 3D Creation with AI…...

【rust-grpc-proxy】在k8s中,自动注入代理到pod中,再不必为grpc调试而烦恼

目录前言原理sidecarwebhook实现安装k8s设置webhook使用尾语前言 rust-grpc-proxy 目前功能基本完善。是时候上环境开始应用了。 之前考虑是gateway模式或者sidecar模式。 思考良久之后&#xff0c;觉得两种模式都有使用场景&#xff0c;那就都支持。本次就带来sidecar模式的食…...

VisualStudio2022制作多项目模板及Vsix插件

一、安装工作负载 在vs2022上安装“visual studio扩展开发 ”工作负载 二、制作多项目模板 导出项目模板这个我就不再多说了&#xff08;项目→导出模板→选择项目模板&#xff0c;选择要导出的项目→填写模板信息→完成&#xff09;。 1.准备模板文件 将解决方案中的多个…...

仿写简单IOC

目录 TestController类: UserService类: 核心代码SpringIOC&#xff1a; Autowired和Component注解 SpringIOCTest 类 ​编辑 总结&#xff1a; TestController类: Component public class TestController {Autowiredprivate UserService userService;public void test…...

liunx下安装node exporter

1 建立文件夹 cd /opt mkdir software 下载最新的包&#xff0c;并解压 https://prometheus.io/download/ 下载 curl -LO https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz 3.解压 tar -xvf node_exporter-0.…...

lambda函数

Lambda(函数指针)lambda 是c11非常重要也是最常用的特性之一&#xff0c;他有以下优点&#xff1a;可以就地匿名定义目标函数或函数对象&#xff0c;不需要额外写一个函数lambda表达式是一个匿名的内联函数lambda表达式定义了一个匿名函数&#xff0c;语法如下&#xff1a;[cap…...

【Python入门第二十七天】Python 日期

Python 日期 Python 中的日期不是其自身的数据类型&#xff0c;但是我们可以导入名为 datetime 的模块&#xff0c;把日期视作日期对象进行处理。 实例 导入 datetime 模块并显示当前日期&#xff1a; import datetimex datetime.datetime.now() print(x)运行实例 2023-0…...

C++基础知识【5】数组和指针

目录 一、概述 数组 指针 二、数组 2.1、数组的声明 2.2、数组的初始化 2.3、数组的访问 2.4、多维数组 2.5、数组作为函数参数 三、指针 3.1、指针的声明 3.2、指针的赋值 3.3、指针的访问 3.4、指针运算 3.5、指针数组和数组指针 3.6、二级指针 四、数组和指…...

Vim使用操作命令笔记

Vim使用操作命令笔记在普通模式下&#xff0c;输入 : help tutor 就可以进入vim的教学       在 terminal 中输入 vim 文件名 就可以打开文件    vim有两种模式   normal mode &#xff08;普通模式&#xff09;→ 指令操作   insert mode &#xff08;输入模式&…...

【论文阅读】Robust Multi-Instance Learning with Stable Instances

1、摘要与引言 以往的MIL算法遵循i.i.d假设&#xff1a;训练样本与测试样本都分别来自于同一分布中&#xff0c;而这一假设往往与现实应用中有所出入。研究人员通过计算训练样本与测试样本之间的密度比对训练样本进行加权&#xff0c;以解决分布变化带来的问题。 分布的变化发…...

洛谷 P5116 [USACO18DEC]Mixing Milk B

题目链接&#xff1a;P5116 [USACO18DEC]Mixing Milk B - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题目描述 农业&#xff0c;尤其是生产牛奶&#xff0c;是一个竞争激烈的行业。Farmer John 发现如果他不在牛奶生产工艺上有所创新&#xff0c;他的乳制品生意可能就会受…...

华为OD机试 - 最左侧冗余覆盖子串(C 语言解题)【独家】

最近更新的博客 华为od 2023 | 什么是华为od,od 薪资待遇,od机试题清单华为OD机试真题大全,用 Python 解华为机试题 | 机试宝典【华为OD机试】全流程解析+经验分享,题型分享,防作弊指南)华为od机试,独家整理 已参加机试人员的实战技巧文章目录 使用说明本期题目:最左侧冗…...

《Netty》从零开始学netty源码(三)之SelectorProvider

...

实验7 图像水印

本次实验大部分素材来源于山大王成优老师的讲义以及冈萨雷斯&#xff08;MATLAB版&#xff09;&#xff0c;仅作个人学习笔记使用&#xff0c;禁止用作商业目的。 文章目录一、实验目的二、实验例题1. 数字图像水印技术2. 可见水印的嵌入3. 不可见脆弱水印4. 不可见鲁棒水印一、…...

如何实现大文件断点续传、秒传

大家先来了解一下几个概念&#xff1a; 「文件分块」&#xff1a;将大文件拆分成小文件&#xff0c;将小文件上传\下载&#xff0c;最后再将小文件组装成大文件&#xff1b; 「断点续传」&#xff1a;在文件分块的基础上&#xff0c;将每个小文件采用单独的线程进行上传\下载&…...

备战蓝桥python——完全平方数

完全平方数 链接: 完全平方数 暴力解法&#xff1a; n int(input()) for i in range(1, n1):if(((i*n)**0.5)%10.0):print(i)break运用数论相关知识求解 任意一个正整数都可以被分解成若干个质数乘积的形式&#xff0c;例如 :2022∗5120 \ 2^{2}*5^{1}\,20 22∗51 由此…...

WebRTC中的NAT穿透

NAT简介 我们知道&#xff0c;WebRTC会按照内网、P2P、中转的顺序来尝试连接。在大部分的情况下&#xff0c;实际是使用P2P或者中转的。这里P2P的场景主要使用的技术就是NAT穿透。 我们先简单了解下NAT。NAT在真实网络中是常见的&#xff0c;它的出现一是为了解决ipv4地址不够…...

SpringCloud-高级篇(一)

目录&#xff1a; &#xff08;1&#xff09;初识Sentinel-雪崩问题的解决方案 &#xff08;2&#xff09;服务保护Sentinel和Hystrix对比 &#xff08;3&#xff09;Sentinel初始-安转控制台 &#xff08;4&#xff09;整合微服务和Sentinel 微服务高级篇 &#xff08;1&…...

电脑自动重启是什么原因?详细解说

案例&#xff1a;电脑自动重启是什么原因&#xff1f; “一台用了一年的电脑&#xff0c;最近使用&#xff0c;每天都会一两次莫名其妙自动重启&#xff0c;看了电脑错误日志&#xff0c;看不懂什么意思&#xff0c;一直找不到答案。有没有高手知道怎么解决这个问题的。” 当…...

Python爬虫实战:研究MechanicalSoup库相关技术

一、MechanicalSoup 库概述 1.1 库简介 MechanicalSoup 是一个 Python 库,专为自动化交互网站而设计。它结合了 requests 的 HTTP 请求能力和 BeautifulSoup 的 HTML 解析能力,提供了直观的 API,让我们可以像人类用户一样浏览网页、填写表单和提交请求。 1.2 主要功能特点…...

以下是对华为 HarmonyOS NETX 5属性动画(ArkTS)文档的结构化整理,通过层级标题、表格和代码块提升可读性:

一、属性动画概述NETX 作用&#xff1a;实现组件通用属性的渐变过渡效果&#xff0c;提升用户体验。支持属性&#xff1a;width、height、backgroundColor、opacity、scale、rotate、translate等。注意事项&#xff1a; 布局类属性&#xff08;如宽高&#xff09;变化时&#…...

《基于Apache Flink的流处理》笔记

思维导图 1-3 章 4-7章 8-11 章 参考资料 源码&#xff1a; https://github.com/streaming-with-flink 博客 https://flink.apache.org/bloghttps://www.ververica.com/blog 聚会及会议 https://flink-forward.orghttps://www.meetup.com/topics/apache-flink https://n…...

Java线上CPU飙高问题排查全指南

一、引言 在Java应用的线上运行环境中&#xff0c;CPU飙高是一个常见且棘手的性能问题。当系统出现CPU飙高时&#xff0c;通常会导致应用响应缓慢&#xff0c;甚至服务不可用&#xff0c;严重影响用户体验和业务运行。因此&#xff0c;掌握一套科学有效的CPU飙高问题排查方法&…...

技术栈RabbitMq的介绍和使用

目录 1. 什么是消息队列&#xff1f;2. 消息队列的优点3. RabbitMQ 消息队列概述4. RabbitMQ 安装5. Exchange 四种类型5.1 direct 精准匹配5.2 fanout 广播5.3 topic 正则匹配 6. RabbitMQ 队列模式6.1 简单队列模式6.2 工作队列模式6.3 发布/订阅模式6.4 路由模式6.5 主题模式…...

推荐 github 项目:GeminiImageApp(图片生成方向,可以做一定的素材)

推荐 github 项目:GeminiImageApp(图片生成方向&#xff0c;可以做一定的素材) 这个项目能干嘛? 使用 gemini 2.0 的 api 和 google 其他的 api 来做衍生处理 简化和优化了文生图和图生图的行为(我的最主要) 并且有一些目标检测和切割(我用不到) 视频和 imagefx 因为没 a…...

C#学习第29天:表达式树(Expression Trees)

目录 什么是表达式树&#xff1f; 核心概念 1.表达式树的构建 2. 表达式树与Lambda表达式 3.解析和访问表达式树 4.动态条件查询 表达式树的优势 1.动态构建查询 2.LINQ 提供程序支持&#xff1a; 3.性能优化 4.元数据处理 5.代码转换和重写 适用场景 代码复杂性…...

机器学习的数学基础:线性模型

线性模型 线性模型的基本形式为&#xff1a; f ( x ) ω T x b f\left(\boldsymbol{x}\right)\boldsymbol{\omega}^\text{T}\boldsymbol{x}b f(x)ωTxb 回归问题 利用最小二乘法&#xff0c;得到 ω \boldsymbol{\omega} ω和 b b b的参数估计$ \boldsymbol{\hat{\omega}}…...

2.2.2 ASPICE的需求分析

ASPICE的需求分析是汽车软件开发过程中至关重要的一环&#xff0c;它涉及到对需求进行详细分析、验证和确认&#xff0c;以确保软件产品能够满足客户和用户的需求。在ASPICE中&#xff0c;需求分析的关键步骤包括&#xff1a; 需求细化&#xff1a;将从需求收集阶段获得的高层需…...

SQL进阶之旅 Day 22:批处理与游标优化

【SQL进阶之旅 Day 22】批处理与游标优化 文章简述&#xff08;300字左右&#xff09; 在数据库开发中&#xff0c;面对大量数据的处理任务时&#xff0c;单条SQL语句往往无法满足性能需求。本篇文章聚焦“批处理与游标优化”&#xff0c;深入探讨如何通过批量操作和游标技术提…...