使用 tlmgr 安装 texlive 时如何欺骗 yum?

使用 tlmgr 安装 texlive 时如何欺骗 yum?

我使用 yum 安装大多数软件包,但 texlive 除外。不过,每次升级时,一些软件包(R、lyx 等)都会尝试通过 yum 安装。我遵循此解决方案,但有时不起作用;yum 仍会尝试安装 texlive。

有人能告诉我我的“伪造”出了什么问题吗?

这是我的texlive-fake.spec文件:

Name: texlive-fake 
Version: 1.0 
Release: 1%{?dist} 
Summary: This is a fake TeXLive package 
Group: Applications/Publishing 
License: GPLv2 and BSD and Public Domain and LGPLv2+ and GPLv2+ and LPPL 
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

Provides: config(texlive) 
Provides: kpathsea libkpathsea.so.4() 
Provides: tetex tetex-dvips tetex-fonts tetex-latex tex 
Provides: tex(dvips) tex(latex) tex(tex) tex-preview texinfo-tex 
Provides: texlive texlive-afm texlive-context texlive-doc texlive-doc-errata 
Provides: texlive-dvips texlive-dviutils texlive-east-asian texlive-fonts 
Provides: texlive-texmf texlive-latex texlive-utils texlive-xetex 
Provides: texlive-texmf-afm texlive-texmf-context texlive-texmf-doc texlive-texmf-dvips 
Provides: texlive-texmf-errata texlive-texmf-errata-afm texlive-texmf-errata-context 
Provides: texlive-texmf-errata-doc texlive-texmf-errata-dvips texlive-texmf-errata-east-asian 
Provides: texlive-texmf-errata-fonts texlive-texmf-errata-latex texlive-texmf-errata-xetex 
Provides: texlive-texmf-fonts texlive-texmf-latex texlive-texmf-xetex 
Provides: tex(ptmro8t.tfm) tex(ptmri8t.tfm) tex(ptmr8t.tfm) tex(ptmb8t.tfm) tex(phvr8t.tfm) 
Provides: tex(pcrr8t.tfm) tex(inconsolata.sty) tex(ecrm1000.tfm) tex(cm-super-ts1.enc)
Provides: texlive-algorithms
Provides: texlive-amsfonts
Provides: texlive-amsmath
Provides: texlive-attachfile
Provides: texlive-babel
Provides: texlive-babelbib
Provides: texlive-base
Provides: texlive-bera
Provides: texlive-booktabs
Provides: texlive-breakurl
Provides: texlive-caption
Provides: texlive-carlisle
Provides: texlive-chngcntr
Provides: texlive-colortbl
Provides: texlive-csquotes
Provides: texlive-currfile
Provides: texlive-dvipdfm
Provides: texlive-dvipdfm-bin
Provides: texlive-enumitem
Provides: texlive-eso-pic
Provides: texlive-etex-pkg
Provides: texlive-etoolbox
Provides: texlive-fancyvrb
Provides: texlive-filecontents
Provides: texlive-filehook
Provides: texlive-float
Provides: texlive-fontspec
Provides: texlive-footmisc
Provides: texlive-fp
Provides: texlive-geometry
Provides: texlive-graphics
Provides: texlive-hyperref
Provides: texlive-hyphen-base
Provides: texlive-ifetex
Provides: texlive-ifxetex
Provides: texlive-index
Provides: texlive-kastrup
Provides: texlive-koma-script
Provides: texlive-kpathsea
Provides: texlive-kpathsea-bin
Provides: texlive-kpathsea-lib
Provides: texlive-l3kernel
Provides: texlive-l3packages
Provides: texlive-latex
Provides: texlive-latex-fonts
Provides: texlive-latexconfig
Provides: texlive-listings
Provides: texlive-lm
Provides: texlive-lualatex-math
Provides: texlive-luaotfload
Provides: texlive-luaotfload-bin
Provides: texlive-luatex
Provides: texlive-luatex-bin
Provides: texlive-luatexbase
Provides: texlive-marginnote
Provides: texlive-memoir
Provides: texlive-mparhack
Provides: texlive-ms
Provides: texlive-multido
Provides: texlive-oberdiek
Provides: texlive-paralist
Provides: texlive-parallel
Provides: texlive-pdftex
Provides: texlive-pdftex-bin
Provides: texlive-pgf
Provides: texlive-psnfss
Provides: texlive-pst-3d
Provides: texlive-pst-coil
Provides: texlive-pst-eps
Provides: texlive-pst-fill
Provides: texlive-pst-grad
Provides: texlive-pst-math
Provides: texlive-pst-node
Provides: texlive-pst-plot
Provides: texlive-pst-text
Provides: texlive-pst-tree
Provides: texlive-pstricks
Provides: texlive-pstricks-add
Provides: texlive-qstest
Provides: texlive-sauerj
Provides: texlive-setspace
Provides: texlive-showexpl
Provides: texlive-soul
Provides: texlive-subfig
Provides: texlive-tetex
Provides: texlive-tetex-bin
Provides: texlive-thumbpdf
Provides: texlive-thumbpdf-bin
Provides: texlive-tipa
Provides: texlive-tools
Provides: texlive-ulem
Provides: texlive-underscore
Provides: texlive-unicode-math
Provides: texlive-url
Provides: texlive-varwidth
Provides: texlive-xcolor
Provides: texlive-xkeyval
Provides: texlive-xunicode

