Ubuntu从入门到入门

1 Ubuntu Desktop Install

1.1 Ubuntu Desktop Version

1.2 Create a bootable USB stick on Windows

2 Install

  • Using apt search and install packages xxx
sudo apt-cache search xxx
sudo apt install xxx
  • xxx.deb
sudo dpkg -i xxx.deb
sudo apt install -f

sudo apt install ./xxx.deb
  • xxx.bin
sudo chmod +x xxx.bin
sudo ./xxx.bin
  • .sh
sudo chmod +x xxx.sh
./xxx.sh
  • pinyin
sudo apt install ibus-pinyin
sudo reboot
  • chromium
sudo apt install chromium-browser
  • vim
sudo apt install vim
sudo apt install ./teamviewer_xxx_[arch].deb
  • ssh
sudo apt install openssh-server
sudo service ssh start
# could not load host key
sudo dpkg-reconfigure openssh-server
sudo service ssh status
  • The easiest way to install for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit) either through the graphical software center if it’s available or through the command line with:
sudo dpkg -i <file>.deb
sudo apt install -f		# Install dependencies
  • The repository and key can also be installed manually with the following script:
    Then update the package cache and install the package using:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt install apt-transport-https
sudo apt update
sudo apt install code		# or code-insiders
  • git
sudo apt install git
git config --global user.name "xxx"
git config --global user.email "你的邮箱地址"
ssh-keygen -C 'you email address@gmail.com' -t rsa

3 Operation

  • Update and upgrade
sudo apt update
sudo apt upgrade
  • /etc/apt/souce.list
sudo gedit /etc/apt/souce.list
  • Add and delete PPA
sudo add-apt-repository ppa:user/ppa-name
cd /etc/apt/sources.list.d/
  • Clear apt
sudo apt automove
sudo apt clean
sudo apt autoclean
sudo du -sh /var/cache/apt
  • apt-key
sudo apt-key list
sudo apt-key add xxx
sudo apt-key del xxx
sudo apt-key update
  • trash
cd .local/share/Trash/
sudo rm -rf .local/share/Trash/*
  • Free up cache memory
sudo du -sh .cache/thumbnails
sudo rm -rf .cache/thumbnails/*
  • Create file and folder
sudo touch xxx.xxx
sudo mkdir	xxx
  • Unzip
# xxx.zip
sudo unzip xxx.zip
# xxx.rar
sudo unrar x xxx.rar
# xxx.tar.gz
sudo tar zxvf xxx.tar.gz
  • IP
sudo gedit /etc/network/interfaces
sudo /etc/init.d/networking restart
ifconfig
  • pip
pip install --upgrade xxx
  • Check memory space
df -hl
  • Add USB external hard disk
sudo apt install ntfs-3g
sudo reboot
sudo fdisk -l
sudo mkdir /media/*/usbhdd0		# *: username
sudo chown *:* /media/*/usbhdd0
sudo mount -t auto -o uid=*,gid=* /dev/sd*1 /media/*/usbhdd0
  • Load external hard disk
sudo mount /dev/sda1 /media/pi/usbhdd
sudo umount /dev/sda1
  • Add source .sh
sudo gedit .bashrc
source /xxx/xxx/xxx/xxx.sh
  • Xilinx drivers Vivado
cd /xxx/Xilinx/SDK/xxx/data/xicom/cable_drivers/lin64/install_script/install_drivers
sudo ./install_drivers
# or
sudo ./install_digilent.sh
功能快捷键
打开TerminalCtrl+Shift+T
自动补全Tab

4 Windows上运行Ubuntu

4.1 配置WIndows环境

控制面板——程序——启用或关闭Windows功能——适用于Linux的Windows子系统
设置——更新和安全——开发者选项——开发人员模式

4.2 SSH

  • 1 安装openssh-server
sudo apt install openssh-server
# sudo apt install openssh-client
  • 2 备份配置文件
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
  • 3 修改配置文件
sudo vim /etc/ssh/sshd_config

Port 23		# 端口22被占用
ListenAddress 0.0.0.0
PasswordAuthentication yes		# 允许密码登录

4.3 安装桌面

4.3.1 Windows上安装VcXsrv

下载VcXsrv

4.3.2 Ubuntu内安装桌面环境

sudo apt install ubuntu-desktop unity compizconfig-settings-manager
export DISPLAY=localhost:0
ccsm
sudo compiz

操作

  • shadow
    密码域密文由三部分组成的,即:$id$salt$encrypted
  • id为1时,采用md5进行加密;
  • id为5时,采用SHA256进行加密;
  • id为6时,采用SHA512进行加密。
openssl passwd -id -salt 'xxx' 'xxx'
  • 0
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tres_Lu

您的鼓励将是我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值