1.命令如下:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo chmod 777 sources.list
2.清空sources.list
echo "">/etc/apt/sources.list
3.将下列源路径粘贴到sources.list
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
4.更新
sudo apt-get update
apt-cache search package 搜索软件包。
apt-cache show package 获取包的相关信息,如说明、大小、版本等。
sudo apt-get install package 安装包。
sudo apt-get install package --reinstall 重新安装包。
sudo apt-get -f install 修复安装。
sudo apt-get remove package 删除包。
sudo apt-get remove package --purge 删除包,包括配置文件等。
sudo apt-get update 更新源。
sudo apt-get upgrade 更新已安装的包。
sudo apt-get dist-upgrade 升级系统。
apt-cache depends package 了解使用该包依赖那些包。
apt-cache rdepends package 查看该包被哪些包依赖。
sudo apt-get build-dep package 安装相关的编译环境。
apt-get source package 下载该包的源代码。
sudo apt-get clean &&sudo apt-get autoclean 清理无用的包。
sudo apt-get check 检查是否有损坏的依赖。
linux系统基本上分两大类:
RedHat系列:Redhat、Centos、Fedora等。
Debian系列:Debian、Ubuntu等 。
RedHat 系列 :
常见的安装包格式 rpm包,安装rpm包的命令是“rpm -参数”。
包管理工具 yum。
支持tar包 。
Debian系列 :
常见的安装包格式 deb包,安装deb包的命令是“dpkg -参数”。
包管理工具 apt-get。
支持tar包 。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)