软件版本过低,更换软件源相关问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了软件版本过低,更换软件源相关问题相关的知识,希望对你有一定的参考价值。
参考技术A 当我在进行生物信息学分析的时候,需要使用samtools这个软件的附带软件bcftools来进行文件格式的转换,首先我通过sudo apt install samtools 安装了samtools这个软件,但是当我使用bcftools这个软件的时候报错,显示无法识别的命令,于是我就特地装了一遍bcftools,再次运行还是报错,显示版本过低,于是我查看samtools和bcftools的版本都很低,都是1.19,而老师课件使用的两者都是1.7,于是首先我想着,通过sudo apt-get update更新软件源,当我更新软件源后,再次重复上述过程安装二者并使用,但是版本仍未改变,因为我用的是阿里云的服务器,于是我想可能是服务器自身的软件源的问题,于是想着将软件源更改为ubuntu官方的软件源,通过1、备份原始文件
sudo cp /etc/apt/sources.list.d/sources-aliyun-0.list /etc/apt/sources.list.d/sources-aliyun._backup
2、修改文件并添加源
vi /etc/apt/sources.list.d/sources-aliyun-0.list
并将下述内容添加到其后:
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://mirrors.cn99.com/ubuntu/ bionic main restricted deb-src http://mirrors.cn99.com/ubuntu/ bionic restricted multiverse main universe #Added by software-properties deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://mirrors.cn99.com/ubuntu/ bionic-updates main restricted deb-src http://mirrors.cn99.com/ubuntu/ bionic-updates restricted multiverse main universe #Added by software-properties # deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://mirrors.cn99.com/ubuntu/ bionic universe # deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe deb http://mirrors.cn99.com/ubuntu/ bionic-updates universe # deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://mirrors.cn99.com/ubuntu/ bionic multiverse # deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse deb http://mirrors.cn99.com/ubuntu/ bionic-updates multiverse # deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://mirrors.cn99.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.cn99.com/ubuntu/ bionic-backports main restricted universe multiverse #Added by software-properties # deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu bionic partner # deb-src http://archive.canonical.com/ubuntu xenial partner deb http://mirrors.cn99.com/ubuntu/ bionic-security main restricted deb-src http://mirrors.cn99.com/ubuntu/ bionic-security restricted multiverse main universe #Added by software-properties # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted deb http://mirrors.cn99.com/ubuntu/ bionic-security universe # deb-src http://security.ubuntu.com/ubuntu xenial-security universe deb http://mirrors.cn99.com/ubuntu/ bionic-security multiverse deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main # deb-src https://dl.winehq.org/wine-builds/ubuntu/ bionic main deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main # deb-src https://dl.winehq.org/wine-builds/ubuntu/ xenial main # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
3、更新源
sudo apt-get update
但是报如下错:
首先是sources-aliyun._backup和/sources-aliyun-0.list放在了同一个文件夹,于是我将备份文件夹移到文件外,然后再次运行,仍然报错如下
报错显示Key is not abailable
于是通过下述命令进行修复(注意winehq.key不要生成在sources.list.d内):
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
然后再次更新源 sudo apt-get update
本次成功,然后再次通过sudo apt install安装samtools和bcftools,安装后查看版本已成功更新为1.7版本,然后使用软件进行分析时也不再报错。
MSYS2更换软件源
MSYS2更换软件源
方法
更新软件源,只需要将msys64etcpacman.d 目录下的三个文件改为需要配置的软件源即可。
mirrorlist.msys
mirrorlist.mingw64
mirrorlist.mingw32
由于时而有更新,所以软件源网址有时候也更新,如果出现以下问题,可能配置就不正确。
错误:无法从 mirrors.ustc.edu.cn : The requested URL returned error: 404 获取文件 ‘mingw64.db‘
错误:无法从 mirror.bit.edu.cn : The requested URL returned error: 404 获取文件 ‘mingw64.db‘
mingw64 已经是最新版本
错误:无法从 mirrors.ustc.edu.cn : The requested URL returned error: 404 获取文件 ‘msys.db‘
此时,可以直接访问需要更换的软件源,如中科大,直接访问网址中科大软件源,找到需要安装的软件源位置,找到需要的包的URL,备份之前的镜像文件,新建文件删除之前的内容,在对应文件中用以下格式写入即可。
## Server = 需要软件源的URL,如下:
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686
其他镜像同理类似,哈哈,速度很快的。
以上是关于软件版本过低,更换软件源相关问题的主要内容,如果未能解决你的问题,请参考以下文章