%description 

This was necessary to have a tlmgr-based installation of texlive and all the rpm packages that requires texlive (e.g., a2ps and R-core) still installable.

%prep

%build

%install 

rm -rf $RPM_BUILD_ROOT

%clean 

rm -rf $RPM_BUILD_ROOT

%files 

%defattr(-,root,root,-) 

%doc

%changelog

安装如下: #rpm -qa | grep texlive texlive-fake-1.0-1.el7.local.x86_64

但是,yum update lyx需要安装 texlive 的依赖项:

================================================================================
 Package               Arch   Version                                Repository
                                                                           Size
================================================================================
Updating:
 lyx                   x86_64 2.1.4-7.el7                            epel 4.1 M
Installing for dependencies:
 texlive-algorithms    noarch 2:svn15878.0.1-38.el7                  base  21 k
 texlive-amsfonts      noarch 2:svn29208.3.04-38.el7                 base 3.6 M
 texlive-amsmath       noarch 2:svn29327.2.14-38.el7                 base  49 k
 texlive-attachfile    noarch 2:svn21866.v1.5b-38.el7                base  21 k
 texlive-babel         noarch 2:svn24756.3.8m-38.el7                 base 129 k
 texlive-babelbib      noarch 2:svn25245.1.31-38.el7                 base  49 k
 texlive-bera          noarch 2:svn20031.0-38.el7                    base 347 k
 texlive-booktabs      noarch 2:svn15878.1.61803-38.el7              base  19 k
 texlive-breakurl      noarch 2:svn15878.1.30-38.el7                 base  20 k
 texlive-caption       noarch 2:svn29026.3.3__2013_02_03_-38.el7     base  51 k
 texlive-carlisle      noarch 2:svn18258.0-38.el7                    base  29 k
 texlive-chngcntr      noarch 2:svn17157.1.0a-38.el7                 base  19 k
 texlive-colortbl      noarch 2:svn25394.v1.0a-38.el7                base  20 k
 texlive-csquotes      noarch 2:svn24393.5.1d-38.el7                 base  36 k
 texlive-currfile      noarch 2:svn29012.0.7b-38.el7                 base  21 k
 texlive-dvipdfm       noarch 2:svn26689.0.13.2d-38.el7              base  23 k
 texlive-dvipdfm-bin   noarch 2:svn13663.0-38.20130427_r30134.el7    base  18 k
 texlive-enumitem      noarch 2:svn24146.3.5.2-38.el7                base  29 k
 texlive-eso-pic       noarch 2:svn21515.2.0c-38.el7                 base  21 k
 texlive-etex-pkg      noarch 2:svn15878.2.0-38.el7                  base  22 k
 texlive-etoolbox      noarch 2:svn20922.2.1-38.el7                  base  25 k
 texlive-fancyvrb      noarch 2:svn18492.2.8-38.el7                  base  30 k
 texlive-filecontents  noarch 2:svn24250.1.3-38.el7                  base  19 k
 texlive-filehook      noarch 2:svn24280.0.5d-38.el7                 base  22 k
 texlive-float         noarch 2:svn15878.1.3d-38.el7                 base  20 k
 texlive-fontspec      noarch 2:svn29412.v2.3a-38.el7                base  38 k
 texlive-footmisc      noarch 2:svn23330.5.5b-38.el7                 base  23 k
 texlive-fp            noarch 2:svn15878.0-38.el7                    base  39 k
 texlive-geometry      noarch 2:svn19716.5.6-38.el7                  base  26 k
 texlive-graphics      noarch 2:svn25405.1.0o-38.el7                 base  33 k
 texlive-hyperref      noarch 2:svn28213.6.83m-38.el7                base 139 k
 texlive-hyphen-base   noarch 2:svn29197.0-38.el7                    base  39 k
 texlive-ifetex        noarch 2:svn24853.1.2-38.el7                  base  18 k
 texlive-ifxetex       noarch 2:svn19685.0.5-38.el7                  base  18 k
 texlive-index         noarch 2:svn24099.4.1beta-38.el7              base  29 k
 texlive-kastrup       noarch 2:svn15878.0-38.el7                    base  18 k
 texlive-koma-script   noarch 2:svn27255.3.11b-38.el7                base 5.1 M
 texlive-kpathsea      noarch 2:svn28792.0-38.el7                    base 140 k
 texlive-l3kernel      noarch 2:svn29409.SVN_4469-38.el7             base 107 k
 texlive-l3packages    noarch 2:svn29361.SVN_4467-38.el7             base  36 k
 texlive-latex         noarch 2:svn27907.0-38.el7                    base 197 k
 texlive-latex-fonts   noarch 2:svn28888.0-38.el7                    base  42 k
 texlive-latexconfig   noarch 2:svn28991.0-38.el7                    base  26 k
 texlive-listings      noarch 2:svn15878.1.4-38.el7                  base 138 k
 texlive-lm            noarch 2:svn28119.2.004-38.el7                base  13 M
 texlive-lualatex-math noarch 2:svn29346.1.2-38.el7                  base  21 k
 texlive-luaotfload    noarch 2:svn26718.1.26-38.el7                 base 101 k
 texlive-luatex        noarch 2:svn26689.0.70.1-38.el7               base  37 k
 texlive-luatexbase    noarch 2:svn22560.0.31-38.el7                 base  27 k
 texlive-marginnote    noarch 2:svn25880.v1.1i-38.el7                base  20 k
 texlive-memoir        noarch 2:svn21638.3.6j_patch_6.0g-38.el7      base  97 k
 texlive-mparhack      noarch 2:svn15878.1.4-38.el7                  base  20 k
 texlive-ms            noarch 2:svn24467.0-38.el7                    base  24 k
 texlive-multido       noarch 2:svn18302.1.42-38.el7                 base  21 k
 texlive-oberdiek      noarch 2:svn26725.0-38.el7                    base 307 k
 texlive-paralist      noarch 2:svn15878.2.3b-38.el7                 base  21 k
 texlive-parallel      noarch 2:svn15878.0-38.el7                    base  21 k
 texlive-pdftex        noarch 2:svn29585.1.40.11-38.el7              base 140 k
 texlive-pgf           noarch 2:svn22614.2.10-38.el7                 base 468 k
 texlive-psnfss        noarch 2:svn23394.9.2a-38.el7                 base  45 k
 texlive-pst-3d        noarch 2:svn17257.1.10-38.el7                 base  21 k
 texlive-pst-coil      noarch 2:svn24020.1.06-38.el7                 base  21 k
 texlive-pst-eps       noarch 2:svn15878.1.0-38.el7                  base  20 k
 texlive-pst-fill      noarch 2:svn15878.1.01-38.el7                 base  21 k
 texlive-pst-grad      noarch 2:svn15878.1.06-38.el7                 base  21 k
 texlive-pst-math      noarch 2:svn20176.0.61-38.el7                 base  22 k
 texlive-pst-node      noarch 2:svn27799.1.25-38.el7                 base  40 k
 texlive-pst-plot      noarch 2:svn28729.1.44-38.el7                 base  36 k
 texlive-pst-text      noarch 2:svn15878.1.00-38.el7                 base  21 k
 texlive-pst-tree      noarch 2:svn24142.1.12-38.el7                 base  24 k
 texlive-pstricks      noarch 2:svn29678.2.39-38.el7                 base  97 k
 texlive-pstricks-add  noarch 2:svn28750.3.59-38.el7                 base  41 k
 texlive-qstest        noarch 2:svn15878.0-38.el7                    base  22 k
 texlive-sauerj        noarch 2:svn15878.0-38.el7                    base  23 k
 texlive-setspace      noarch 2:svn24881.6.7a-38.el7                 base  24 k
 texlive-showexpl      noarch 2:svn27790.v0.3j-38.el7                base  21 k
 texlive-soul          noarch 2:svn15878.2.4-38.el7                  base  23 k
 texlive-subfig        noarch 2:svn15878.1.3-38.el7                  base  24 k
 texlive-tetex         noarch 2:svn29585.3.0-38.el7                  base  88 k
 texlive-thumbpdf      noarch 2:svn26689.3.15-38.el7                 base  38 k
 texlive-tipa          noarch 2:svn29349.1.3-38.el7                  base 2.8 M
 texlive-tools         noarch 2:svn26263.0-38.el7                    base  62 k
 texlive-ulem          noarch 2:svn26785.0-38.el7                    base  26 k
 texlive-underscore    noarch 2:svn18261.0-38.el7                    base  22 k
 texlive-unicode-math  noarch 2:svn29413.0.7d-38.el7                 base  61 k
 texlive-url           noarch 2:svn16864.3.2-38.el7                  base  26 k
 texlive-varwidth      noarch 2:svn24104.0.92-38.el7                 base  21 k
 texlive-xcolor        noarch 2:svn15878.2.11-38.el7                 base  35 k
 texlive-xkeyval       noarch 2:svn27995.2.6a-38.el7                 base  27 k
 texlive-xunicode      noarch 2:svn23897.0.981-38.el7                base  44 k
