ubuntu系统的安装及基本配置

Ubuntu系统的安装以及基本配置

发布版本:V1.0.0

日期:2022-11-06


前言

概述

本文档介绍基于X86平台上 ,ubuntu系统的安装以及基本配置。

芯片支持情况

Ubuntu版本适用平台
16.04X86
18.04X86
20.04X86
22.04X86

修订记录

日期版本作者修改说明
2022-11-06V1.0.0Caesar Wang初始版本

目录

文章目录


安装Ubuntu系统

在这里插入图片描述
Create后,刻录好的U盘。电脑重启进入Bios设置启动u盘或光盘为起先。然后按步骤装起!
OK,这样基本一个ubuntu系统就装好了!

安装系统期间,分区可以这么分(具体安排硬盘大小来区分):

在这里插入图片描述
安装系统过程,最好语言选择简体中文,键盘选择汉语键盘.

如何升级Ubuntu版本

检查版本

lsb_release -a

升级系统

先配置源
推荐自动配置源 可点击这里

sudo apt install update-manager-core
sudo apt update && sudo apt dist-upgrade
sudo do-release-upgrade -d

基本配置

下载源的配置

阿里云
中科大
搜狐
网易

软件源选择默认使用阿里云, 目前看起来更新项目和内容会比较多。看个人使用吧
我目前使用中科大的镜像源, 具体操如下参考即可:

中科大的镜像源

推荐自动配置源 可点击这里

或者自动选择,Edit->Software Sources 里面选择设置,最好选择相关国内的源也可以,不同的源下载的东西可能也不同。

更新完源,记得更新:

sudo apt-get update
sudo apt-get upgrade

常用命令

获取OS相关信息

$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy


$ uname -ar
Linux pc 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

查看cpuinfo相关信息:
cat /proc/cpuinfo

查看某个指令的详细说明

如查看rm指令,则执行:
man rm

软件包相关操作

命令: apt-get install softname1 softname2 softname3……

  • 卸载软件
    命令: apt-get remove softname1 softname2 softname3……

  • 卸载并清除配置

命令: apt-get remove --purge softname1

  • 更新软件信息数据库
    命令: apt-get update

  • 进行系统升级
    命令: apt-get upgrade

  • 搜索软件包
    命令: apt-cache search softname1 softname2 softname3……

  • Deb软件包相关安装与卸载

安装deb软件包
命令: dpkg -i xxx.deb
删除软件包
命令: dpkg -r xxx.deb
连同配置文件一起删除
命令:dpkg -r --purge xxx.deb
查看软件包信息
命令: dpkg -info xxx.deb
查看文件拷贝详情
命令: dpkg -L xxx.deb
查看系统中已安装软件包信息
命令: dpkg -l
重新配置软件包
命令: dpkg-reconfigure xxx

系统命令

  • 关闭系统(若非root,则shutdown前需加sudo):

shutdown -h now

  • 重启系统(若非root,则shutdown前需加sudo):

shutdown -r now

  • 通过head命令,用来显示文件的开头内容,如显示aa.txt,执行:

head aa.txt

  • 通过tail命令,用来显示文件的末尾内容,如显示aa.txt,执行:

tail aa.txt

更多命令

查看
Ubuntu常用命令汇总

ssh公钥的生成与制作

ssh-keygen -C “邮箱地址”

在.ssh目录下有公钥和私钥,把公钥给管理员,现在android/Linux工程一般repo来管理工程。会使用公钥管理一些权限。

~/.ssh/id_rsa 一般这个私钥自己保管好
~/.ssh/id_rsa.pub 这个是公钥给一些工程管理需要开通权限者

flash的安装

如果有需要flash的支持, 可在这里下载安装:adobe-flashplugin,安装完可以在线观看视频。目前只限<Ubuntu20.04的版本.

常用包安装

sudo apt install -f git ssh make gcc libssl-dev liblz4-tool expect \
g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib \
g++-multilib unzip device-tree-compiler ncurses-dev libgucharmap-2-90-dev \
bzip2 expat gpgv2 cpp-aarch64-linux-gnu

sudo snap install git-repo
sudo pip3 install asciidoc

