ubuntu安装软件常用命令

ubuntu安装各种安装包

.deb文件

1、安装

安装deb文件,在deb文件目录下ctrl+alt+t打开终端:

sudo dpkg -i ***.deb

如果报错依赖关系有问题:

 sudo apt-get -f install

2、卸载

查看dpkg文件安装目录,找到要卸载的文件名:

sudo dpkg -l

卸载dpkg文件:

sudo dpkg -r 软件名

apt安装与卸载

1、ubuntu换源

更换ubuntu的软件源,推荐阿里源。
首先备份原来的软件源:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

打开ubuntu的软件源文件:

sudo gedit /etc/apt/sources.list

将文件中的所有原内容删除,然后替换为以下阿里源:

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

然后将软件更新包里的软件列表更新:

sudo apt-get update

更新版本较低的软件:

sudo apt-get upgrade

2、安装

当确定需要apt安装相应软件时:

sudo apt-get install ***

需要安装对应版本的软件时:

sudo apt-get install ***==1.5.0

apt与apt-get在很多时候是兼容的,但是并不能完全替代。

3、卸载

remove命令卸载软件,保留配置文件:

sudo apt-get remove ***

purge命令彻底删除软件和配置文件:

sudo apt-get purge ***

自动清理不需要的软件包

sudo apt-get autoremove
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值