Debian/Ubuntu使用Nexus的私有镜像源

以Debian11为例

  1. 修改/etc/apt/source.list

    vim /etc/apt/source.list
    # deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    #deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    deb http://deb.debian.org/debian/ bullseye main
    deb-src http://deb.debian.org/debian/ bullseye main
    
    deb http://security.debian.org/debian-security bullseye-security main contrib
    deb-src http://security.debian.org/debian-security bullseye-security main contrib
    
    # bullseye-updates, to get updates before a point release is made;
    # see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
    deb http://deb.debian.org/debian/ bullseye-updates main contrib
    deb-src http://deb.debian.org/debian/ bullseye-updates main contrib

    把其中的地址替换成你的私有镜像源地址

    # deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    #deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    deb http://mirror.nfools.org:8081/repository/debian-bullseye/ bullseye main
    deb-src http://mirror.nfools.org:8081/repository/debian-bullseye/ bullseye main
    
    deb http://security.debian.org/debian-security bullseye-security main contrib
    deb-src http://security.debian.org/debian-security bullseye-security main contrib
    
    # bullseye-updates, to get updates before a point release is made;
    # see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
    deb http://deb.debian.org/debian/ bullseye-updates main contrib
    deb-src http://deb.debian.org/debian/ bullseye-updates main contrib

    保存并退出

  2. 创建/etc/apt/auth.conf.d/nexus.local.intranet.conf(如果你的仓库允许匿名访问,则忽略这一步)

    vim /etc/apt/auth.conf.d/nexus.local.intranet.conf

    配置你的镜像源地址、登录名和密码

    machine http://mirror.nfools.org:8081/
    login public
    password public

    保存并退出

  3. 更新apt

    apt update

以Ubuntu为例

同上,略。

标签: none

添加新评论