sudo apt install -f python3 silversearcher-ag openjdk-8-jdk gcc-arm-linux-gnueabi
libncurses5-dev curl minicom android-tools-adb liblz4-tool android-tools-fastboot
device-tree-compiler cu libusb-1.0-0-dev gcc-arm-none-eabi openssh-server bison
flex fakeroot cmake

常用工具
sudo apt install -f silversearcher-ag openjdk-8-jdk gcc-arm-linux-gnueabi libncurses5-dev
curl minicom android-tools-adb liblz4-tool android-tools-fastboot device-tree-compiler cu
libusb-1.0-0-dev gcc-arm-none-eabi openssh-server expect

Thunderbird

sudo apt-get install -y thunderbird thunderbird-locale-zh-cn

在最上面–>可见工作区—>菜单栏勾上
查看->排序->按话题排序。
邮件的设置 邮箱设置–>通讯录–>在我的回复之后 //这样设置以后签名就会在前面

使用雷鸟时,导入通讯录会出现乱码,大家可以这样来解决,先在终端下转换它的编码,然后再导入即可。

iconv -c -f gb2312 -t utf8 xxx.csv > yyy.csv

工具—>导入—>选择通讯录–>文本支持(.csv格式)

如果出现乱码,查看—>文字编码—>中文

设置垃圾邮箱设置 选择对应邮箱防止被屏蔽

qq安装

新版本的Linux qq还是比较好用。

QQ Linux版 3.0.02022.12.30
1、新增夜间模式并支持跟随系统,享受更沉浸的聊天体验;
2、新增QQ截图能力,快捷方便,提升办公效率;
3、新增群应用功能,图片、文件轻松传送,群聊更高效;
4、新增全局搜索能力,进一步提升内容搜索效率。

linux-qq下载地址

Wine安装

window系统dll一些配置文件的缺失会导致一些问题,
~/.wine/drive_c/windows/system32,然后把下面列出的几个dll和一个exe文件用win7的替换下

dll

安装Wine key

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo mv winehq.key /etc/apt/keyrings/winehq-archive.key

添加 Wine 仓库

wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources
sudo mv winehq-$(lsb_release -sc).sources  /etc/apt/sources.list.d/

安装 Wine

Wine 存储库提供了三个 Wine 包:

  • winehq-stable – 稳定版(目前为 v7.0)
  • winehq-devel – 最新的开发版本(目前为 v7.8)
  • winehq-staging – 在相应的 wine-devel 之上应用补丁的测试版本

在安装它们之前,您可能需要运行sudo apt update以刷新系统缓存。

稳定版本:
$ sudo apt install winehq-stable
开发版本:
$ sudo apt install winehq-devel 

如何去除Wine

 sudo apt remove wine winehq-stable winehq-staging winehq-devel

安装Chrome浏览器

以下为64位版本,使用下面的命令下载。

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

64 位安装命令:

sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f

编译器vim的安装、相关配置以及插件的安装

请查看

ubuntu下vim安装、配置和插件的添加使用

在vi ~/.vimrc增加代码检测

:highlight RedundantSpaces ctermbg=red guibg=red

:match RedundantSpaces /\s+$| +\ze\t/

在 ~/.vimrc增加

:set ff=unix
这样那个^M的问题就解决了 // …

/bin/zsh找不到问题解决

failed to execute /bin/zsh: No such file or directory

sudo pacman -S zsh
su 
chsh -s /bin/bash
exit
sudo pacman -Rs zsh

wps安装

WPS安装

百度网盘Linux版本

百度云网盘下载

Github问题

Clone failed RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.

打开终端

git config --global http.postBuffer 524288000

修改配置文件

gedit ~/.bashrc

然后在配置文件的最下面加上这三行

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

然后保存退出后运行:source ~/.bashrc 是配置文件生效

依旧不行:
需要如下方式命令,只clone深度为1

      $ git clone https://github.com/JGPY/large-repository.git --depth 1
      $ cd large-repository
      $ git fetch --unshallow

为知笔记

sudo add-apt-repository ppa:wiznote-team
sudo apt-get update
sudo apt-get install wiznote

安卓编译的一些问题

android8.1基于ubuntu18.04编译
android11基于ubuntu20.04编译

报错: ImportError: No module named Crypto.Cipher

解决方法:

sudo apt install python-pip
pip install pycrypto

如果还是报错,则删除crypto,pycrypto后,再次安装pycrypto。