Updating for dependencies:
 lyx-common            noarch 2.1.4-7.el7                            epel 7.5 M
 lyx-fonts             noarch 2.1.4-7.el7                            epel 166 k

Transaction Summary
================================================================================
Install             ( 90 Dependent packages)
Upgrade  1 Package  (+ 2 Dependent packages)

(顺便说一下,我使用的是 CentOS 7)

答案1

不幸的是,CTAN 上的软件包texlive-dummy似乎不包含源代码。因此,虽然它们声称是在 LPPL 下发布的,但实际上很难或不可能修改它们。由于它们是特定于发行版的,并且没有为 Fedora 提供,因此不清楚它们在这种情况下会如何工作。

说实话,我根本不知道 CTAN 上提供了这样的软件包。我不确定我所依赖的是什么,但这就是它。我肯定在某处查找了构建 RPM 的说明,并且我可能从我为满足 Arch 的要求而构建的虚假软件包中改编了其中的部分内容pacman

我最初在当时最新的 Fedora 上为 TeX Live 2012 安装了这个。虽然我的机器上不再有 Fedora 和 TeX Live,但安装的软件包在 TeX Live 2015 上仍然运行良好,在我上周擦除磁盘之前一切都很好。

将以下内容保存为texlive2015-dummy-Jos.spec

