美文网首页
源码编译安装Transmission 2.93(debian 7

源码编译安装Transmission 2.93(debian 7

作者: 未末星空 | 来源:发表于2018-04-09 19:43 被阅读736次

    各种安装不如源码来得直接,终于还是选择源码编译安装
    数据不用迁移,只需要复制一份现有的文件
    新版本安装后直接copy过去即可~~~
    这有点像utorrent有备份的种子文件、配置文件就行一样的
    安装环境:debian 7
    参考链接:

    apt-get update
    wget https://github.com/transmission/transmission-releases/raw/master/transmission-2.93.tar.xz
    tar xf transmission-2.93.tar.xz
    cd transmission-2.93
    

    其实这里和官方的没多少差异,重点在下面

    ./configure
    make
    make install
    

    好了,我从./configure这里开始就一路报错,缺少各种东西...
    为什么不在一开始直接apt-get install build-essential xxx来解决缺少的东西呢?我认为这样可能会导致各种类型的奇怪错误,不如直接./configure然后提示差什么就安装什么,因为每个人的系统安装的东西不太一样,比如我这个源下安装最多是2.52的版本...下面是我执行./configure遇到的报错:

    checking for pkg-config... no
    checking for LIBCURL... configure: error: in `/root/transmission-2.93':
    configure: error: The pkg-config script could not be found or is too old.  Make sure it
    is in your PATH or set the PKG_CONFIG environment variable to the full
    path to pkg-config.
    
    Alternatively, you may set the environment variables LIBCURL_CFLAGS
    and LIBCURL_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    
    To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
    See `config.log' for more details
    

    安装缺少的pkg-config(如果安装失败请在install后加上-y,第二行):

    apt-get install -f 
    apt-get install pkg-config
    

    再次执行./configure还有如下的错误:

    checking for LIBCURL... configure: error: Package requirements (libcurl >= 7.15.4) were not met:
    
    No package 'libcurl' found
    
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    
    Alternatively, you may set the environment variables LIBCURL_CFLAGS
    and LIBCURL_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    

    少啥安装啥

    apt-get install libcurl4-openssl-dev
    

    继续编译

    checking for LIBEVENT... configure: error: Package requirements (libevent >= 2.0.10) were not met:
    
    No package 'libevent' found
    
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    
    Alternatively, you may set the environment variables LIBEVENT_CFLAGS
    and LIBEVENT_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    

    安装libevent

    apt-get install libevent-dev
    

    也许缺少intltool,安装

    apt-get install intltool
    

    然后./configure编译成功了

    image.png
    继续执行
    make
    make install
    

    make成功


    image.png

    make install成功


    image.png
    然后是这个(虽然我并不知道这个具体是什么,但是必须做这个)

    但是从PPA源安装旧版本并升级到2.93的用户,原先使用的是init.d进行管理的,并不是systemctl。而且原来的管理用户是debian-transmission,而现在变成了transmission
    ——https://blog.rhilip.info/archives/787/

    新建一个文件

    vi /etc/systemd/system/transmission.service
    

    写入以下内容

    [Unit]
    Description=Transmission BitTorrent Daemon
    After=network.target
    
    [Service]
    User=root
    LimitNOFILE=100000
    ExecStart=/usr/local/bin/transmission-daemon -f --log-error -g /usr/local/share/transmission
    
    [Install]
    WantedBy=multi-user.target
    

    然后应该执行

    systemctl daemon-reload
    

    但是我这提示木有systemctl
    安装systemctl

    apt-get install systemd-sysv
    

    然后重启(这里操作看自己,我这必须重启命令才生效)

    reboot
    

    然后你可以执行下面这个命令来检查是不是正常了

    systemctl status ssh.service
    

    正常结果


    image.png

    现在执行下面的命令生成初始设定

    systemctl daemon-reload
    systemctl start transmission.service
    systemctl stop transmission.service
    

    然后修改配置文件(你可以直接copy原来的配置文件过来)

    vi /usr/local/share/transmission/settings.json
    

    详细配置略过,可参考官方的,也可以看这里的
    https://wp.madjack.info/linux/debian-8-ubuntu-16-04-%E6%BA%90%E7%A2%BC%E7%B7%A8%E8%AD%AF-transmission-2-93.html
    现在还需要将原来的数据记录备份过来
    请找到你原来安装的数据存放的地方
    比如我是这里

    /var/lib/transmission-daemon/
    

    这个目录下有两个文件夹,一个是downloads一个是info,需要将info中的resume文件夹和torrents文件夹覆盖/usr/local/share/transmission/下对应文件夹
    这里不需要更改downloads目录,因为resume中的记录的文件保存路径依然是这个,所以不需要移动文件。
    当然你可以在对/etc/systemd/system/transmission.service写入配置时更改ExecStart这一行-g后的目录参数为原有的目录,比如我这里是/var/lib/transmission-daemon/info/这样不用移动resume和torrents文件夹。采用前面的设置,将无法使用一键web美化,可以尝试这里说的更改目录为原目录,或者手动替换~
    现在可以正式启动了

    systemctl start transmission.service
    systemctl enable transmission.service
    

    停止命令是

    systemctl stop transmission.service
    

    web界面一览


    image.png

    Windows GUI(新版的好像不那么卡了)


    image.png

    相关文章

      网友评论

          本文标题:源码编译安装Transmission 2.93(debian 7

          本文链接:https://www.haomeiwen.com/subject/jwzihftx.html