samba的安装

参考 samba的安装

minicom的安装

minicom的安装

tmux

Tmux 是一个工具,用于在一个终端窗口中运行多个终端会话。不仅如此,你还可以通过 Tmux 使终端会话运行于后台或是按需接入、断开会话,这个功能非常实用。稍后,我们将会看到如何充分地利用这个功能。

sudo apt-get install tmux

向日葵

向日葵 for Linux 远程办公软件

支持Ubuntu、Deepin、CentOS、信创UOS、麒麟、
中科方德等系统

下载地址

Teamview

Teamview下载

64位Ubuntu 16.04系统需要添加32位架构支持,命令如下。

sudo dpkg --add-architecture i386
sudo apt-get update

现在,安装TeamViewer的依赖包。

sudo apt-get install libdbus-1-3:i386 libasound2:i386 libexpat1:i386 libfontconfig1:i386 libfreetype6:i386 libjpeg62:i386 libpng12-0:i386 libsm6:i386 libxdamage1:i386 libxext6:i386 libxfixes3:i386 libxinerama1:i386 libxrandr2:i386 libxrender1:i386 libxtst6:i386 zlib1g:i386 libc6:i386

再安装TeamViewer。

sudo dpkg -i teamviewer*.deb

teamview无法交互问题

在Ubuntu 18.04上安装TeamViewer后,如果系统重新启动,则TeamViewer无法连接!

修改方法如下:

sudo vim /etc/gdm3/custom.conf

将如下行取消注释

WaylandEnable=false

如果遇见键盘交互不了的问题,看下电脑F4麦克风是不是打开影响,或右上角的拼音输入法(host 主机切换到eng模式)引起导致的

压缩软件

sudo apt-get install rar

Cron定期更新:

  • 定期更新
cat /etc/crontab ----> chmod 777  /etc/crontab  --->设置完记得再设置 chmod 644  /etc/crontab 
# m h dom mon dow user command
00 5 * * * root cd /home/wxt/work/atf/firmware && ./update-atf.sh
00 6 * * * root cd /home/wxt/work/uboot && ./update-uboot.sh
00 7 * * * root cd /home/wxt/work/rockchip/kernel && ./update-kernel.sh
每天5/6/7点自动更新
重启服务器: sudo /etc/init.d/cron restart 或 /etc/init.d/cron reload

安装virtualbox模拟window

装virtualbox

virtualbox下载

virtualbox的安装包 和增强包 Oracle_VM_VirtualBox_Extension_Pack-5.2.6-120293.vbox-extpack下载完, virtualbox wiki网站 双击安装,这样usb的共享就可以了

经过一番查资料,发现这玩意需要到BIOS里设置一下,方可安装 64位 系统,操作如下:

开机按 F1 进入BIOS设置,选择 Security -> Virtualization,依次将里面的 Intel® Virtualization Technology 和 Intel® VT-d Feature 设为 Enabled,最后保存BIOS设置后重新启动系统即可!

其原理就是:打开 CPU的虚拟技术!

安装视频观看

Virtualbox启动时Kernel driver not installed (rc=-1908) 错误的解决方法

sudo apt-get update 
sudo apt-get install dkms 
sudo /etc/init.d/vboxdrv setup 

命令行中会提示:

         Stopping VirtualBox kernelmodule                       
         Recompiling VirtualBox kernel module 
         Starting VirtualBox kernel module 

就可以了。直接启动virtualbox,就可以进系统了。
注意,需要看清楚你的内核和升级的是不是同一个,如不是还需要把old卸载,然后reboot,用新内核再vboxdrvsetup

设置

将自己的用户添加到 vboxusers 用户组。我的用户名是:wxt;
wxt@ubuntu:~$ sudo addgroup wxt vboxusers
对应版本如下:
下载地址

VBoxGuestAdditions_5.2.18.iso 然后打开virtualbox设置->存储–>增加虚拟光驱

要安装VirtualBox增强功能包,首先启动虚拟机,点击“设备” – “分配光驱“ - ”选择一个虚拟光盘“ 打开”选择虚拟光盘“对话框,找到VirtualBox安装目录,选择VBoxGuestAdditions.iso,点击打开
这样增强包就可以完成,然后文件共享就可以了》
里面需要一个virtualbox增强功能-VBoxGuestAdditions安装