Name:    texlive2015-dummy-Jos
Version: 1.0
Release: 2%{?dist}
Summary: This is a fake TeXLive package
Group:   Applications/Publishing
License: GPLv2 and BSD and Public Domain and LGPLv2+ and GPLv2+ and LPPL
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)                   
Provides: config(texlive)
Provides: kpathsea libkpathsea.so.4()
Provides: tetex tetex-dvips tetex-fonts tetex-latex tex 
Provides: tex(dvips) tex(latex) tex(tex) tex-preview texinfo-tex
Provides: texlive texlive-afm texlive-context texlive-doc texlive-doc-errata
Provides: texlive-dvips texlive-dviutils texlive-east-asian texlive-fonts
Provides: texlive-texmf texlive-latex texlive-utils texlive-xetex          
Provides: texlive-texmf-afm texlive-texmf-context texlive-texmf-doc texlive-texmf-dvips                               
Provides: texlive-texmf-errata texlive-texmf-errata-afm texlive-texmf-errata-context
Provides: texlive-texmf-errata-doc texlive-texmf-errata-dvips texlive-texmf-errata-east-asian
Provides: texlive-texmf-errata-fonts texlive-texmf-errata-latex texlive-texmf-errata-xetex                      
Provides: texlive-texmf-fonts texlive-texmf-latex texlive-texmf-xetex                             
Provides: tetex-IEEEtran tetex-dvipost tetex-elsevier tetex-tex4ht
Provides: tetex-xdvi xdvik

%description
This was necessary to have a tlmgr-based installation of texlive and all the rpm packages that requires texlive (e.g., a2ps and R-core) still installable.

%prep

%build

%install
rm -rf $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc

%changelog

构建:

  1. 创建一个虚拟目录;
  2. 复制texlive2015-dummy-Jos.spec到目录中;
  3. cd进入目录;
  4. 跑步rpmbuild -bb texlive2015-dummy-Jos.spec

输出将告诉您在哪里.rpm

例如,使用包管理器安装 Kile 时,这种方法效果很好。如果 LyX 想要安装 TeX Live 提供的其他内容,请将相关包名称添加到 中.spec,将版本号增加到 (例如从23),重建.rpm并重新安装包。

这样做的好处是,如果 Fedora 的包装发生变化或者有其他软件包可用并列为您想要通过包管理器安装的软件的依赖项,则可以很容易地扩展和修改它。

请注意,yum已弃用。如果您有较新版本的 Fedora(例如 23+ - 不确定 22),dnf则应改用。(当然,您应该有较新版本,因为旧版本不安全。)

答案2

正如 daleif 所建议的,该软件包位于 CTAN 上。它被称为“texlive-dummy”(至少对于基于 RedHat 的发行版而言),并且运行良好。

相关内容