-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-pdftk-on-unbuntu-1804.html
executable file
·177 lines (150 loc) · 8.4 KB
/
install-pdftk-on-unbuntu-1804.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html lang="en">
<head>
<title>Install pdftk on unbuntu 18.04</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Carson's Tech Hut Full Atom Feed" />
<link href="/feeds/tutorial.atom.xml" type="application/atom+xml" rel="alternate" title="Carson's Tech Hut Categories Atom Feed" />
<script>
/* Javascript code to toggle between adding and removing the
"responsive" class to nav when the user clicks on the icon */
function myFunction() {
var x = document.getElementById("nav-bar");
if (x.className === "nav") {
x.className += " responsive";
} else {
x.className = "nav";
}
}
</script>
</head>
<body>
<div class="navigation pure-menu pure-menu-horizontal">
<div class="nav", id="nav-bar">
<a href="/" class="page-container pure-menu-heading pure-menu-link nav">Carson's Tech Hut</a>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="../archives.html" class="pure-menu-link">All posts</a></li>
<li class="pure-menu-item"><a href="../categories.html" class="pure-menu-link">Categories</a></li>
<li class="pure-menu-item"><a href="../tags.html" class="pure-menu-link">Tags</a></li>
</ul>
<a href="javascript:void(0);" class="icon pure-menu-link" onclick="myFunction()">
<i class="fas fa-bars"></i>
</a>
</div>
</div>
<div class="page-container">
<div class="entry-content">
<div class="post-meta pure-u">
<div class="pure-u">
<img src="../theme/images/authors/Logo.png" class="post-avatar" alt="Go to the profile of Carson Zhang">
</div>
<div class="pure-u meta-data">
<a href="/author/carson-zhang.html" class="category">Carson Zhang</a><br />
Senior Software Developer
<br />
<abbr title="2018-06-27T00:00:00-06:00">Wed 27 June 2018</abbr>
• 5 min read
</div>
</div>
</div>
<div class="article-header-container">
<div class="background-image-container">
<div class="background-image-small">
<div class="title-container">
<h1>Install pdftk on unbuntu 18.04</h1>
</div>
</div>
</div>
</div>
<div class="entry-content">
<!--
<div align="right">
Author:<br>
<a href="/author/carson-zhang.html">Carson Zhang</a><br>
</div>
-->
<p>PDFTK is a very handy package that handles PDFs. It could open and write to existing PDFs, and a lot of other great things. However, it is missing from the Ubuntu 18 and is very tricky to install on Ubuntu 18 (but works nice and smoothly on Ubuntu 16). This tutorial is intended to save you some time/hair when you have to install PDFTK on ubuntu 18.</p>
<ol>
<li>RUN <code>sudo apt-get update</code> to update the current libs</li>
<li>RUN <code>sudo apt-get install libcairo2 libpango-1.0-0 libpangocairo-1.0.0 libgdk-pixbuf2.0-0 libffi-dev libmagickwand-dev</code> to install all the necessary packages</li>
<li>RUN <code>locate sources.list</code> to find the path for the <em>sources.list</em> file<ul>
<li>It is <em>/etc/apt/sources.list</em> on my machine</li>
</ul>
</li>
<li>RUN <code>sudo nano /etc/apt/sources.list</code> to go into the file and edit it</li>
<li>Add the following lines to the bottom of the file:</li>
</ol>
<div class="highlight"><pre><span></span><span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful</span> <span class="kp">main</span> <span class="kp">restricted</span>
<span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful-updates</span> <span class="kp">main</span> <span class="kp">restricted</span>
<span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful</span> <span class="kp">universe</span>
<span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful-updates</span> <span class="kp">universe</span>
<span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful</span> <span class="kp">multiverse</span>
<span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful-updates</span> <span class="kp">multiverse</span>
<span class="k">deb</span> <span class="s">http://no.archive.ubuntu.com/ubuntu/</span> <span class="kp">artful-backports</span> <span class="kp">main</span> <span class="kp">restricted</span> <span class="kp">universe</span> <span class="kp">multiverse</span>
<span class="k">deb</span> <span class="s">http://security.ubuntu.com/ubuntu</span> <span class="kp">artful-security</span> <span class="kp">main</span> <span class="kp">restricted</span>
<span class="k">deb</span> <span class="s">http://security.ubuntu.com/ubuntu</span> <span class="kp">artful-security</span> <span class="kp">universe</span>
<span class="k">deb</span> <span class="s">http://security.ubuntu.com/ubuntu</span> <span class="kp">artful-security</span> <span class="kp">multiverse</span>
</pre></div>
<ol>
<li>Use <code>CTRL + x</code> (and hit enter) to save and quit</li>
<li>Update the system: <code>sudo apt update</code></li>
<li>Install related system packages in the folowing order:<ul>
<li><code>sudo apt-get install libgcj-common</code></li>
<li><code>sudo apt-get install libgcj17</code></li>
</ul>
</li>
<li>Install the pdftk package: <code>sudo apt-get install pdftk</code></li>
<li>After the pdftk package is installed, go back to the sources.list file (i.e step 4) and delete the lines we added in step 5</li>
<li>Update system again (i.e. step 7)</li>
</ol>
<h4>Notes:</h4>
<ul>
<li>PDFTK package is not supported in ubuntu 18 since it depends on a previous system package, and last version that supports this package was ubuntu 17.</li>
<li>The above way of installation was to add some ubuntu 17 reference package information on the system source file on ubuntu 18, and then install the pdftk package. </li>
<li>After the pdftk is installed, get rid of the information that was added to the system file so that the system update won't install older version of packages</li>
<li>This instruction was based on the post <a href="https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-bionic"><strong>HERE</strong></a>, and it is a combination of the answers from <em>Wikrle</em> and <em>amha</em></li>
</ul>
</div>
<footer>
<div class="tags">
<a href="/tag/python.html">Python</a>
<a href="/tag/pdf.html">PDF</a>
<a href="/tag/pdftk.html">pdftk</a>
<a href="/tag/ubuntu.html">Ubuntu</a>
</div>
<div class="pure-g post-footer">
<div class="pure-g">
<div class="pure-g poster-info">
<div class="pure-u">
<a href="/author/carson-zhang.html"><img src="../theme/images/authors/Logo.png" alt=""></a>
</div>
<div class="pure-u">
<h3 class="author-name"><a href="/author/carson-zhang.html">Carson Zhang</a></h3>
<p class="author-description">
I'm a senior software developer, passionated with artificial intellgence and
web development.
</p>
</div>
</div>
</div>
<!--
-->
</div>
</footer>
</div>
<footer class="index-footer">
<div class="footer-wide">
<p><a href="">Carson's Tech Hut</a>© Carson Zhang 2020</p>
</div>
<div class="footer-narrow">
<p><a href="">Carson's Tech Hut</a><br>
© Carson Zhang 2020</p>
</div>
</footer>
<link rel="stylesheet" href="../theme/css/pure-min.css" />
<link rel="stylesheet" href="../theme/css/grids-responsive-min.css" />
<link rel="stylesheet" href="../theme/fontawesome-free-5.13.0-web/css/all.min.css" />
<link rel="stylesheet" href="/theme/css/main.css" />
</body>
</html>