virtualbox网络,选择桥接网卡,eth0

键盘右边的Ctrl+F,右Ctrl+L,右Ctrl+C 肯定会有一个键,可以帮你退出到正常的模式的。

64位的电脑装VirtualBox新建虚拟电脑都是32位的系统-->进入bios后进入Security --> Virtualization,enable起来即可virtualbox未满屏显示,只要device–>安装增强功能 然后重启即可.

设置-》拖放–》双向可以传东西

视图–》自动调整窗口

要卸载的话:sudo apt-get remove Virtualbox*

和/home/wxt/.config/Virtualbox删除掉

wine的安装

suao apt-get install wine 然后安装sourceinsight等
wine UNinstall*.exe 然后卸载sourceinsight等

  • 添加PPA

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update2.更新列表

  • 安装Wine

sudo apt-get install wine1.7 winetricks

Allegro看原理图和PCB

allegro free viewer

synergy

[Stable release] (https://github.com/brahma-dev/synergy-stable-builds/releases)
最新已经不发布更新,得自行编译更新.

官网

###Clone the repo
$ git clone https://github.com/symless/synergy-core.git
$ cd synergy-core

###Switch to the right branch
Stable v1.x: $ git checkout master
Dev v1.x: $ git checkout v1-dev
Dev v2.x: $ git checkout v2-dev

编译:https://github.com/symless/synergy-core/wiki/Compiling
cd Projects/synergy
mkdir build
cd build
cmake …
make

把build/bin拷贝到/usr/bin
cp res/*.desktop /usr/share/applications/
cp res/synergy.ico /usr/share/icons/

激活码:7B76313B70726F3BE5BDAC20E585B33B313B73796E313333323040676D61696C2E636F6D3B3B3B7D

如何安装呢:

  • 有Server和Client,其中Server的鼠标键盘可以共享到Client,同时对于Client中的屏幕名可以在编译中设置下即可,需要重启应用.

在这里插入图片描述

  • 对于Server

对于nb是server的屏幕名字,nb1是client名字。

在这里插入图片描述

  • 然后开始链接,

先server点击开始,然后开始client.

鼠标选形

sudo update-alternatives --config x-cursor-theme

Linux下的图片编辑软件Pinta的安装

可以使用ubuntu软件中心进行安装或参考这里

ftp的下载

linux上也有开源的filezilla,图形化界面。

sudo apt install -y filezilla
  • 1

在这里插入图片描述

中文显示乱码的解决

查看现有语言环境: locale
如果没有 en_US.UTF-8 则安装: locale-gen en_US.UTF-8
可用语言环境: locale -a
永久更改编码,运行以下命令:
echo “export LC_ALL=en_US.UTF-8” >> /etc/profile
echo “export LC_ALL=en_US.UTF-8” >> ~/.bashrc

注意如果需要终端输入显示汉字正常/etc/profile 和 ~/.bashrc
请使用 zh_CN.utf8 设置到
要让刚才的修改马上生效,需要执行以下命令 完成: source /etc/profile

docker安装

先参考 ubuntu docker安装 , 然后添加以下文件
cat /etc/docker/daemon.json
{
“registry-mirrors”: [“https://registry.docker-cn.com”,“https://nrbewqda.mirror.aliyuncs.com”,“https://dmmxhzvq.mirror.aliyuncs.com”]
}
然后重启。

验证是否正常

$ sudo docker --version
Docker version 20.10.14, build a224086

$ sudo docker pull registry
Using default tag: latest
latest: Pulling from library/registry
Digest: sha256:169211e20e2f2d5d115674681eb79d21a217b296b43374b8e39f97fcf866b375
Status: Image is up to date for registry:latest
docker.io/library/registry:latest

Ubuntu22.04下载权限的问题

ssh权限问题
git@www.rockchip.com.cn: Permission denied (publickey).

可在/etc/ssh/ssh_config这个文件添加如下即可解决:

PubkeyAcceptedKeyTypes +ssh-rsa

wxt@pc:~$ cat /etc/ssh/ssh_config
...
# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Include /etc/ssh/ssh_config.d/*.conf
PubkeyAcceptedKeyTypes +ssh-rsa


版权声明:本文为CSDN博主「天选码农」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sasukewxt/article/details/127606089

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值