准备工作:
备份初始仓库源
sudo cp /etc/apt/sources.list /etc/apt/sources-bak.list
一、添加仓库源:
sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
更新仓库源:
sudo apt-get update //访问源列表中每个网址,并拉取可更新的软件列表;但并不更新
然后即可安装仓库源内的软件
sudo apt-get install ffmpeg
或者更新软件:
sudo apt-get upgrade //将本地软件与源列表上拉去的列表对比,并更新软件
二、删除错误仓库源文件:
仓储遇到以下问题,导致无法update:
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
仓库目录: /etc/apt/sources.list.d。删除错误仓库源文件:
cd /etc/apt/sources.list.d
sudo rm 对应仓库
三、 更换源
(1)编辑/etc/apt/sources.list文件
sudo gedit /etc/apt/sources.list
(2)在上面打开的文件开头添加(中科大的源)
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
再输入:
sudo apt-get update