天天看点

Linux如何安装软件?Ubuntu系统更新软件下载源

Ubuntu安装软件

我们平时谈到的Linux,实际上只是一个内核。比如常用的RedHat、Ubuntu、CentOS等发行版是由一些组织或者厂商将Linux内核与相关的软件和文档整合起来,并提供安装界面和系统配置等功能。

GNU操作系统,GNU是 “GNU's Not Unix” 的递归缩写,我们现在所使用的发行版一般叫做gnu/linux。基于强大的Linux内核,再加上gnu工程的强大生态,共同推进了gnu/linux的快速发展。

Linux如何安装软件?Ubuntu系统更新软件下载源

由于内核相同,因此不同发行版Linux的命令行也几乎相同,Ubuntu系统是个人认为兼顾性能的简单易学,对初学者十分友好,而且尤其是软件安装非常方便,在众多指令集合中,软件安装是不同发行版的显著区别。

Ubuntu桌面版的操作系统对于习惯图形化操作的用户来说也是很友好,界面华丽,使用方便,简单操作通过图形化操作都可以完成。

Linux如何安装软件?Ubuntu系统更新软件下载源

deb文件格式安装

命令 说明
dpkg 安装和卸载deb安装包
选项 说明
-i 离线安装deb安装包
-r 卸载软件
Google浏览器安装:

$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo dpkg -i google-chrome-stable_current_amd64.deb 

卸载:
$ sudo dpkg -r google-chrome-stable
           

Ubuntu系统不推荐使用deb软件包,因为要解决软件包依赖问题,安装过程就会比较麻烦。

Linux如何安装软件?Ubuntu系统更新软件下载源

apt安装

更改镜像源:因为使用 apt命令默认是从国外的服务器下载安装软件的,会导致下载安装速度很慢,所以需要更改成国内的镜像源服务器。

Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,再进行更改。

Ubuntu20.04 LTS

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse           

命令替换

sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list           

更改完毕执行:sudo apt-get update

更新新的源的最新软件

$ sudo apt install 软件包
$ sudo apt remove 软件包           

源码安装tree

由于tree体积比较小,如果源码安装大型软件,时间会比较久,但是源码安装一般就三个步骤,解压、buid、make insatll。

wget http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz
tar zxvf tree-1.7.0.tgz
cd tree-1.7.0
make
sudo make install           

tree命令执行就是以树形结构显示目录:

Linux如何安装软件?Ubuntu系统更新软件下载源

视频讲解

视频加载中...

相关推荐

  • 什么是Linux系统?我们是否要用Linux
  • 学习Linux命令行,用手就行!
  • Linux神之编辑器VIM,史上最强编辑器!
  • Linux系统虚拟机和云服务配置,快速搭建学习环境
  • Linux系统虚拟机和云服务配置,快速搭建学习环境
  • 什么是C++变量,就是存储数据的盒子